Microcks config API

Operations related to configuration

OpenAPI Specification

microcks-config-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Microcks API v1.14 config API
  version: 1.14.0
  description: API offered by Microcks, the Kubernetes native tool for API and microservices mocking and testing (microcks.io)
  contact:
    name: Laurent Broudoux
    url: https://github.com/microcks
    email: laurent@microcks.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  x-logo:
    backgroundColor: '#ffffff'
    url: https://microcks.io/images/microcks-logo-blue.png
servers:
- url: http://microcks.example.com/api
  description: ''
security:
- jwt-bearer: []
tags:
- name: config
  description: Operations related to configuration
paths:
  /secrets:
    summary: This path operations deal with Secrets
    get:
      tags:
      - config
      parameters:
      - name: page
        description: Page of Secrets to retrieve (starts at and defaults to 0)
        schema:
          type: integer
        in: query
        required: false
      - name: size
        description: Size of a page. Maximum number of Secrets to include in a response (defaults to 20)
        schema:
          type: integer
        in: query
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Secret'
          description: List of found Secrets
      security:
      - jwt-bearer:
        - user
      operationId: GetSecrets
      summary: Get Secrets
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Secret'
      tags:
      - config
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Secret'
          description: Created Secret
      security:
      - jwt-bearer:
        - admin
      operationId: CreateSecret
      summary: Create a new Secret
  /secrets/{id}:
    parameters:
    - name: id
      description: Unique identifier of Secret to manage
      schema:
        type: string
      in: path
      required: true
    get:
      tags:
      - config
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Secret'
          description: Found Secret
      security:
      - jwt-bearer:
        - admin
      operationId: GetSecret
      summary: Get Secret
      description: Retrieve a Secret
    put:
      requestBody:
        description: The Secret to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Secret'
        required: true
      tags:
      - config
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Secret'
          description: Updated Secret
      security:
      - jwt-bearer:
        - admin
      operationId: UpdateSecret
      summary: Update Secret
      description: Update a Secret
    delete:
      tags:
      - config
      responses:
        '200':
          description: Secret has been deleted
      security:
      - jwt-bearer:
        - admin
      operationId: DeleteSecret
      summary: Delete Secret
      description: Delete a Secret
  /secrets/count:
    get:
      tags:
      - config
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Counter'
          description: Number of Secrets in datastore
      security:
      - jwt-bearer:
        - user
      operationId: GetSecretsCounter
      summary: Get the Secrets counter
  /keycloak/config:
    summary: Keycloak Authentification configuration
    get:
      tags:
      - config
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeycloakConfig'
          description: Get current configuration
      operationId: GetKeycloakConfig
      summary: Get authentification configuration
  /features/config:
    summary: Optional features configuration
    get:
      tags:
      - config
      responses:
        '200':
          content:
            application/json: {}
          description: Get features configuration
      operationId: GetFeaturesConfig
      summary: Get features configuration
  /secrets/search:
    get:
      tags:
      - config
      parameters:
      - name: name
        description: Search using this name-like criterion
        schema:
          type: string
        in: query
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Secret'
          description: List of found Secrets (filtered according search criteria)
      security:
      - jwt-bearer:
        - admin
      operationId: SearchSecrets
      summary: Search for Secrets
