Skip to content

Conversation

@paula-stacho
Copy link
Collaborator

@paula-stacho paula-stacho commented Feb 26, 2024

https://jira.mongodb.org/browse/COMPASS-7646

Description

The new process of obtaining OIDC HTTP Server Pages:

1. JSON templates are generated at build of @mongodb-js/oidc-http-server-pages

Example json:

{
  "OIDCNotFoundPage": {
    "parameters": {
      "productName": "{{prop:ProductName}}"
    },
    "html": "<div>Page not found, product is {{prop:ProductName}}</div>"
  }
}

These templates can be used directly by other languages. In devtools-connect, we still have the convenient way of:

2. Pages are requested via getStaticPage

Example usage:

getStaticPage(HttpServerPage.OIDCNotFoundPage, { productName: 'Some product' })

I have tested the pages locally using the test-oidc-pages.js script in devtools-connect. I haven't noticed anything weird and comparing the before-and-after of NotFound Page Source showed no differences. Feel free to double check, especially if you're already familiar with the pages.

This is definitely a breaking change for @mongodb-js/oidc-http-server-pages, but there should be no change in behaviour for @mongodb-js/devtools-connect, which is the only one use externally (as of now). All together, I'd say this is a feat as it brings the JSON templates. I have increased the @mongodb-js/oidc-http-server-pages major version manually.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added

@paula-stacho paula-stacho marked this pull request as ready for review February 26, 2024 13:17
@paula-stacho paula-stacho merged commit 1c8b46f into main Mar 1, 2024
@paula-stacho paula-stacho deleted the COMPASS-7646 branch March 1, 2024 17:11
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.

3 participants