Skip to content
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

Merged
merged 30 commits into from
Nov 14, 2024
Merged

Press reader entitlements API #2513

merged 30 commits into from
Nov 14, 2024

Conversation

andrewHEguardian
Copy link
Contributor

@andrewHEguardian andrewHEguardian commented Oct 18, 2024

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
image

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.

@rupertbates rupertbates force-pushed the press-reader-entitlements branch from 5a05381 to cd070df Compare November 11, 2024 16:46
import { getIdentityIdSchema } from './schemas';

export async function getIdentityClientAccessToken() {
const ssmClient = new SSMClient(awsConfig);
Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good idea

@andrewHEguardian andrewHEguardian changed the title Press reader entitlements Press reader entitlements API Nov 13, 2024
@rupertbates rupertbates merged commit fc0a9ca into main Nov 14, 2024
47 checks passed
@rupertbates rupertbates deleted the press-reader-entitlements branch November 14, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants