Skip to content

Commit 7f93bca

Browse files
authored
feat(jans-auth-server): swagger docs for ssa (#2953)
1 parent bc1a8ca commit 7f93bca

File tree

1 file changed

+242
-1
lines changed

1 file changed

+242
-1
lines changed

jans-auth-server/docs/swagger.yaml

+242-1
Original file line numberDiff line numberDiff line change
@@ -4275,6 +4275,217 @@ paths:
42754275
type: string
42764276
details:
42774277
type: string
4278+
4279+
/ssa:
4280+
post:
4281+
tags:
4282+
- SSA
4283+
summary: Create SSA.
4284+
description: Create `SSA` for the organization with `expiration` (optional).
4285+
operationId: post-register
4286+
security:
4287+
- bearer: [ ]
4288+
requestBody:
4289+
content:
4290+
application/json:
4291+
schema:
4292+
required:
4293+
- org_id
4294+
type: object
4295+
properties:
4296+
org_id:
4297+
type: number
4298+
description: The `org_id` is used for organization identification.
4299+
example: 1
4300+
description:
4301+
type: string
4302+
description: Description SSA.
4303+
example: Your description of SSA
4304+
expiration:
4305+
type: number
4306+
description: Expiration date. If this field is not sent, it will take days to expire, according to how it has been configured.
4307+
example: 1660832042
4308+
software_id:
4309+
type: string
4310+
description: The `software_id` is used for software identification.
4311+
example:
4312+
gluu-scan-api
4313+
software_roles:
4314+
type: array
4315+
description: List of string values, fixed value ["password", "notify"].
4316+
items:
4317+
type: string
4318+
example:
4319+
- password
4320+
grant_types:
4321+
type: array
4322+
description: Fixed value ["client_credentials"].
4323+
items:
4324+
type: string
4325+
example:
4326+
- client_credentials
4327+
one_time_use:
4328+
type: boolean
4329+
description: Defined whether the SSA will be used only once or can be used multiple times.
4330+
default: true
4331+
rotate_ssa:
4332+
type: boolean
4333+
description: TODO - Will be used to rotate expiration of the SSA, currently is only saved as part of the SSA.
4334+
default: true
4335+
responses:
4336+
201:
4337+
description: 'Created'
4338+
content:
4339+
application/json:
4340+
schema:
4341+
type: object
4342+
properties:
4343+
ssa:
4344+
type: string
4345+
example: eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3BvcnRhbC5nbHV1Lm9yZyIsImlhdCI6IjE2NTUzMTkyNjgiLCJqdGkiOiJmN2I1OTkxYy00YzE4LTRjODEtYTY2NC1lNmY4NjcwZjVkNTEiLCJzb2Z0d2FyZV9pZCI6ImdsdXUtc2Nhbi1hcGkiLCJvcmdfaWQiOjEsInNvZnR3YXJlX3JvbGVzIjpbInBhc3N3dXJkIl0sImp3a3NfdXJpIjoiaHR0cHM6Ly9jbG91ZC1kZXYuZ2x1dS5jbG91ZC9wb3J0YWwvandrcyIsImdyYW50X3R5cGVzIjpbImNsaWVudF9jcmVkZW50aWFscyJdLCJleHAiOjE2NTkzMTkyNjh9.MkE-47SvBshmazBfyhAcHsqPpFIbg5CpA8k2TxDWhxc
4346+
401:
4347+
$ref: '#/components/responses/UnauthorizedSSA'
4348+
500:
4349+
$ref: '#/components/responses/InternalServerErrorSSA'
4350+
4351+
get:
4352+
tags:
4353+
- SSA
4354+
summary: Get list of SSAs
4355+
description: Get all `SSA` list with filters.
4356+
operationId: get-ssa
4357+
security:
4358+
- bearer: [ ]
4359+
parameters:
4360+
- schema:
4361+
type: string
4362+
in: query
4363+
name: jti
4364+
description: JTI
4365+
- schema:
4366+
type: integer
4367+
in: query
4368+
name: org_id
4369+
description: Organization ID
4370+
responses:
4371+
200:
4372+
description: The response will return the list of SSAs.
4373+
content:
4374+
application/json:
4375+
schema:
4376+
type: array
4377+
items:
4378+
type: object
4379+
properties:
4380+
created_at:
4381+
type: integer
4382+
expiration:
4383+
type: integer
4384+
issuer:
4385+
type: string
4386+
jti:
4387+
type: string
4388+
ssa:
4389+
type: object
4390+
properties:
4391+
iss:
4392+
type: string
4393+
iat:
4394+
type: integer
4395+
jti:
4396+
type: string
4397+
software_id:
4398+
type: string
4399+
org_id:
4400+
type: integer
4401+
software_roles:
4402+
type: array
4403+
items:
4404+
type: string
4405+
grant_types:
4406+
type: array
4407+
items:
4408+
type: string
4409+
exp:
4410+
type: integer
4411+
examples:
4412+
example-1:
4413+
value:
4414+
- created_at: 1655319268
4415+
expiration: 1656319268
4416+
issuer: 04d7af18-f69c-4cf9-8b17-9872315a8f17
4417+
jti: 1527324c-b5a3-4d7d-8953-8c1874600ec1
4418+
ssa:
4419+
iss: 'https://jans.io'
4420+
iat: 1655319268
4421+
jti: f7b5991c-4c18-4c81-a664-e6f8670f5d51
4422+
software_id: gluu-scan-api
4423+
org_id: 1
4424+
software_roles:
4425+
- password
4426+
grant_types:
4427+
- client_credentials
4428+
exp: 1655419268
4429+
401:
4430+
$ref: '#/components/responses/UnauthorizedSSA'
4431+
500:
4432+
$ref: '#/components/responses/InternalServerErrorSSA'
4433+
4434+
head:
4435+
tags:
4436+
- SSA
4437+
summary: Validate SSA
4438+
description: Validates that a given SSA JTI exists and is valid.
4439+
operationId: head-ssa
4440+
parameters:
4441+
- schema:
4442+
type: string
4443+
in: header
4444+
name: jti
4445+
description: JTI
4446+
required: true
4447+
responses:
4448+
200:
4449+
description: The API returns `200` status code, when token is valid.
4450+
422:
4451+
description: Not found.
4452+
500:
4453+
$ref: '#/components/responses/InternalServerErrorSSA'
4454+
4455+
delete:
4456+
tags:
4457+
- SSA
4458+
summary: Revoke SSA
4459+
description: |-
4460+
Revokes existing active SSA based on `jti` or `org_id`.
4461+
- `jti` - for delete only one SSA, the specified by `jti`
4462+
- `org_id` - for delete all SSA of the specified organization.
4463+
operationId: delete-ssa
4464+
security:
4465+
- bearer: [ ]
4466+
parameters:
4467+
- schema:
4468+
type: string
4469+
in: query
4470+
name: jti
4471+
description: A unique identifier for the token, which can be used to prevent reuse of the token.
4472+
- schema:
4473+
type: integer
4474+
in: query
4475+
name: org_id
4476+
description: Delete all SSAs of the specified organization.
4477+
responses:
4478+
200:
4479+
description: Success.
4480+
401:
4481+
$ref: '#/components/responses/UnauthorizedSSA'
4482+
406:
4483+
description: Not Acceptable. Check the query params. (When `jti` or `org_id` is not sent in the query param)
4484+
422:
4485+
description: Not found.
4486+
500:
4487+
$ref: '#/components/responses/InternalServerErrorSSA'
4488+
42784489
components:
42794490
responses:
42804491
Found: #302 - FOUND
@@ -4316,6 +4527,32 @@ components:
43164527
application/json:
43174528
schema:
43184529
$ref: '#/components/schemas/ErrorResponse'
4530+
UnauthorizedSSA: #401 - UNAUTHORIZED SSA
4531+
description: Unauthorized access request.
4532+
content:
4533+
application/json:
4534+
schema:
4535+
$ref: '#/components/schemas/ErrorResponse'
4536+
examples:
4537+
unauthorized_client:
4538+
value:
4539+
error: unauthorized_client
4540+
error_description: The Client is not authorized to use this authentication flow.
4541+
invalid_client:
4542+
value:
4543+
error: invalid_client
4544+
error_description: Client authentication failed (e.g. unknown client, no client authentication included, or unsupported authentication method).
4545+
InternalServerErrorSSA: #500 - INTERNAL_SERVER_ERROR SSA
4546+
description: Internal error occured. Please check log file for details.
4547+
content:
4548+
application/json:
4549+
schema:
4550+
$ref: '#/components/schemas/ErrorResponse'
4551+
examples:
4552+
unknown_error:
4553+
value:
4554+
error: unknown_error
4555+
error_description: Unknown or not found error.
43194556

43204557
schemas:
43214558
ErrorResponse:
@@ -4365,4 +4602,8 @@ components:
43654602
x:
43664603
type: string
43674604
y:
4368-
type: string
4605+
type: string
4606+
securitySchemes:
4607+
bearer:
4608+
type: http
4609+
scheme: bearer

0 commit comments

Comments
 (0)