diff --git a/models/v1beta1/keychains.go b/models/v1beta1/keychains.go new file mode 100644 index 0000000000..18f0f2d1c6 --- /dev/null +++ b/models/v1beta1/keychains.go @@ -0,0 +1,59 @@ +// Package v1beta1 provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT. +package v1beta1 + +import ( + "database/sql" + + "github.com/gofrs/uuid" + externalRef1 "github.com/meshery/schemas/models/core" +) + +// Keychain defines model for keychain. +type Keychain struct { + ID uuid.UUID `db:"id" json:"id"` + + // CreatedAt Timestamp when the resource was created. + CreatedAt externalRef1.CreatedAt `db:"created_at" json:"created_at,omitempty" yaml:"created_at"` + DeletedAt sql.NullTime `db:"deleted_at" json:"deleted_at"` + Name string `db:"name" json:"name"` + Owner uuid.UUID `db:"owner" json:"owner"` + + // UpdatedAt Timestamp when the resource was updated. + UpdatedAt externalRef1.UpdatedAt `db:"updated_at" json:"updated_at,omitempty" yaml:"updated_at"` +} + +// KeychainFilter defines model for keychainFilter. +type KeychainFilter struct { + RoleId uuid.UUID `db:"role_id" json:"role_id"` +} + +// KeychainsKeysMapping defines model for keychainsKeysMapping. +type KeychainsKeysMapping struct { + // CreatedAt Timestamp when the resource was created. + CreatedAt externalRef1.CreatedAt `db:"created_at" json:"created_at,omitempty" yaml:"created_at"` + DeletedAt sql.NullTime `db:"deleted_at" json:"deleted_at"` + Id externalRef1.GeneralId `db:"id" json:"id"` + KeyId uuid.UUID `db:"key_id" json:"key_id"` + KeychainId uuid.UUID `db:"keychain_id" json:"keychain_id"` + + // UpdatedAt Timestamp when the resource was updated. + UpdatedAt externalRef1.UpdatedAt `db:"updated_at" json:"updated_at,omitempty" yaml:"updated_at"` +} + +// KeychainsKeysMappingPage defines model for keychainsKeysMappingPage. +type KeychainsKeysMappingPage struct { + KeychainsKeysMappings []KeychainsKeysMapping `json:"keychains_keys_mappings,omitempty"` + Page externalRef1.Number `json:"page,omitempty"` + PageSize externalRef1.Number `json:"page_size,omitempty"` + TotalCount externalRef1.Number `json:"total_count,omitempty"` +} + +// KeychainsPage defines model for keychainsPage. +type KeychainsPage struct { + Keychains []Keychain `json:"keychains,omitempty"` + Page externalRef1.Number `json:"page,omitempty"` + PageSize externalRef1.Number `json:"page_size,omitempty"` + TotalCount externalRef1.Number `json:"total_count,omitempty"` +} diff --git a/models/v1beta1/keys.go b/models/v1beta1/keys.go new file mode 100644 index 0000000000..2e0d7942ec --- /dev/null +++ b/models/v1beta1/keys.go @@ -0,0 +1,55 @@ +// Package v1beta1 provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT. +package v1beta1 + +import ( + "database/sql" + + "github.com/gofrs/uuid" + externalRef1 "github.com/meshery/schemas/models/core" +) + +const ( + JwtScopes = "jwt.Scopes" +) + +// Key defines model for key. +type Key struct { + Category string `db:"category" json:"category"` + + // CreatedAt Timestamp when the resource was created. + CreatedAt externalRef1.CreatedAt `db:"created_at" json:"created_at,omitempty" yaml:"created_at"` + DeletedAt sql.NullTime `db:"deleted_at" json:"deleted_at"` + Description externalRef1.Text `json:"description,omitempty"` + Function externalRef1.Text `json:"function,omitempty"` + Id externalRef1.GeneralId `db:"id" json:"id"` + Owner uuid.UUID `db:"owner" json:"owner"` + Subcategory externalRef1.Text `json:"subcategory,omitempty"` + + // UpdatedAt Timestamp when the resource was updated. + UpdatedAt externalRef1.UpdatedAt `db:"updated_at" json:"updated_at,omitempty" yaml:"updated_at"` +} + +// KeysPage defines model for keysPage. +type KeysPage struct { + Keys []Key `json:"keys,omitempty"` + Page externalRef1.Number `json:"page,omitempty"` + PageSize externalRef1.Number `json:"page_size,omitempty"` + TotalCount externalRef1.Number `json:"total_count,omitempty"` +} + +// GetKeysParams defines parameters for GetKeys. +type GetKeysParams struct { + // Page Get reponses by page + Page *externalRef1.Page `form:"page,omitempty" json:"page,omitempty"` + + // PageSize Get reponses by pageSize + PageSize *externalRef1.PageSize `form:"page_size,omitempty" json:"page_size,omitempty"` + + // Search Get responses that match search param value + Search *externalRef1.Search `form:"search,omitempty" json:"search,omitempty"` + + // Order Get ordered responses + Order *externalRef1.Order `form:"order,omitempty" json:"order,omitempty"` +} diff --git a/schemas/constructs/openapi/keychains.yml b/schemas/constructs/openapi/keychains.yml new file mode 100644 index 0000000000..4ce686ebca --- /dev/null +++ b/schemas/constructs/openapi/keychains.yml @@ -0,0 +1,148 @@ +openapi: 3.0.0 +info: + title: Meshery Cloud + description: Documentation for meshery Cloud REST APIs + contact: + email: support@layer5.io + 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 \ No newline at end of file diff --git a/schemas/constructs/openapi/keys.yml b/schemas/constructs/openapi/keys.yml new file mode 100644 index 0000000000..da6321d820 --- /dev/null +++ b/schemas/constructs/openapi/keys.yml @@ -0,0 +1,105 @@ +openapi: 3.0.0 +info: + title: Meshery Cloud + description: Documentation for meshery Cloud REST APIs + contact: + email: support@layer5.io + 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