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

feat: showcase dynamic derived data with SDK #109

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

kschiew
Copy link
Contributor

@kschiew kschiew commented Aug 31, 2023

Working draft for testing TypeScript SDK rules() API.

Deploy Notes

** Environment variables **:

  • RULES_ENGINE_DEV_ENDPOINT: Rules Engine local endpoint, eg "http://localhost:3001/api/rules/eval"
  • SGID_RULE_IDS: A space-separated string consisting of rule ID's passed into Rules API call, eg "ISOGPOFFICER-53270fce ISOGPOFFICER-aed06721"

config/index.ts Outdated
@@ -7,3 +7,4 @@ export const PORT = process.env.PORT || 10000
export const SCOPES = process.env.SCOPES || 'openid'
export const DEV_AND_STAGING_SCOPES =
process.env.DEV_AND_STAGING_SCOPES || 'openid'
export const SGID_RULE_NAMES = process.env.SGID_RULE_NAMES || ''
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the rationale for rule names to be defined as a separate variable as opposed to an argument to the sgID client?

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 was mirroring how scopes work - RP's have the options to pass in different sets of scopes for every complete sgID flow. Let's say we pass in rules as an argument to the sgID client (eg. <some_rule_that_depends_on_pocdex.public_officer_employments>), and if RP did not pass in pocdex.public_officer_employments in authUrl, the Rules API call would fail because RP has not obtained consent for the underlying referenced field.

Besides, I think having consistency in how we handle scopes and rules would be good DX.

p/s: We are using rule ID's instead of rule names to identify rules now because of Rules Engine design changes.

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