lib/swagger/auth0.yaml

495 lines
12 KiB
YAML
Raw Permalink Normal View History

2021-01-08 17:19:58 +00:00
swagger: "2.0"
info:
version: "1.2.7"
title: "auth0"
description: "Auth0 Swagger Definition"
termsOfService: "http://taxnexus.net/terms/"
contact:
email: "noc@taxnexus.net"
license:
name: "Proprietary - Copyright (c) 2018-2020 by Taxnexus, Inc."
schemes:
- "https"
host: "taxnexus.auth0.com"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
CredentialsRequest:
name: CredentialsRequest
in: body
required: true
description: Get Authentation Token
schema:
$ref: "#/definitions/CredentialsRequest"
email:
name: email
in: query
type: string
required: true
authHeader:
name: Authorization
in: header
type: string
required: true
UserRequest:
description: An array of User records
in: body
name: UserRequest
required: true
schema:
$ref: "#/definitions/UserRequest"
RoleUsersRequest:
description: An array of User IDs to add to a Role
in: body
name: RoleUsersRequest
required: true
schema:
$ref: "#/definitions/RoleUsersRequest"
UserRolesRequest:
description: An array of User IDs to add to a Role
in: body
name: UserRolesRequest
required: true
schema:
$ref: "#/definitions/UserRolesRequest"
roleId:
name: roleId
description: An Auth0 Role ID
type: string
in: path
required: true
userId:
name: userId
description: An Auth0 User ID
type: string
in: path
required: true
responses:
AccessForbidden:
description: "Access forbidden, account lacks access"
schema:
$ref: "#/definitions/Error"
NotFound:
description: Resource was not found
schema:
$ref: "#/definitions/Error"
ServerError:
description: Server Internal Error
schema:
$ref: "#/definitions/Error"
Unauthorized:
description: "Access Unauthorized, invalid API-KEY was used"
schema:
$ref: "#/definitions/Error"
UnprocessableEntity:
description: "Unprocessable Entity, likely a bad parameter"
schema:
$ref: "#/definitions/Error"
UserResponse:
description: Taxnexus Response with User objects
schema:
items:
$ref: "#/definitions/User"
type: array
RoleResponse:
description: Taxnexus Response with User objects
schema:
$ref: "#/definitions/RoleResponse"
CredentialsResponse:
description: Credentials response from Auth0
schema:
$ref: "#/definitions/CredentialsResponse"
paths:
/oauth/token:
post:
summary: post to /oauth/token
operationId: postCredentials
description: Get credential token
parameters:
- $ref: "#/parameters/CredentialsRequest"
tags:
- Auth
responses:
"200":
$ref: "#/responses/CredentialsResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
/api/v2/roles:
get:
summary: Get Roles from Auth0
operationId: getRoles
description: Get Roles from Auth0
tags:
- Role
parameters:
- $ref: "#/parameters/authHeader"
responses:
"200":
$ref: "#/responses/UserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
/api/v2/roles/{roleId}/users:
post:
summary: Add users to role
operationId: postRoleUsers
description: Add users to role
parameters:
- $ref: "#/parameters/authHeader"
- $ref: "#/parameters/RoleUsersRequest"
- $ref: "#/parameters/roleId"
tags:
- Role
responses:
"200":
description: Role users successfully updated
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
/api/v2/users/{userId}/roles:
delete:
parameters:
- $ref: "#/parameters/authHeader"
- $ref: "#/parameters/userId"
- $ref: "#/parameters/UserRolesRequest"
tags:
- User
responses:
"204":
description: User roles successfully removed
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
get:
summary: Get a User's Roles
description: Get a User's Roles
operationId: getUserRoles
parameters:
- $ref: "#/parameters/authHeader"
- $ref: "#/parameters/userId"
tags:
- User
responses:
"200":
$ref: "#/responses/RoleResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
/api/v2/users:
get:
summary: Get all users from Auth0
operationId: getUsers
description: Get all users from Auth0
parameters:
- $ref: "#/parameters/authHeader"
tags:
- User
responses:
"200":
$ref: "#/responses/UserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
/api/v2/users-by-email:
get:
summary: Get a single user from Auth0 by Email Address
operationId: getUserByEmail
description: Get a single user from Auth0 by Email Address
parameters:
- $ref: "#/parameters/authHeader"
- $ref: "#/parameters/email"
tags:
- User
responses:
"200":
$ref: "#/responses/UserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
post:
summary: Create new Auth0 user
operationId: postUsers
description: create new Auth0 user
parameters:
- $ref: "#/parameters/authHeader"
- $ref: "#/parameters/UserRequest"
tags:
- User
responses:
"201":
description: New user created
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"409":
description: User already exists
"500":
$ref: "#/responses/ServerError"
definitions:
Error:
properties:
code:
format: int32
type: integer
fields:
type: string
message:
type: string
type: object
Role:
properties:
id:
type: "string"
example: "rol_oWVoMn2Zx2qDSGUL"
name:
type: "string"
example: "Developer"
description:
type: "string"
example: "Taxnexus API Developer"
type: "object"
RoleResponse:
type: object
properties:
roles:
type: array
items:
$ref: "#/definitions/Role"
RoleUsersRequest:
properties:
users:
type: array
items:
type: string
UserRolesRequest:
properties:
roles:
type: array
items:
type: string
CredentialsRequest:
type: object
properties:
client_id:
type: string
client_secret:
type: string
audience:
type: string
grant_type:
type: string
CredentialsResponse:
type: object
properties:
access_token:
type: string
scope:
type: string
expires_in:
type: number
format: int64
token_type:
format: string
NewUser:
type: object
properties:
email:
type: "string"
example: "john.doe@gmail.com"
phone_number:
type: "string"
example: "+199999999999999"
blocked:
type: "boolean"
example: false
email_verified:
type: "boolean"
example: false
phone_verified:
type: "boolean"
example: false
given_name:
type: "string"
example: "John"
family_name:
type: "string"
example: "Doe"
name:
type: "string"
example: "John Doe"
nickname:
type: "string"
example: "Johnny"
picture:
type: "string"
example: "https://secure.gravatar.com/avatar/15626c5e0c749cb912f9d1ad48dba440?s=480&r=pg&d=https%3A%2F%2Fssl.gstatic.com%2Fs2%2Fprofiles%2Fimages%2Fsilhouette80.png"
user_id:
type: "string"
example: "abc"
connection:
type: "string"
example: "Initial-Connection"
password:
type: "string"
example: "secret"
verify_email:
type: "boolean"
example: false
username:
type: "string"
example: "johndoe"
User:
properties:
email:
type: "string"
example: "vern@taxnexus.net"
email_verified:
type: "boolean"
example: true
user_id:
type: "string"
example: "auth0|5b180537157859716f2c9df5"
picture:
type: "string"
example: "https://s.gravatar.com/avatar/a08710b8d49416c729a0da8a9c34cdb0?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fve.png"
nickname:
type: "string"
example: "vern"
identities:
type: "array"
items:
type: "object"
properties:
connection:
type: "string"
example: "Username-Password-Authentication"
provider:
type: "string"
example: "auth0"
user_id:
type: "string"
example: "5b180537157859716f2c9df5"
isSocial:
type: "boolean"
example: false
updated_at:
type: "string"
example: "2020-09-22T19:19:02.706Z"
created_at:
type: "string"
example: "2018-06-06T16:00:55.930Z"
name:
type: "string"
example: "Vernon Keenan"
last_password_reset:
type: "string"
example: "2020-09-21T00:11:47.397Z"
multifactor_last_modified:
type: "string"
example: "2020-09-21T00:30:34.081Z"
family_name:
type: "string"
example: "Keenan"
given_name:
type: "string"
example: "Vernon"
user_metadata:
properties:
taxnexus_email:
type: "string"
example: "vern@taxnexus.net"
taxnexus_firstname:
type: "string"
example: "Vernon"
taxnexus_fullname:
type: "string"
example: "Vernon Keenan"
taxnexus_lastname:
type: "string"
example: "Keenan"
taxnexus_phone:
type: "string"
example: "+15106791900"
type: "object"
app_metadata:
properties:
taxnexus_account_id:
type: "string"
example: "7f661ca6-ae4a-486f-9c3c-cd292685a46d"
taxnexus_contact_id:
type: "string"
example: "9f79dca8-e875-4e2b-a5ad-001a3d32e83d"
taxnexus_user_id:
type: "string"
example: "f04da03d-70ad-46df-a46c-a676388aadd7"
roles:
type: "array"
items:
type: "string"
example:
- "login"
type: "object"
last_ip:
type: "string"
example: "67.188.106.161"
last_login:
type: "string"
example: "2020-09-22T19:19:02.706Z"
logins_count:
type: "number"
example: 178
format: int64
UserRequest:
description: An array Auth0 new user objects
properties:
users:
items:
$ref: "#/definitions/NewUser"
type: array
type: object