Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: "2.0"
- info:
- description: "IAM service"
- version: "0.0.1"
- title: "iam"
- host: "iam-service"
- schemes:
- - "http"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- securityDefinitions:
- Bearer:
- type: "apiKey"
- name: "Authorization"
- in: "header"
- paths:
- /jwks:
- get:
- tags:
- - "iam"
- summary: "Get the json web key set"
- description: "Returns a list of public key's to validate jwt"
- operationId: "getJwks"
- responses:
- 200:
- description: "List of JWK's"
- schema:
- type: "object"
- properties:
- keys:
- type: "array"
- items:
- $ref: "#/definitions/Jwk"
- /tenants:
- get:
- tags:
- - "tenants"
- security:
- - Bearer: []
- summary: "Get a list of tenants"
- description: "Returns a list of tenants"
- operationId: "listTenants"
- responses:
- 200:
- description: "List of tenants"
- schema:
- type: "object"
- properties:
- data:
- type: "array"
- items:
- $ref: "#/definitions/Tenant"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- post:
- tags:
- - "tenants"
- summary: "Create a new tenant"
- description: "Returns a new authorization response"
- operationId: "createTenant"
- parameters:
- - name: "id"
- in: "path"
- description: "Id that belongs to the oauth client"
- required: true
- type: "string"
- - in: "body"
- name: "body"
- description: "Signup object"
- required: true
- schema:
- $ref: "#/definitions/Signup"
- responses:
- 200:
- description: "Tenant and user information"
- schema:
- type: "object"
- properties:
- data:
- type: "object"
- properties:
- tenant:
- $ref: "#/definitions/Tenant"
- user:
- $ref: "#/definitions/User"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /tenants/me:
- get:
- tags:
- - "tenants"
- security:
- - Bearer: []
- summary: "Get a info about the current tenant"
- description: "Returns a list of tenants"
- operationId: "getTenant"
- responses:
- 200:
- description: "Tenants model"
- schema:
- type: "object"
- properties:
- data:
- $ref: "#/definitions/Tenant"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /users:
- get:
- tags:
- - "users"
- security:
- - Bearer: []
- summary: "Get a list of users"
- description: "Returns a list of users"
- operationId: "listUsers"
- responses:
- 200:
- description: "List of users"
- schema:
- type: "object"
- properties:
- data:
- type: "array"
- items:
- $ref: "#/definitions/User"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- post:
- tags:
- - "users"
- security:
- - Bearer: []
- summary: "Create a new user"
- description: "Returns a new authorization response"
- operationId: "createUser"
- parameters:
- - in: "body"
- name: "body"
- description: "User object"
- required: true
- schema:
- $ref: "#/definitions/UserModel"
- responses:
- 200:
- description: "Created user"
- schema:
- type: "object"
- properties:
- data:
- $ref: "#/definitions/User"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /users/{id}:
- get:
- tags:
- - "users"
- security:
- - Bearer: []
- summary: "Get a single user by id"
- description: "Returns a single user"
- operationId: "getUser"
- parameters:
- - name: "id"
- in: "path"
- description: "Id that belongs to the user"
- required: true
- type: "string"
- responses:
- 200:
- description: "The user"
- schema:
- type: "object"
- properties:
- data:
- $ref: "#/definitions/User"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /users/{id}/verify:
- put:
- tags:
- - "users"
- security:
- - Bearer: []
- summary: "Mark user's email as verified"
- description: "So the user can login"
- operationId: "verifyUser"
- parameters:
- - name: "id"
- in: "path"
- description: "Id that belongs to the user"
- required: true
- type: "string"
- responses:
- 200:
- description: "The user"
- schema:
- type: "object"
- properties:
- data:
- $ref: "#/definitions/User"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /oauth/clients:
- get:
- tags:
- - "clients"
- security:
- - Bearer: []
- summary: "Get a list of clients"
- description: "Returns a list of clients"
- operationId: "listClients"
- responses:
- 200:
- description: "List of clients"
- schema:
- type: "object"
- properties:
- data:
- type: "array"
- items:
- $ref: "#/definitions/Client"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- post:
- tags:
- - "clients"
- security:
- - Bearer: []
- summary: "Create a new oauth client"
- description: "Returns a new authorization response"
- operationId: "createClient"
- parameters:
- - in: "body"
- name: "body"
- description: "Email object"
- required: true
- schema:
- $ref: "#/definitions/ClientModel"
- responses:
- 200:
- description: "The created client"
- schema:
- type: "object"
- properties:
- data:
- $ref: "#/definitions/Client"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /oauth/clients/{id}:
- get:
- tags:
- - "clients"
- security:
- - Bearer: []
- summary: "Find the oauth client"
- description: "Returns the oauth client for the given client id"
- operationId: "getClient"
- parameters:
- - name: "id"
- in: "path"
- description: "Id that belongs to the oauth client"
- required: true
- type: "string"
- responses:
- 200:
- description: "The oauth client"
- schema:
- type: "object"
- properties:
- data:
- $ref: "#/definitions/Client"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /oauth/clients/apps:
- get:
- tags:
- - "clients"
- summary: "Get a list of open / shared / third party"
- description: "Returns a list of clients"
- operationId: "listOpenClients"
- responses:
- 200:
- description: "List of clients"
- schema:
- type: "object"
- properties:
- data:
- type: "array"
- items:
- $ref: "#/definitions/Client"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /oauth/scopes:
- get:
- tags:
- - "scopes"
- security:
- - Bearer: []
- summary: "List all available scopes"
- description: "Get scopes for all registered services"
- operationId: "getScopesList"
- responses:
- 200:
- description: "The requested inbox"
- schema:
- type: "object"
- properties:
- data:
- type: "array"
- items:
- $ref: "#/definitions/Scope"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /oauth/scopes/{id}:
- get:
- tags:
- - "scopes"
- security:
- - Bearer: []
- summary: "Get a scope and it's description"
- description: "Get scope by id"
- operationId: "getScope"
- parameters:
- - name: "id"
- in: "path"
- description: "Id that belongs to the oauth client"
- required: true
- type: "string"
- responses:
- 200:
- description: "The list of scopes"
- schema:
- type: "object"
- properties:
- data:
- $ref: "#/definitions/Scope"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- /oauth/authorize:
- get:
- tags:
- - "tokens"
- security:
- - Bearer: []
- summary: "Obtain an authorization response"
- description: "Returns a new authorization response"
- operationId: "getRedirect"
- parameters:
- - in: "query"
- name: "redirect_uri"
- type: "string"
- - in: "query"
- name: "client_id"
- type: "string"
- - in: "query"
- name: "response_type"
- type: "string"
- - in: "query"
- name: "scope"
- type: "string"
- - in: "header"
- name: "Authorization"
- description: "Bearer token for user"
- type: "string"
- required: true
- responses:
- 200:
- description: "List of emails"
- schema:
- $ref: "#/definitions/AuthorizationResponse"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- post:
- tags:
- - "tokens"
- summary: "Obtain a new access token"
- description: "Returns a new access token"
- operationId: "getAccessToken"
- parameters:
- - name: "id"
- in: "path"
- description: "Id that belongs to the oauth client"
- required: true
- type: "string"
- - in: "body"
- name: "body"
- description: "Email object"
- required: true
- schema:
- $ref: "#/definitions/TokenRequest"
- responses:
- 200:
- description: "List of emails"
- schema:
- $ref: "#/definitions/AccessToken"
- 401:
- description: "Unauthorized"
- schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- definitions:
- Scope:
- type: "object"
- required:
- - "id"
- - "description"
- properties:
- id:
- type: "string"
- description:
- type: "string"
- RefreshToken:
- type: "object"
- required:
- - "token"
- properties:
- token:
- type: "string"
- AccessToken:
- type: "object"
- required:
- - "token"
- - "expires_at"
- properties:
- token:
- type: "string"
- expires_at:
- type: "string"
- format: "date-time"
- UserValidator:
- type: "object"
- required:
- - "email"
- - "password"
- properties:
- email:
- type: "string"
- password:
- type: "string"
- TokenRequest:
- type: "object"
- required:
- - "client_id"
- - "client_secret"
- - "grant_type"
- - "scope"
- properties:
- client_id:
- type: "string"
- client_secret:
- type: "string"
- grant_type:
- type: "string"
- scope:
- type: "array"
- items:
- type: "string"
- email:
- type: "string"
- password:
- type: "string"
- AuthorizeRequest:
- type: "object"
- required:
- - "response_type"
- - "client_id"
- - "redirect_uri"
- - "scope"
- properties:
- response_type:
- type: "string"
- client_id:
- type: "string"
- redirect_uri:
- type: "string"
- scope:
- type: "array"
- items:
- type: "string"
- AuthorizationResponse:
- type: "object"
- required:
- - "redirect_uri"
- - "client_name"
- - "scope"
- properties:
- redirect_uri:
- type: "string"
- client_name:
- type: "string"
- scope:
- type: "array"
- items:
- $ref: '#/definitions/Scope'
- ClientModel:
- type: "object"
- required:
- - "name"
- properties:
- name:
- type: "string"
- redirect_uri:
- type: "string"
- grant_types:
- type: "array"
- items:
- type: "string"
- scope:
- type: "array"
- items:
- type: "string"
- Client:
- type: "object"
- required:
- - "id"
- properties:
- id:
- type: "string"
- secret:
- type: "string"
- name:
- type: "string"
- redirect_uri:
- type: "string7"
- grant_types:
- type: "array"
- items:
- type: "string"
- scope:
- type: "array"
- items:
- type: "string"
- tenant_id:
- type: "string"
- UserModel:
- type: "object"
- required:
- - "email"
- - "first_name"
- - "last_name"
- properties:
- email:
- type: "string"
- password:
- type: "string"
- first_name:
- type: "string"
- last_name:
- type: "string"
- User:
- type: "object"
- required:
- - "email"
- - "first_name"
- - "last_name"
- - "is_verified"
- - "tenant_id"
- properties:
- id:
- type: "string"
- email:
- type: "string"
- first_name:
- type: "string"
- last_name:
- type: "string"
- is_verified:
- type: "boolean"
- tenant_id:
- type: "string"
- created_at:
- type: "string"
- format: "date-time"
- updated_at:
- type: "string"
- format: "date-time"
- Tenant:
- type: "object"
- required:
- - "company"
- properties:
- id:
- type: "string"
- company:
- $ref: "#/definitions/Company"
- is_active:
- type: "boolean"
- default: "active"
- TenantModel:
- type: "object"
- required:
- - "company"
- properties:
- company:
- $ref: "#/definitions/Company"
- Company:
- type: "object"
- required:
- - "name"
- - "billing_email"
- - "phone_number"
- - "address"
- properties:
- name:
- type: "string"
- vat_number:
- type: "string"
- billing_email:
- type: "string"
- phone_number:
- type: "string"
- address:
- $ref: "#/definitions/Address"
- Address:
- required:
- - "address_line_1"
- - "postal_code"
- - "city"
- - "country_code"
- type: "object"
- properties:
- address_line_1:
- type: "string"
- address_line_2:
- type: "string"
- postal_code:
- type: "string"
- city:
- type: "string"
- country_code:
- type: "string"
- Signup:
- type: "object"
- required:
- - "company"
- - "user"
- properties:
- company:
- $ref: '#/definitions/Company'
- user:
- $ref: '#/definitions/UserModel'
- Status:
- type: "object"
- required:
- - "status"
- - "changed_at"
- properties:
- status:
- type: "string"
- enum:
- - "printed"
- changed_at:
- type: "string"
- format: "date-time"
- Jwk:
- type: "object"
- required:
- - "alg"
- - "kty"
- - "use"
- - "x5c"
- - "n"
- - "e"
- - "kid"
- - "x5t"
- properties:
- alg:
- type: "string"
- enum:
- - "RS256"
- kty:
- type: "string"
- enum:
- - "RSA"
- use:
- type: "string"
- enum:
- - "sig"
- x5c:
- type: "array"
- items:
- type: "string"
- n:
- type: "string"
- e:
- type: "string"
- enum:
- - "AQAB"
- kid:
- type: "string"
- x5t:
- type: "string"
- Error:
- type: "object"
- required:
- - "code"
- - "message"
- properties:
- code:
- type: "integer"
- message:
- type: "string"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement