-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Press reader entitlements API #2513
Conversation
Deploy build 9593 of
|
Deploy build 9593 of
|
Deploy build 9593 of
|
Deploy build 9360 of
|
- fix valid products array type
5a05381
to
cd070df
Compare
import { getIdentityIdSchema } from './schemas'; | ||
|
||
export async function getIdentityClientAccessToken() { | ||
const ssmClient = new SSMClient(awsConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put this outside the function, the same way we're doing with the dynamoClient
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put the fetching of the client access token into a Lazy
value so that it will only be fetched once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! That's very cool. Should we do the same for loading the product catalog?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good idea
What does this change?
Create a new API gateway + lambda to serve user entitlements to Press Reader app. We accept a user ID, which we will swap for an identity ID and query supporter product data to work out whether someone is entitled to use the app. The response is an XML doc.
Trello card
How to test
Make a request to https://press-reader-entitlements-code.support.guardianapis.com/user-entitlements with a user ID query param and the api key as a header.