Skip to content

Add support for OAuth login #1122

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

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[OpenAPI] Spec updates (#1129)
Co-authored-by: eminano <[email protected]>
  • Loading branch information
2 people authored and SferaDev committed Aug 22, 2023
commit 4608acf5db3b9f251c97e7e81bcee9b8f20e6ff7
43 changes: 42 additions & 1 deletion packages/client/src/api/controlPlaneComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,40 @@ export const getUserOAuthClients = (variables: GetUserOAuthClientsVariables, sig
signal
});

export type DeleteUserOAuthClientPathParams = {
clientId: Schemas.OAuthClientID;
};

export type DeleteUserOAuthClientError = Fetcher.ErrorWrapper<
| {
status: 400;
payload: Responses.BadRequestError;
}
| {
status: 401;
payload: Responses.AuthError;
}
| {
status: 404;
payload: Responses.SimpleError;
}
>;

export type DeleteUserOAuthClientVariables = {
pathParams: DeleteUserOAuthClientPathParams;
} & ControlPlaneFetcherExtraProps;

/**
* Delete the oauth client for the user and revoke all access
*/
export const deleteUserOAuthClient = (variables: DeleteUserOAuthClientVariables, signal?: AbortSignal) =>
controlPlaneFetch<undefined, DeleteUserOAuthClientError, undefined, {}, {}, DeleteUserOAuthClientPathParams>({
url: '/user/oauth/clients/{clientId}',
method: 'delete',
...variables,
signal
});

export type GetUserOAuthAccessTokensError = Fetcher.ErrorWrapper<
| {
status: 400;
Expand Down Expand Up @@ -1494,7 +1528,14 @@ export const listRegions = (variables: ListRegionsVariables, signal?: AbortSigna
export const operationsByTag = {
authOther: { getAuthorizationCode, grantAuthorizationCode, deleteOAuthAccessToken, updateOAuthAccessToken },
users: { getUser, updateUser, deleteUser },
authentication: { getUserAPIKeys, createUserAPIKey, deleteUserAPIKey, getUserOAuthClients, getUserOAuthAccessTokens },
authentication: {
getUserAPIKeys,
createUserAPIKey,
deleteUserAPIKey,
getUserOAuthClients,
deleteUserOAuthClient,
getUserOAuthAccessTokens
},
workspaces: {
getWorkspacesList,
createWorkspace,
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/api/controlPlaneParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export type InviteKeyParam = Schemas.InviteKey;

export type OAuthAccessTokenParam = Schemas.AccessToken;

export type OAuthClientIDParam = Schemas.OAuthClientID;

export type UserIDParam = Schemas.UserID;

export type WorkspaceIDParam = Schemas.WorkspaceID;
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/api/controlPlaneSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export type OAuthClientPublicDetails = {
clientId: string;
};

export type OAuthClientID = string;

export type OAuthAccessToken = {
token: string;
scopes: string[];
Expand Down