Skip to content

Commit fefb160

Browse files
SarahSoutouljacekradko
authored andcommitted
feat(backend): Add TypeDoc comments to OAuth Application endpoints (#6378)
1 parent 7ae9e4d commit fefb160

File tree

5 files changed

+86
-0
lines changed

5 files changed

+86
-0
lines changed

.changeset/blue-comics-kneel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': minor
3+
---
4+
5+
Add missing properties to OAuthApplicationJSON

.changeset/small-moments-find.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
238238
"backend/infer-auth-object-from-token.mdx",
239239
"backend/invitation-status.mdx",
240240
"backend/invitation.mdx",
241+
"backend/o-auth-application.mdx",
241242
"backend/organization-invitation-status.mdx",
242243
"backend/organization-invitation.mdx",
243244
"backend/organization-membership-public-user-data.mdx",

packages/backend/src/api/resources/JSON.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ export interface OAuthApplicationJSON extends ClerkResourceJSON {
320320
instance_id: string;
321321
name: string;
322322
client_id: string;
323+
client_uri: string | null;
324+
client_image_url: string | null;
325+
dynamically_registered: boolean;
326+
consent_screen_enabled: boolean;
327+
pkce_required: boolean;
323328
public: boolean;
324329
scopes: string;
325330
redirect_uris: Array<string>;

packages/backend/src/api/resources/OAuthApplication.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,89 @@
11
import type { OAuthApplicationJSON } from './JSON';
22

3+
/**
4+
* The Backend `OAuthApplication` object holds information about an OAuth application.
5+
*/
36
export class OAuthApplication {
47
constructor(
8+
/**
9+
* The unique identifier for the OAuth application.
10+
*/
511
readonly id: string,
12+
/**
13+
* The ID of the instance that this OAuth application belongs to.
14+
*/
615
readonly instanceId: string,
16+
/**
17+
* The name of the new OAuth application.
18+
*/
719
readonly name: string,
20+
/**
21+
* The ID of the client associated with the OAuth application.
22+
*/
823
readonly clientId: string,
24+
/**
25+
* The public-facing URL of the OAuth application, often shown on consent screens.
26+
*/
27+
readonly clientUri: string | null,
28+
/**
29+
* The URL of the image or logo representing the OAuth application.
30+
*/
31+
readonly clientImageUrl: string | null,
32+
/**
33+
* Specifies whether the OAuth application is dynamically registered.
34+
*/
35+
readonly dynamicallyRegistered: boolean,
36+
/**
37+
* Specifies whether the consent screen should be displayed in the authentication flow. Cannot be disabled for dynamically registered OAuth applications.
38+
*/
39+
readonly consentScreenEnabled: boolean,
40+
/**
41+
* Specifies whether the Proof Key of Code Exchange (PKCE) flow should be required in the authentication flow.
42+
*/
43+
readonly pkceRequired: boolean,
44+
/**
45+
* Indicates whether the client is public. If true, the Proof Key of Code Exchange (PKCE) flow can be used.
46+
*/
947
readonly isPublic: boolean, // NOTE: `public` is reserved
48+
/**
49+
* Scopes for the new OAuth application.
50+
*/
1051
readonly scopes: string,
52+
/**
53+
* An array of redirect URIs of the new OAuth application.
54+
*/
1155
readonly redirectUris: Array<string>,
56+
/**
57+
* The URL used to authorize the user and obtain an authorization code.
58+
*/
1259
readonly authorizeUrl: string,
60+
/**
61+
* The URL used by the client to exchange an authorization code for an access token.
62+
*/
1363
readonly tokenFetchUrl: string,
64+
/**
65+
* The URL where the client can retrieve user information using an access token.
66+
*/
1467
readonly userInfoUrl: string,
68+
/**
69+
* The OpenID Connect discovery endpoint URL for this OAuth application.
70+
*/
1571
readonly discoveryUrl: string,
72+
/**
73+
* The URL used to introspect and validate issued access tokens.
74+
*/
1675
readonly tokenIntrospectionUrl: string,
76+
/**
77+
* The date when the OAuth application was first created.
78+
*/
1779
readonly createdAt: number,
80+
/**
81+
* The date when the OAuth application was last updated.
82+
*/
1883
readonly updatedAt: number,
84+
/**
85+
* The client secret associated with the OAuth application. Empty if public client.
86+
*/
1987
readonly clientSecret?: string,
2088
) {}
2189

@@ -25,6 +93,11 @@ export class OAuthApplication {
2593
data.instance_id,
2694
data.name,
2795
data.client_id,
96+
data.client_uri,
97+
data.client_image_url,
98+
data.dynamically_registered,
99+
data.consent_screen_enabled,
100+
data.pkce_required,
28101
data.public,
29102
data.scopes,
30103
data.redirect_uris,

0 commit comments

Comments
 (0)