Skip to content
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

feat: Add git token crud api #480

Merged
1 commit merged into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@
$ref: './resources/OrganizationAvailableRole.yaml'
/organization/{organizationId}/gitToken:
$ref: './resources/GitToken.yaml'
/organization/{organizationId}/gitToken/{gitTokenId}:
$ref: './resources/GitTokenRef.yaml'
/organization/{organizationId}/member:
$ref: './resources/OrganizationMember.yaml'
/organization/{organizationId}/inviteMember:
Expand Down Expand Up @@ -804,11 +806,11 @@
$ref: './resources/variable/VariableRef.yaml'
components:
parameters:
$ref: './parameters/_index.yaml'

Check warning on line 809 in src/openapi.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

oas3-unused-component

Potentially unused component has been detected.
schemas:
$ref: './schemas/_index.yaml'

Check warning on line 811 in src/openapi.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

oas3-unused-component

Potentially unused component has been detected.
responses:
$ref: './responses/_index.yaml'

Check warning on line 813 in src/openapi.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

oas3-unused-component

Potentially unused component has been detected.
securitySchemes:
bearerAuth:
type: http
Expand Down
2 changes: 2 additions & 0 deletions src/parameters/_index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobId:
# QUERY
gitCommitId:
$ref: ./query/gitCommitId.yaml
gitTokenId:
$ref: ./path/gitTokenId.yaml
instanceId:
$ref: ./path/instanceId.yaml
invoiceId:
Expand Down
7 changes: 7 additions & 0 deletions src/parameters/path/gitTokenId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: gitTokenId
in: path
description: Git Token ID
required: true
schema:
type: string
format: uuid
26 changes: 26 additions & 0 deletions src/resources/GitToken.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,29 @@ get:
$ref: '../responses/Forbidden.yaml'
'404':
$ref: '../responses/NotFound.yaml'
post:
summary: 'Create a git token'
description: Create a new git token to be used as a git provider by a service
operationId: createGitToken
parameters:
- $ref: '../parameters/path/organizationId.yaml'
tags:
- Organization Main Calls
requestBody:
content:
application/json:
schema:
$ref: '../schemas/GitTokenRequest.yaml'
responses:
'201':
description: 'Git token created'
content:
application/json:
schema:
$ref: '../schemas/GitTokenResponse.yaml'
'401':
$ref: '../responses/NotAuthorized.yaml'
'403':
$ref: '../responses/Forbidden.yaml'
'404':
$ref: '../responses/NotFound.yaml'
45 changes: 45 additions & 0 deletions src/resources/GitTokenRef.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
put:

Check warning on line 1 in src/resources/GitTokenRef.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

operation-description

Operation "description" must be present and non-empty string.
summary: 'Edit a git token'
operationId: editGitToken
parameters:
- $ref: '../parameters/path/organizationId.yaml'
- $ref: '../parameters/path/gitTokenId.yaml'
tags:
- Organization Main Calls
requestBody:
content:
application/json:
schema:
$ref: '../schemas/GitTokenRequest.yaml'
responses:
'200':
description: 'Git token edited'
content:
application/json:
schema:
$ref: '../schemas/GitTokenResponse.yaml'
'400':
$ref: '../responses/BadRequest.yaml'
'401':
$ref: '../responses/NotAuthorized.yaml'
'403':
$ref: '../responses/Forbidden.yaml'
'404':
$ref: '../responses/NotFound.yaml'
delete:

Check warning on line 29 in src/resources/GitTokenRef.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

operation-description

Operation "description" must be present and non-empty string.
summary: 'Delete a git token'
operationId: deleteGitToken
parameters:
- $ref: '../parameters/path/organizationId.yaml'
- $ref: '../parameters/path/gitTokenId.yaml'
tags:
- Organization Main Calls
responses:
'204':
$ref: '../responses/Deleted.yaml'
'401':
$ref: '../responses/NotAuthorized.yaml'
'403':
$ref: '../responses/Forbidden.yaml'
'404':
$ref: '../responses/NotFound.yaml'
18 changes: 18 additions & 0 deletions src/schemas/GitTokenRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type: object
required:
- name
- type
- token
properties:
name:
type: string
description:
type: string
type:
$ref: './enums/GitProvider.yaml'
token:
type: string
description: The token from your git provider side
workspace:
type: string
description: Mandatory only for BITBUCKET git provider, to allow us to fetch repositories at creation/edition of a service
3 changes: 3 additions & 0 deletions src/schemas/GitTokenResponse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ allOf:
type: string
type:
$ref: './enums/GitProvider.yaml'
expired_at:
type: string
format: date
2 changes: 2 additions & 0 deletions src/schemas/_index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ GitRepositoryBranchResponseList:
$ref: ./GitRepositoryBranchResponseList.yaml
GitRepositoryResponseList:
$ref: ./GitRepositoryResponseList.yaml
GitTokenRequest:
$ref: ./GitTokenRequest.yaml
GitTokenResponse:
$ref: ./GitTokenResponse.yaml
GitTokenResponseList:
Expand Down
Loading