Skip to content

Commit

Permalink
add: Added Keychains and Keys schema and models
Browse files Browse the repository at this point in the history
Signed-off-by: Saurabh Kumar Singh <[email protected]>
  • Loading branch information
singh1203 committed Aug 29, 2024
1 parent 0b488ab commit 51c9501
Show file tree
Hide file tree
Showing 4 changed files with 367 additions and 0 deletions.
59 changes: 59 additions & 0 deletions models/v1beta1/keychains.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions models/v1beta1/keys.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

148 changes: 148 additions & 0 deletions schemas/constructs/openapi/keychains.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
openapi: 3.0.0
info:
title: Meshery Cloud
description: Documentation for meshery Cloud REST APIs
contact:
email: [email protected]
version: v0.6.394
servers:
- url: https://meshery.layer5.io
description: Meshery Cloud production server URL
- url: https://staging-meshery.layer5.io
description: Meshery Cloud staging server URL
- url: http://localhost:9876
description: Meshery Cloud development server URL (controlled via PORT environment variable)
tags:
- name: keychains
description: APIs for keychains
security:
- jwt: []
components:
securitySchemes:
jwt:
type: http
scheme: Bearer
bearerFormat: JWT

schemas:
keychain:
properties:
ID:
type: string
format: uuid
x-go-type: uuid.UUID
x-go-type-import:
path: github.com/gofrs/uuid
x-oapi-codegen-extra-tags:
db: id
json: id
x-go-type-skip-optional-pointer: true
name:
type: string
format: string
x-oapi-codegen-extra-tags:
db: name
json: name
x-go-type-skip-optional-pointer: true
owner:
type: string
format: uuid
x-go-type: uuid.UUID
x-go-type-import:
path: github.com/gofrs/uuid
x-oapi-codegen-extra-tags:
db: owner
json: owner
x-go-type-skip-optional-pointer: true
created_at:
$ref: ./common/core.yml#/components/schemas/created_at
updated_at:
$ref: ./common/core.yml#/components/schemas/updated_at
deleted_at:
type: string
format: date-time
x-go-type: sql.NullTime
x-go-name: DeletedAt
x-oapi-codegen-extra-tags:
db: deleted_at
json: deleted_at
x-go-type-skip-optional-pointer: true

keychainsPage:
properties:
page:
$ref: ./common/core.yml#/components/schemas/number
page_size:
$ref: ./common/core.yml#/components/schemas/number
total_count:
$ref: ./common/core.yml#/components/schemas/number
keychains:
type: array
x-go-type-skip-optional-pointer: true
items:
$ref: "#/components/schemas/keychain"

keychainsKeysMapping:
properties:
id:
$ref: ./common/core.yml#/components/schemas/general_id
keychain_id:
type: string
format: uuid
x-go-type: uuid.UUID
x-go-type-import:
path: github.com/gofrs/uuid
x-oapi-codegen-extra-tags:
db: keychain_id
json: keychain_id
x-go-type-skip-optional-pointer: true
key_id:
type: string
format: uuid
x-go-type: uuid.UUID
x-go-type-import:
path: github.com/gofrs/uuid
x-oapi-codegen-extra-tags:
db: key_id
json: key_id
x-go-type-skip-optional-pointer: true
created_at:
$ref: ./common/core.yml#/components/schemas/created_at
updated_at:
$ref: ./common/core.yml#/components/schemas/updated_at
deleted_at:
type: string
format: date-time
x-go-type: sql.NullTime
x-go-name: DeletedAt
x-oapi-codegen-extra-tags:
db: deleted_at
json: deleted_at
x-go-type-skip-optional-pointer: true

keychainsKeysMappingPage:
properties:
page:
$ref: ./common/core.yml#/components/schemas/number
page_size:
$ref: ./common/core.yml#/components/schemas/number
total_count:
$ref: ./common/core.yml#/components/schemas/number
keychains_keys_mappings:
type: array
x-go-type-skip-optional-pointer: true
items:
$ref: "#/components/schemas/keychainsKeysMapping"

keychainFilter:
properties:
role_id:
type: string
format: uuid
x-go-type: uuid.UUID
x-go-type-import:
path: github.com/gofrs/uuid
x-oapi-codegen-extra-tags:
db: role_id
json: role_id
x-go-type-skip-optional-pointer: true
105 changes: 105 additions & 0 deletions schemas/constructs/openapi/keys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
openapi: 3.0.0
info:
title: Meshery Cloud
description: Documentation for meshery Cloud REST APIs
contact:
email: [email protected]
version: v0.6.394
servers:
- url: https://meshery.layer5.io
description: Meshery Cloud production server URL
- url: https://staging-meshery.layer5.io
description: Meshery Cloud staging server URL
- url: http://localhost:9876
description: Meshery Cloud development server URL (controlled via PORT environment variable)
tags:
- name: keys
description: APIs for keys
security:
- jwt: []
components:
securitySchemes:
jwt:
type: http
scheme: Bearer
bearerFormat: JWT

schemas:
keysPage:
properties:
page:
$ref: ./common/core.yml#/components/schemas/number
page_size:
$ref: ./common/core.yml#/components/schemas/number
total_count:
$ref: ./common/core.yml#/components/schemas/number
keys:
type: array
x-go-type-skip-optional-pointer: true
items:
$ref: "#/components/schemas/key"

key:
properties:
id:
$ref: ./common/core.yml#/components/schemas/general_id
subcategory:
$ref: ./common/core.yml#/components/schemas/text
function:
$ref: ./common/core.yml#/components/schemas/text
category:
type: string
format: string
x-oapi-codegen-extra-tags:
db: category
json: category
x-go-type-skip-optional-pointer: true
description:
$ref: ./common/core.yml#/components/schemas/text
owner:
type: string
format: uuid
x-go-type: uuid.UUID
x-go-type-import:
path: github.com/gofrs/uuid
x-oapi-codegen-extra-tags:
db: owner
json: owner
x-go-type-skip-optional-pointer: true
created_at:
$ref: ./common/core.yml#/components/schemas/created_at
updated_at:
$ref: ./common/core.yml#/components/schemas/updated_at
deleted_at:
type: string
format: date-time
x-go-type: sql.NullTime
x-go-name: DeletedAt
x-oapi-codegen-extra-tags:
db: deleted_at
json: deleted_at
x-go-type-skip-optional-pointer: true
paths:
/api/auth/keys:
get:
tags:
- keys
summary: Get all keys
operationId: GetKeys
description: Lists the keys available
parameters:
- $ref: ./common/parameters.yml#/components/parameters/page
- $ref: ./common/parameters.yml#/components/parameters/page_size
- $ref: ./common/parameters.yml#/components/parameters/search
- $ref: ./common/parameters.yml#/components/parameters/order
responses:
'200':
description: Keys
content:
application/json:
schema:
$ref: "#/components/schemas/keysPage"
'401':
- $ref: ./common/responses.yml#/401
'500':
- $ref: ./common/responses.yml#/500

0 comments on commit 51c9501

Please sign in to comment.