Skip to content

Commit

Permalink
feat: Switch logto role assignment to subscription webhook [DEV-4164] (
Browse files Browse the repository at this point in the history
…#565)

* feat: Switch logto role assignment to subscription webhook

Signed-off-by: jay-dee7 <[email protected]>

* remove: Default role assignments

Signed-off-by: jay-dee7 <[email protected]>

* fix: Default role assignment

Signed-off-by: jay-dee7 <[email protected]>

* refactor: Initialise stripe client once in submitter constructor

Signed-off-by: jay-dee7 <[email protected]>

* fix: Error response codes and local entities and other variables

Signed-off-by: jay-dee7 <[email protected]>

* refactor: Convert SupportedPlanTypes to `String Enum`

Signed-off-by: jay-dee7 <[email protected]>

* chore: Bump jest `testTimeout` to 10s

Signed-off-by: jay-dee7 <[email protected]>

* fix: Breaking tests

Signed-off-by: jay-dee7 <[email protected]>

* fix: Include portal role while assigning roles if missing

Signed-off-by: jay-dee7 <[email protected]>

* Fixed Node engine version

* refactor: Move `syncLogtoUserRoles` outside of AccountController class

Signed-off-by: jay-dee7 <[email protected]>

* revert: NodeJS engine version tagging

Signed-off-by: jay-dee7 <[email protected]>

---------

Signed-off-by: jay-dee7 <[email protected]>
Co-authored-by: Ankur Banerjee <[email protected]>
  • Loading branch information
jay-dee7 and ankurdotb authored Aug 2, 2024
1 parent 5dd7431 commit 0b93908
Show file tree
Hide file tree
Showing 16 changed files with 403 additions and 177 deletions.
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ ARG COOKIE_SECRET
ARG LOGTO_M2M_APP_ID
ARG LOGTO_M2M_APP_SECRET
ARG LOGTO_MANAGEMENT_API
ARG LOGTO_TESTNET_ROLE_ID
ARG LOGTO_DEFAULT_ROLE_ID
ARG LOGTO_MAINNET_ROLE_ID
ARG LOGTO_WEBHOOK_SECRET
ARG LOG_LEVEL=info

Expand Down Expand Up @@ -115,7 +117,9 @@ ENV COOKIE_SECRET ${COOKIE_SECRET}
ENV LOGTO_M2M_APP_ID ${LOGTO_M2M_APP_ID}
ENV LOGTO_M2M_APP_SECRET ${LOGTO_M2M_APP_SECRET}
ENV LOGTO_MANAGEMENT_API ${LOGTO_MANAGEMENT_API}
ENV LOGTO_TESTNET_ROLE_ID ${LOGTO_TESTNET_ROLE_ID}
ENV LOGTO_DEFAULT_ROLE_ID ${LOGTO_DEFAULT_ROLE_ID}
ENV LOGTO_MAINNET_ROLE_ID ${LOGTO_MAINNET_ROLE_ID}
ENV LOGTO_WEBHOOK_SECRET ${LOGTO_WEBHOOK_SECRET}
ENV LOG_LEVEL ${LOG_LEVEL}

Expand Down
4 changes: 3 additions & 1 deletion example.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ LOGTO_M2M_APP_ID="aaaa...ddddd"
LOGTO_M2M_APP_SECRET="aaaa...ddddd"
LOGTO_MANAGEMENT_API="https://default.logto.app/api"
LOGTO_DEFAULT_RESOURCE_URL="http://localhost:3000"
LOGTO_DEFAULT_ROLE_ID="sdf...sdf"
LOGTO_WEBHOOK_SECRET="sdf...sdf"
LOGTO_DEFAULT_ROLE_ID="sdlkfj"
LOGTO_TESTNET_ROLE_ID="asdf"
LOGTO_MAINNET_ROLE_ID="sdklfj"
COOKIE_SECRET="sdf...sdf"

# Faucet settings
Expand Down
1 change: 1 addition & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ module.exports = {
collectCoverageFrom: ['src/**/*.{ts,js}'],
moduleDirectories: ['node_modules', 'src'],
testEnvironment: 'node',
testTimeout: 10 * 1000, // 10s
};
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0b93908

Please sign in to comment.