Skip to content

Conversation

@mmiermans
Copy link
Contributor

@mmiermans mmiermans commented Feb 14, 2024

Goal

Use different jwk keys in development and production for the Content team's Pocket JWKs.

What changed

  • Feat: Change pocket development key ids (kids).
  • Fix: Get Github superlinter to pass.
  • Fix: Add --elv2-license accept to start:dev script.
  • Fix: Set NODE_ENV to 'development' in Pocket-Dev. Previously it was set to 'production'. 😕

Implementation Decisions

References

JIRA ticket:

dotcom-gateway PR:

@mmiermans mmiermans changed the title Feat dev jwk key ids feat: [MC-690] Distinct Pocket dev JWK key ids Feb 15, 2024
@mmiermans mmiermans marked this pull request as ready for review February 15, 2024 01:00
@mmiermans mmiermans requested a review from a team as a code owner February 15, 2024 01:01
@mmiermans mmiermans requested review from jpetto and kschelonka and removed request for a team February 15, 2024 01:01
@mmiermans mmiermans requested review from katerinachinnappan and removed request for kschelonka February 15, 2024 19:29
Possibly admin-api can't find the key id when it's not cached..?

Locally it works fine, but on Pocket-Dev the following error occurs for the same
request:

Context creation failed: Could not validate User: secret or public key must be provided
I pulled the latest image from Pocket-Dev and it's set to production
  # echo $NODE_ENV
  production
Copy link
Contributor

@katerinachinnappan katerinachinnappan left a comment

Choose a reason for hiding this comment

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

🔥

Required 'Lint Code Base' failed to run.
],
envVars: [
{
name: 'ENVIRONMENT',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked that ENVIRONMENT was not used by searching the codebase.

return jwksClient({
jwksUri,
cache: true, // Default Value
cacheMaxEntries: 5, // Default value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We increased the number of keys. Increasing cacheMaxEntries might prevent performance issues, if we have more than 5 keys. The number 100 was chosen arbitrarily.

@mmiermans mmiermans merged commit 0964ccc into main Feb 20, 2024
@mmiermans mmiermans deleted the feat-dev-jwk-key-ids branch February 20, 2024 20:07
mmiermans added a commit that referenced this pull request Feb 21, 2024
Error: When a manual configuration is not provided, gateway requires an Apollo configuration.

Local development should use NODE_END=local since #361
mmiermans added a commit that referenced this pull request Feb 22, 2024
Error: When a manual configuration is not provided, gateway requires an Apollo configuration.

Local development should use NODE_END=local since #361
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.

4 participants