Giter VIP home page Giter VIP logo

members-data-api's Introduction

Membership Attribute Service

The membership attribute service provides an API for managing and retrieving membership attributes associated with a user.

Nginx configuration

Follow these nginx setup instructions

Endpoints

For access to the /me endpoints, valid GU_U and SC_GU_U must be provided in the Cookie request header.

GET /user-attributes/me/membership

Success responses:

{
  "membershipNumber": "1234567abcdef",
  "tier": "patron",
  "userId": "123",
  "contentAccess":{ "member":true, "paidMember":true }
}

Error responses:

{
  "message": "Bad Request",
  "details": "Detailed error message"
}

GET /user-attributes/me/features

Responses:

{
  "adfree": true,
  "adblockMessage": false,
  "userId": "123"
}

Running Locally

Ensure that your ~/.aws/credentials file contains the following:

[membership]
aws_access_key_id=YOUR_ACCESS_KEY
aws_secret_access_key=YOUR_SECRET_KEY

These credentials are required for accessing the DynamoDB table. When running tests, a local version of DynamoDB is used.

To start the service use:

    $ sbt
    > project membership-attribute-service
    > devrun

The service will be starting on 9400 and use the MembershipAttributes-DEV DynamoDB table.

Loading initial dataset

  • Make sure that the outbound messages are pointing to your instance

  • Truncate your DB

  • Download a CSV report file from Salesforce containing the required fields. The header should be

    "IdentityID","Membership Number","Membership Tier","Last Modified Date"
  • Increase the write throughput of you dynamoDB instance (100 should be enough)

  • run sbt -Dconfig.resource=[DEV|PROD].conf ";project membership-attribute-service ;batch-load <path/to/csvfile.csv>"

  • Decrease the write throughput of you dynamoDB instance to 1

  • Check that no records have been altered during the time the command takes to run. It's easy to check via the Membership History object in Salesforce.

Metrics and Logs

There is a Membership Attributes Service radiator. This uses standard ELB and DynamoBB CloudWatch metrics for the CloudFormation stack in the chosen stage.

Provisioning

The packer cloud formation template should be used to create an AMI with Oracle Java 8 installed. The base AMI which should be used with this is Ubuntu Trusty 14.04 (ami-acc41cdb).

The output AMI from packer should be used with the membership-attribute-service cloud formation template.

members-data-api's People

Contributors

danmassie avatar kenlim avatar markjamesbutler avatar ostapneko avatar rtyley avatar tudorraul avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.