components:
  schemas:
    KeycloakConfig:
      description: Representation of Keycloak / SSO configuration used by Microcks server
      required:
      - realm
      - auth-server-url
      - public-client
      - ssl-required
      - resource
      - enabled
      type: object
      properties:
        realm:
          description: Authentication realm name
          type: string
        auth-server-url:
          description: SSO Server authentication url
          type: string
        public-client:
          description: Name of public-client that can be used for requesting OAuth token
          type: boolean
        ssl-required:
          description: SSL certificates requirements
          enum:
          - none
          - external
        resource:
          description: Name of Keycloak resource/application used on client side
          type: string
        enabled:
          description: Whether Keycloak authentification and usage is enabled
          type: boolean
    Counter:
      description: A simple Counter type.
      type: object
      properties:
        counter:
          format: int32
          description: Number of items in a resource collection
          type: integer
      example: "{\n    \"counter\": 12\n}"
    Secret:
      description: A Secret allows grouping informations on how to access a restricted resource such as a repsoitory URL. Secrets are typically used by ImpoortJobs.
      required:
      - name
      - description
      properties:
        id:
          description: Unique identifier of Secret
          type: string
        name:
          description: Unique distinct name of Secret
          type: string
        username:
          type: string
        password:
          type: string
        token:
          type: string
        tokenHeader:
          type: string
        caCertPem:
          type: string
        description:
          description: Description of this Secret
          type: string
      example: "{\n    \"id\": \"5be58fb51ed744d1b87481bd\",\n    \"name\": \"Gogs internal\",\n    \"description\": \"Gogs internal corporate repository\",\n    \"username\": \"team\",\n    \"password\": \"team\",\n    \"caCertPem\": \"-----BEGIN CERTIFICATE-----\\nMIIC6jCCAdKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtvcGVu\\nc2hpZnQtc2lnbmVyQDE1MzE5MTA5MDIwHhcNMTgwNzE4MTA0ODIyWhcNMjMwNzE3\\nMTA0ODIzWjAmMSQwIgYDVQQDDBtvcGVuc2hpZnQtc2lnbmVyQDE1MzE5MTA5MDIw\\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCyaP1jlpnm8WpfCSnUa8Qt\\nhdUynOLLgElUtpWoW25wB9tO2ZmEj+fVsTyzEsW8+nfXXfRsBEzPm2ze9uEMTPTB\\nAY0k7DbLZfjmF1lCckUvvh1rR/8hoPuXETjXUuOdtm7gRHTOxLQyH2Qi/q0DYJAn\\nprKyRCLa35pRnykL6v4bHkqFnqDEho63i29XHhm2703moh4YCl1iYa2Rh6D44cjn\\n8lBCq6o7zoZSmc/aBamRkQrfZYcolR8OUtDS4oEB0zMftmea2ycashsLEMB+Cq4r\\n64NI2QM7qOxdTuXsDivHfLl7RTuWEOozGaJXoiPaGU/3d/KnY0gKJ2TC1KXt6Xjn\\nAgMBAAGjIzAhMA4GA1UdDwEB/wQEAwICpDAPBgNVHRMBAf8EBTADAQH/MA0GCSqG\\nSIb3DQEBCwUAA4IBAQCeUmxfUzw0VAFG6HvVYIsfvumiIvsSWmclGIZqNJyfMHFD\\nMy6xzPRNNfWe5aumGTJsuIzuXfDRcdO7KmH1d2/5brkvWpxp6svVrYPvcoXjl4VN\\nQR2mv5Di4KHfiiwvP3eeewjUZj+uREGqX2fcbJPHTPy32Kpb0H8Uy09BklhjC7QP\\ngRAGexPhU1oBL/CoOwbHKcQ6dxs/y1SxzI8gXEtec4z62CroI13iT7U0UjSqFBE4\\nKfrJombfz0d68781Z40ll+8my251ZNfbLBhQ3UHW0JnkBEQkE1aBorUoj2iakYvx\\nA2qZh+8q2b8MwMb2YsQ0dlxKd6c4tN3lmMnO4bnd\\n-----END CERTIFICATE-----\"\n}"
  securitySchemes:
    jwt-bearer:
      flows:
        clientCredentials:
          tokenUrl: https://keycloak.example.com/realms/microcks/protocol/openid-connect/token
          refreshUrl: https://keycloak.example.com/realms/microcks/protocol/openid-connect/token
          scopes:
            user: Simple authenticated user
            manager: Services & APIs content manager
            admin: Administrator of the Microcks instance
      type: oauth2
      description: JWT Bearer acquired using OAuth 2 Authentication flow or Direct Access Grant