Skip to content

Commit

Permalink
Initial commit for the OpenAPI Spec 3.0 based JSDoc modification
Browse files Browse the repository at this point in the history
  • Loading branch information
parth inamdar committed Jan 31, 2025
1 parent 7576341 commit d34e87b
Show file tree
Hide file tree
Showing 11 changed files with 4,670 additions and 3,429 deletions.
1,427 changes: 942 additions & 485 deletions npm/src/controller/api.ts

Large diffs are not rendered by default.

175 changes: 88 additions & 87 deletions npm/src/controller/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1103,63 +1103,64 @@ export class OAuthController implements IOAuthController {
}

/**
* @swagger
* @openapi
*
* /oauth/token:
* post:
* summary: Code exchange
* operationId: oauth-code-exchange
* tags:
* - OAuth
* consumes:
* - application/x-www-form-urlencoded
* parameters:
* - name: grant_type
* in: formData
* type: string
* description: Grant type should be 'authorization_code'
* default: authorization_code
* required: true
* - name: client_id
* in: formData
* type: string
* description: Use the client_id returned by the SAML connection API
* required: true
* - name: client_secret
* in: formData
* type: string
* description: Use the client_secret returned by the SAML connection API
* required: true
* - name: code_verifier
* in: formData
* type: string
* description: code_verifier against the code_challenge in the authz request (relevant to PKCE flow)
* - name: redirect_uri
* in: formData
* type: string
* description: Redirect URI
* required: true
* - name: code
* in: formData
* type: string
* description: Code
* required: true
* summary: Code exchange
* operationId: oauth-code-exchange
* requestBody:
* content:
* application/x-www-form-urlencoded:
* schema:
* required:
* - client_id
* - client_secret
* - code
* - grant_type
* - redirect_uri
* type: object
* properties:
* grant_type:
* type: string
* description: Grant type should be 'authorization_code'
* default: authorization_code
* client_id:
* type: string
* description: Use the client_id returned by the SAML connection API
* client_secret:
* type: string
* description: Use the client_secret returned by the SAML connection API
* code_verifier:
* type: string
* description: code_verifier against the code_challenge in the authz request (relevant to PKCE flow)
* redirect_uri:
* type: string
* description: Redirect URI
* code:
* type: string
* description: Code
* required: true
* responses:
* '200':
* "200":
* description: Success
* schema:
* type: object
* properties:
* access_token:
* type: string
* token_type:
* type: string
* expires_in:
* type: string
* example:
* access_token: 8958e13053832b5af58fdf2ee83f35f5d013dc74
* token_type: bearer
* expires_in: 300
* content:
* "{*}":
* schema:
* type: object
* properties:
* access_token:
* type: string
* token_type:
* type: string
* expires_in:
* type: string
* example:
* access_token: 8958e13053832b5af58fdf2ee83f35f5d013dc74
* token_type: bearer
* expires_in: "300"
*/
public async token(body: OAuthTokenReq, authHeader?: string | null): Promise<OAuthTokenRes> {
let basic_client_id: string | undefined;
Expand Down Expand Up @@ -1341,51 +1342,51 @@ export class OAuthController implements IOAuthController {
}

/**
* @swagger
* @openapi
*
* /oauth/userinfo:
* get:
* summary: Get profile
* operationId: oauth-get-profile
* tags:
* - OAuth
* summary: Get profile
* operationId: oauth-get-profile
* responses:
* '200':
* "200":
* description: Success
* schema:
* type: object
* properties:
* id:
* type: string
* email:
* type: string
* firstName:
* type: string
* lastName:
* type: string
* roles:
* type: array
* items:
* type: string
* groups:
* type: array
* items:
* type: string
* raw:
* type: object
* requested:
* content:
* "{*}":
* schema:
* type: object
* example:
* id: 32b5af58fdf
* email: [email protected]
* firstName: SAML
* lastName: Jackson
* raw: {
*
* }
* requested: {
*
* }
* properties:
* id:
* type: string
* email:
* type: string
* firstName:
* type: string
* lastName:
* type: string
* roles:
* type: array
* items:
* type: string
* groups:
* type: array
* items:
* type: string
* raw:
* type: object
* properties: {}
* requested:
* type: object
* properties: {}
* example:
* id: 32b5af58fdf
* email: [email protected]
* firstName: SAML
* lastName: Jackson
* raw: {}
* requested: {}
*/
public async userInfo(token: string): Promise<Profile> {
const tokens = token.split('.');
Expand Down
Loading

0 comments on commit d34e87b

Please sign in to comment.