mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 22:09:08 +08:00
feat(server): support refresh token (#15218)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
query authSigningKeys {
|
||||
authSigningKeys {
|
||||
id
|
||||
status
|
||||
source
|
||||
createdAt
|
||||
retiredAt
|
||||
verifyUntil
|
||||
canDelete
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
mutation deleteAuthSigningKey($id: String!) {
|
||||
deleteAuthSigningKey(id: $id) {
|
||||
id
|
||||
status
|
||||
source
|
||||
createdAt
|
||||
retiredAt
|
||||
verifyUntil
|
||||
canDelete
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
mutation rotateAuthSigningKey($expectedActiveKeyId: String!) {
|
||||
rotateAuthSigningKey(expectedActiveKeyId: $expectedActiveKeyId) {
|
||||
id
|
||||
status
|
||||
source
|
||||
createdAt
|
||||
retiredAt
|
||||
verifyUntil
|
||||
canDelete
|
||||
}
|
||||
}
|
||||
@@ -396,6 +396,22 @@ export const adminWorkspacesCountQuery = {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const authSigningKeysQuery = {
|
||||
id: 'authSigningKeysQuery' as const,
|
||||
op: 'authSigningKeys',
|
||||
query: `query authSigningKeys {
|
||||
authSigningKeys {
|
||||
id
|
||||
status
|
||||
source
|
||||
createdAt
|
||||
retiredAt
|
||||
verifyUntil
|
||||
canDelete
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const createChangePasswordUrlMutation = {
|
||||
id: 'createChangePasswordUrlMutation' as const,
|
||||
op: 'createChangePasswordUrl',
|
||||
@@ -422,6 +438,22 @@ export const createUserMutation = {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const deleteAuthSigningKeyMutation = {
|
||||
id: 'deleteAuthSigningKeyMutation' as const,
|
||||
op: 'deleteAuthSigningKey',
|
||||
query: `mutation deleteAuthSigningKey($id: String!) {
|
||||
deleteAuthSigningKey(id: $id) {
|
||||
id
|
||||
status
|
||||
source
|
||||
createdAt
|
||||
retiredAt
|
||||
verifyUntil
|
||||
canDelete
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const deleteUserMutation = {
|
||||
id: 'deleteUserMutation' as const,
|
||||
op: 'deleteUser',
|
||||
@@ -508,6 +540,22 @@ export const listUsersQuery = {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const rotateAuthSigningKeyMutation = {
|
||||
id: 'rotateAuthSigningKeyMutation' as const,
|
||||
op: 'rotateAuthSigningKey',
|
||||
query: `mutation rotateAuthSigningKey($expectedActiveKeyId: String!) {
|
||||
rotateAuthSigningKey(expectedActiveKeyId: $expectedActiveKeyId) {
|
||||
id
|
||||
status
|
||||
source
|
||||
createdAt
|
||||
retiredAt
|
||||
verifyUntil
|
||||
canDelete
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const sendTestEmailMutation = {
|
||||
id: 'sendTestEmailMutation' as const,
|
||||
op: 'sendTestEmail',
|
||||
@@ -1950,7 +1998,7 @@ export const getCurrentUserQuery = {
|
||||
}
|
||||
}
|
||||
}`,
|
||||
deprecations: ["'token' is deprecated: use native session exchange instead"],
|
||||
deprecations: ["'token' is deprecated: use auth session exchange instead"],
|
||||
};
|
||||
|
||||
export const getDocCreatedByUpdatedByListQuery = {
|
||||
|
||||
@@ -365,6 +365,17 @@ export interface AudioSliceManifestItemType {
|
||||
startSec: Scalars['Float']['output'];
|
||||
}
|
||||
|
||||
export interface AuthSigningKeyType {
|
||||
__typename?: 'AuthSigningKeyType';
|
||||
canDelete: Scalars['Boolean']['output'];
|
||||
createdAt: Maybe<Scalars['DateTime']['output']>;
|
||||
id: Scalars['String']['output'];
|
||||
retiredAt: Maybe<Scalars['DateTime']['output']>;
|
||||
source: Scalars['String']['output'];
|
||||
status: Scalars['String']['output'];
|
||||
verifyUntil: Maybe<Scalars['DateTime']['output']>;
|
||||
}
|
||||
|
||||
export interface BlobNotFoundDataType {
|
||||
__typename?: 'BlobNotFoundDataType';
|
||||
blobId: Scalars['String']['output'];
|
||||
@@ -1222,10 +1233,15 @@ export type ErrorDataUnion =
|
||||
|
||||
export enum ErrorNames {
|
||||
ACCESS_DENIED = 'ACCESS_DENIED',
|
||||
ACCESS_TOKEN_EXPIRED = 'ACCESS_TOKEN_EXPIRED',
|
||||
ACCESS_TOKEN_INVALID = 'ACCESS_TOKEN_INVALID',
|
||||
ACTION_FORBIDDEN = 'ACTION_FORBIDDEN',
|
||||
ACTION_FORBIDDEN_ON_NON_TEAM_WORKSPACE = 'ACTION_FORBIDDEN_ON_NON_TEAM_WORKSPACE',
|
||||
ALREADY_IN_SPACE = 'ALREADY_IN_SPACE',
|
||||
AUTHENTICATION_REQUIRED = 'AUTHENTICATION_REQUIRED',
|
||||
AUTH_SESSION_EXPIRED = 'AUTH_SESSION_EXPIRED',
|
||||
AUTH_SESSION_REVOKED = 'AUTH_SESSION_REVOKED',
|
||||
AUTH_SESSION_TEMPORARILY_UNAVAILABLE = 'AUTH_SESSION_TEMPORARILY_UNAVAILABLE',
|
||||
BAD_REQUEST = 'BAD_REQUEST',
|
||||
BLOB_INVALID = 'BLOB_INVALID',
|
||||
BLOB_NOT_FOUND = 'BLOB_NOT_FOUND',
|
||||
@@ -1332,6 +1348,8 @@ export enum ErrorNames {
|
||||
OWNER_CAN_NOT_LEAVE_WORKSPACE = 'OWNER_CAN_NOT_LEAVE_WORKSPACE',
|
||||
PASSWORD_REQUIRED = 'PASSWORD_REQUIRED',
|
||||
QUERY_TOO_LONG = 'QUERY_TOO_LONG',
|
||||
REFRESH_TOKEN_INVALID = 'REFRESH_TOKEN_INVALID',
|
||||
REFRESH_TOKEN_REUSED = 'REFRESH_TOKEN_REUSED',
|
||||
REPLY_NOT_FOUND = 'REPLY_NOT_FOUND',
|
||||
RESPONSE_TOO_LARGE_ERROR = 'RESPONSE_TOO_LARGE_ERROR',
|
||||
RUNTIME_CONFIG_NOT_FOUND = 'RUNTIME_CONFIG_NOT_FOUND',
|
||||
@@ -1861,6 +1879,7 @@ export interface Mutation {
|
||||
createWorkspaceByokLocalLease: CreateWorkspaceByokLocalLeaseResultType;
|
||||
deactivateLicense: Scalars['Boolean']['output'];
|
||||
deleteAccount: DeleteAccount;
|
||||
deleteAuthSigningKey: Array<AuthSigningKeyType>;
|
||||
deleteBlob: Scalars['Boolean']['output'];
|
||||
/** Delete a comment */
|
||||
deleteComment: Scalars['Boolean']['output'];
|
||||
@@ -1925,6 +1944,7 @@ export interface Mutation {
|
||||
revokeMember: Scalars['Boolean']['output'];
|
||||
revokePublicDoc: DocType;
|
||||
revokeUserAccessToken: Scalars['Boolean']['output'];
|
||||
rotateAuthSigningKey: Array<AuthSigningKeyType>;
|
||||
sendChangeEmail: Scalars['Boolean']['output'];
|
||||
sendChangePasswordEmail: Scalars['Boolean']['output'];
|
||||
sendSetPasswordEmail: Scalars['Boolean']['output'];
|
||||
@@ -2119,6 +2139,10 @@ export interface MutationDeactivateLicenseArgs {
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationDeleteAuthSigningKeyArgs {
|
||||
id: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationDeleteBlobArgs {
|
||||
hash?: InputMaybe<Scalars['String']['input']>;
|
||||
key?: InputMaybe<Scalars['String']['input']>;
|
||||
@@ -2312,6 +2336,10 @@ export interface MutationRevokeUserAccessTokenArgs {
|
||||
id: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationRotateAuthSigningKeyArgs {
|
||||
expectedActiveKeyId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationSendChangeEmailArgs {
|
||||
callbackUrl: Scalars['String']['input'];
|
||||
}
|
||||
@@ -2672,6 +2700,7 @@ export interface Query {
|
||||
adminWorkspacesCount: Scalars['Int']['output'];
|
||||
/** get the whole app configuration */
|
||||
appConfig: Scalars['JSONObject']['output'];
|
||||
authSigningKeys: Array<AuthSigningKeyType>;
|
||||
/** Get current user */
|
||||
currentUser: Maybe<UserType>;
|
||||
error: ErrorDataUnion;
|
||||
@@ -3455,7 +3484,7 @@ export interface UserType {
|
||||
/** Get user settings */
|
||||
settings: UserSettingsType;
|
||||
subscriptions: Array<SubscriptionType>;
|
||||
/** @deprecated use native session exchange instead */
|
||||
/** @deprecated use auth session exchange instead */
|
||||
token: TokenType;
|
||||
}
|
||||
|
||||
@@ -4191,6 +4220,22 @@ export type AdminWorkspacesCountQuery = {
|
||||
adminWorkspacesCount: number;
|
||||
};
|
||||
|
||||
export type AuthSigningKeysQueryVariables = Exact<{ [key: string]: never }>;
|
||||
|
||||
export type AuthSigningKeysQuery = {
|
||||
__typename?: 'Query';
|
||||
authSigningKeys: Array<{
|
||||
__typename?: 'AuthSigningKeyType';
|
||||
id: string;
|
||||
status: string;
|
||||
source: string;
|
||||
createdAt: string | null;
|
||||
retiredAt: string | null;
|
||||
verifyUntil: string | null;
|
||||
canDelete: boolean;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type CreateChangePasswordUrlMutationVariables = Exact<{
|
||||
callbackUrl: Scalars['String']['input'];
|
||||
userId: Scalars['String']['input'];
|
||||
@@ -4214,6 +4259,24 @@ export type CreateUserMutation = {
|
||||
createUser: { __typename?: 'UserType'; id: string };
|
||||
};
|
||||
|
||||
export type DeleteAuthSigningKeyMutationVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type DeleteAuthSigningKeyMutation = {
|
||||
__typename?: 'Mutation';
|
||||
deleteAuthSigningKey: Array<{
|
||||
__typename?: 'AuthSigningKeyType';
|
||||
id: string;
|
||||
status: string;
|
||||
source: string;
|
||||
createdAt: string | null;
|
||||
retiredAt: string | null;
|
||||
verifyUntil: string | null;
|
||||
canDelete: boolean;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type DeleteUserMutationVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
}>;
|
||||
@@ -4292,6 +4355,24 @@ export type ListUsersQuery = {
|
||||
}>;
|
||||
};
|
||||
|
||||
export type RotateAuthSigningKeyMutationVariables = Exact<{
|
||||
expectedActiveKeyId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type RotateAuthSigningKeyMutation = {
|
||||
__typename?: 'Mutation';
|
||||
rotateAuthSigningKey: Array<{
|
||||
__typename?: 'AuthSigningKeyType';
|
||||
id: string;
|
||||
status: string;
|
||||
source: string;
|
||||
createdAt: string | null;
|
||||
retiredAt: string | null;
|
||||
verifyUntil: string | null;
|
||||
canDelete: boolean;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type SendTestEmailMutationVariables = Exact<{
|
||||
name: Scalars['String']['input'];
|
||||
host: Scalars['String']['input'];
|
||||
@@ -7866,6 +7947,11 @@ export type Queries =
|
||||
variables: AdminWorkspacesCountQueryVariables;
|
||||
response: AdminWorkspacesCountQuery;
|
||||
}
|
||||
| {
|
||||
name: 'authSigningKeysQuery';
|
||||
variables: AuthSigningKeysQueryVariables;
|
||||
response: AuthSigningKeysQuery;
|
||||
}
|
||||
| {
|
||||
name: 'appConfigQuery';
|
||||
variables: AppConfigQueryVariables;
|
||||
@@ -8243,6 +8329,11 @@ export type Mutations =
|
||||
variables: CreateUserMutationVariables;
|
||||
response: CreateUserMutation;
|
||||
}
|
||||
| {
|
||||
name: 'deleteAuthSigningKeyMutation';
|
||||
variables: DeleteAuthSigningKeyMutationVariables;
|
||||
response: DeleteAuthSigningKeyMutation;
|
||||
}
|
||||
| {
|
||||
name: 'deleteUserMutation';
|
||||
variables: DeleteUserMutationVariables;
|
||||
@@ -8263,6 +8354,11 @@ export type Mutations =
|
||||
variables: ImportUsersMutationVariables;
|
||||
response: ImportUsersMutation;
|
||||
}
|
||||
| {
|
||||
name: 'rotateAuthSigningKeyMutation';
|
||||
variables: RotateAuthSigningKeyMutationVariables;
|
||||
response: RotateAuthSigningKeyMutation;
|
||||
}
|
||||
| {
|
||||
name: 'sendTestEmailMutation';
|
||||
variables: SendTestEmailMutationVariables;
|
||||
|
||||
Reference in New Issue
Block a user