Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/store-codegen-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,27 @@ jobs:
if: failure() && steps.drift.outcome == 'failure'
run: git diff --name-only -- packages/store/scripts/api-schema/schema.json packages/store/src/gateway/AUTO_GENERATED/ > "${RUNNER_TEMP}/drift-files.txt"

- name: Open or update drift issue
- name: Report drift
if: failure() && steps.drift.outcome == 'failure'
run: |
{
echo "## Store codegen drift detected"
echo
echo 'The generated Store API client is out of sync with the staging CGW schema.'
echo
echo '**Fix:**'
echo '```bash'
echo 'yarn workspace @safe-global/store build:dev'
echo '```'
echo
echo '**Changed files:**'
echo '```text'
cat "${RUNNER_TEMP}/drift-files.txt"
echo '```'
} >> "${GITHUB_STEP_SUMMARY}"

- name: Open or update drift issue
if: failure() && steps.drift.outcome == 'failure' && vars.ENABLE_DRIFT_ISSUES == 'true'
continue-on-error: true
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
Expand Down
63 changes: 63 additions & 0 deletions packages/store/scripts/api-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@
"schema": {
"type": "string"
}
},
{
"name": "enroll",
"required": false,
"in": "query",
"description": "When true, requests hosted enrollment of a new authenticator: the provider challenges an existing factor, then walks the user through enrolling the new one.",
"schema": {
"type": "boolean"
}
}
],
"responses": {
Expand Down Expand Up @@ -244,6 +253,35 @@
]
}
},
"/v1/auth/oidc/mfa/authenticators": {
"get": {
"description": "Lists the MFA authentication methods of the authenticated user for the self-service authenticator management UI.",
"operationId": "oidcAuthListAuthenticatorsV1",
"parameters": [],
"responses": {
"200": {
"description": "MFA authentication methods",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Authenticator"
}
}
}
}
},
"403": {
"description": "Not authenticated"
}
},
"summary": "List MFA authenticators",
"tags": [
"auth"
]
}
},
"/v1/chains/{chainId}/safes/{safeAddress}/balances/{fiatCode}": {
"get": {
"description": "Retrieves token balances for a Safe on a specific chain, converted to the specified fiat currency. Includes native tokens, ERC-20 tokens, and their current market values.",
Expand Down Expand Up @@ -6371,6 +6409,31 @@
}
}
},
"Authenticator": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Auth0 authentication method identifier (e.g. totp|...)"
},
"type": {
"type": "string",
"description": "Authentication method type (e.g. totp)"
},
"name": {
"type": "string",
"description": "User-visible authenticator name"
},
"createdAt": {
"type": "string",
"description": "ISO 8601 timestamp of when the method was enrolled"
}
},
"required": [
"id",
"type"
]
},
"NativeToken": {
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion packages/store/src/gateway/AUTO_GENERATED/.schema-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d87ba47e4b0d1a80ef8a9c38bac6e6f9fff04131ec3587d79d8a08ce7ddd1810
fd472742cf02d28f896f3e389d0fab8a78ebca07f9aeb6b22afc479be27519fe
24 changes: 24 additions & 0 deletions packages/store/src/gateway/AUTO_GENERATED/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const injectedRtkApi = api
params: {
redirect_url: queryArg.redirectUrl,
connection: queryArg.connection,
enroll: queryArg.enroll,
},
}),
providesTags: ['auth'],
Expand All @@ -48,6 +49,13 @@ const injectedRtkApi = api
}),
providesTags: ['auth'],
}),
oidcAuthListAuthenticatorsV1: build.query<
OidcAuthListAuthenticatorsV1ApiResponse,
OidcAuthListAuthenticatorsV1ApiArg
>({
query: () => ({ url: `/v1/auth/oidc/mfa/authenticators` }),
providesTags: ['auth'],
}),
}),
overrideExisting: false,
})
Expand All @@ -73,6 +81,8 @@ export type OidcAuthAuthorizeV1ApiArg = {
redirectUrl?: string
/** OIDC connection name to route to a specific identity provider. */
connection?: string
/** When true, requests hosted enrollment of a new authenticator: the provider challenges an existing factor, then walks the user through enrolling the new one. */
enroll?: boolean
}
export type OidcAuthCallbackV1ApiResponse = unknown
export type OidcAuthCallbackV1ApiArg = {
Expand All @@ -85,6 +95,8 @@ export type OidcAuthCallbackV1ApiArg = {
/** Description of the error returned by the OIDC provider (if failed) */
errorDescription?: string
}
export type OidcAuthListAuthenticatorsV1ApiResponse = /** status 200 MFA authentication methods */ Authenticator[]
export type OidcAuthListAuthenticatorsV1ApiArg = void
export type UserSession = {
id: string
authMethod: 'siwe' | 'oidc'
Expand All @@ -104,6 +116,16 @@ export type LogoutDto = {
/** Post-logout redirect URL (must be same-origin as pre-configured URL) */
redirect_url?: string
}
export type Authenticator = {
/** Auth0 authentication method identifier (e.g. totp|...) */
id: string
/** Authentication method type (e.g. totp) */
type: string
/** User-visible authenticator name */
name?: string
/** ISO 8601 timestamp of when the method was enrolled */
createdAt?: string
}
export const {
useAuthGetMeV1Query,
useLazyAuthGetMeV1Query,
Expand All @@ -116,4 +138,6 @@ export const {
useLazyOidcAuthAuthorizeV1Query,
useOidcAuthCallbackV1Query,
useLazyOidcAuthCallbackV1Query,
useOidcAuthListAuthenticatorsV1Query,
useLazyOidcAuthListAuthenticatorsV1Query,
} = injectedRtkApi