Express Gateway Credentials API

The Credentials API from Express Gateway — 6 operation(s) for credentials.

OpenAPI Specification

express-gateway-credentials-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Express Gateway Admin Apps Credentials API
  description: 'Administrative REST API for Express Gateway - the API gateway built on

    Express.js. The Admin API manages users, applications, credentials,

    scopes, schemas, policies, service endpoints, API endpoints, and

    pipelines. By default it listens on http://localhost:9876 and should

    NOT be exposed publicly without protection - the recommended pattern

    is to expose it through Express Gateway itself behind a key-auth

    policy (Authorization: apikey {keyId}:{keySecret}).

    '
  version: 1.0.0
  contact:
    name: Express Gateway
    url: https://www.express-gateway.io/docs/
servers:
- url: http://localhost:9876
  description: Default admin API host
security:
- {}
- KeyAuth: []
tags:
- name: Credentials
paths:
  /credentials:
    get:
      summary: List credentials
      operationId: listCredentials
      responses:
        '200':
          description: Credential collection
      tags:
      - Credentials
    post:
      summary: Create a credential
      operationId: createCredential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '201':
          description: Credential created
      tags:
      - Credentials
  /credentials/{consumerId}:
    get:
      summary: List credentials for a consumer (user or app)
      operationId: listConsumerCredentials
      parameters:
      - name: consumerId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Credential list
      tags:
      - Credentials
  /credentials/{type}/{id}:
    parameters:
    - name: type
      in: path
      required: true
      schema:
        type: string
        enum:
        - key-auth
        - basic-auth
        - oauth2
        - jwt
    - name: id
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get a credential by type and id
      operationId: getCredential
      responses:
        '200':
          description: Credential
      tags:
      - Credentials
  /credentials/{type}/{id}/status:
    put:
      summary: Activate or deactivate a credential
      operationId: setCredentialStatus
      parameters:
      - name: type
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                  - active
                  - inactive
      responses:
        '204':
          description: Status updated
      tags:
      - Credentials
  /credentials/{type}/{id}/scopes:
    put:
      summary: Set all scopes on a credential
      operationId: setCredentialScopes
      parameters:
      - name: type
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                scopes:
                  type: array
                  items:
                    type: string
      responses:
        '204':
          description: Scopes updated
      tags:
      - Credentials
  /credentials/{type}/{id}/scopes/{scope}:
    parameters:
    - name: type
      in: path
      required: true
      schema:
        type: string
    - name: id
      in: path
      required: true
      schema:
        type: string
    - name: scope
      in: path
      required: true
      schema:
        type: string
    put:
      summary: Add a scope to a credential
      operationId: addCredentialScope
      responses:
        '204':
          description: Scope added
      tags:
      - Credentials
    delete:
      summary: Remove a scope from a credential
      operationId: removeCredentialScope
      responses:
        '204':
          description: Scope removed
      tags:
      - Credentials
components:
  securitySchemes:
    KeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'When the Admin API is fronted by Express Gateway with key-auth,

        send "Authorization: apikey {keyId}:{keySecret}".

        '