feat: integrate oidc digest#76
Conversation
add nx to salt
integrate digest
add AUTH_SERVER_URL
| const response = await fetch("http://127.0.0.1:3003/salt", { | ||
| method: "GET", | ||
| headers: { | ||
| Authorization: `Bearer ${props.jwt.raw}`, | ||
| }, | ||
| }) | ||
| .then((res) => res.json()) | ||
| .catch((e) => { | ||
| console.error(e); | ||
| }); | ||
|
|
||
| const salt = response.salt; | ||
| const oidcDigest = new OidcDigest(props.jwt.iss, props.jwt.aud, props.jwt.sub, ByteVector.fromHex(salt)).serialize(); |
There was a problem hiding this comment.
Should we keep it here or move it to /utils/salt.ts / /utils/oidcDigest.ts?
|
|
||
| const app = express(); | ||
|
|
||
| app.use(cors({ origin: env.AUTH_SERVER_URL })); |
There was a problem hiding this comment.
Do we need any more origins or a default?
There was a problem hiding this comment.
No, let's be restrictive by default.
|
Visit the preview URL for this PR (updated for commit 5176d8d): https://zksync-auth-server-staging--pr76-oidc-digest-6wakmmoc.web.app (expires Fri, 28 Feb 2025 15:10:07 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 509a9c9ea42583076f531c53cf2979c544d5d0b7 |
| const { addOidcAccount, addOidcAccountIsLoading } = useRecoveryOidc(); | ||
|
|
||
| if (props.jwt !== null) { | ||
| const response = await fetch("http://127.0.0.1:3003/salt", { |
There was a problem hiding this comment.
Should we keep a constant or use env?
There was a problem hiding this comment.
My vote is to use the runtimeconfig inside nuxt.config.ts.
It can be then accessed using useRuntimeConfig.
|
|
||
| const app = express(); | ||
|
|
||
| app.use(cors({ origin: env.AUTH_SERVER_URL })); |
There was a problem hiding this comment.
No, let's be restrictive by default.
| const { addOidcAccount, addOidcAccountIsLoading } = useRecoveryOidc(); | ||
|
|
||
| if (props.jwt !== null) { | ||
| const response = await fetch("http://127.0.0.1:3003/salt", { |
There was a problem hiding this comment.
My vote is to use the runtimeconfig inside nuxt.config.ts.
It can be then accessed using useRuntimeConfig.
move url to runtimeconfig
* feat: add nx to salt add nx to salt * feat: integrate digest integrate digest * feat: add AUTH_SERVER_URL add AUTH_SERVER_URL * refactor: move url to runtimeconfig move url to runtimeconfig
* feat: add nx to salt add nx to salt * feat: integrate digest integrate digest * feat: add AUTH_SERVER_URL add AUTH_SERVER_URL * refactor: move url to runtimeconfig move url to runtimeconfig
* feat: add nx to salt add nx to salt * feat: integrate digest integrate digest * feat: add AUTH_SERVER_URL add AUTH_SERVER_URL * refactor: move url to runtimeconfig move url to runtimeconfig
Description
Add nx to salt service
Generate oidc digest and save it