Skip to content

Commit

Permalink
fix: spec update
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Aug 2, 2022
1 parent 5ba5ed7 commit 544039f
Show file tree
Hide file tree
Showing 2 changed files with 2,580 additions and 2,311 deletions.
111 changes: 105 additions & 6 deletions lib/nile/spec/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,55 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/auth/oauth/google/callback:
get:
tags:
- developers
summary: Developer Google OAuth flow callback
description: |
This endpoint is called automatically by Google after the user authenticates successfully.
It's here for documentation purposes only, and it shouldn't be called directly.
operationId: developerGoogleOAuthCallback
parameters:
- name: code
in: query
schema:
type: string
- name: state
in: query
schema:
type: string
responses:
"200":
description: A successful login/signup for a developer
content:
application/json:
schema:
$ref: '#/components/schemas/DeveloperGoogleOAuthResponse'
"302":
description: |2
A redirect to the specified `redirect_to` URL after a successful
login/signup for a developer, if `redirect_to` was provided
when calling `/auth/oauth/google`. A response cookie
containing the developer's auth credentials will be set.
/auth/oauth/google:
get:
tags:
- developers
summary: Starts the developer Google OAuth flow
operationId: startDeveloperGoogleOAuth
parameters:
- name: redirect_to
in: query
description: An optional URL to redirect to after a successful login/signup.
schema:
type: string
format: uri
responses:
"302":
description: |
A redirect to Google for the user to authenticate.
After the user authenticates successfully, you'll be redirected to `/auth/oauth/google/callback`.
/workspaces/{workspace}/auth/login:
post:
tags:
Expand Down Expand Up @@ -501,12 +550,33 @@ paths:
type: array
items:
$ref: '#/components/schemas/Invite'
/workspaces/{workspace}/orgs/{org}/members:
/workspaces/{workspace}/orgs/{org}/users:
get:
tags:
- organizations
summary: List users in an organization
operationId: listUsersInOrg
parameters:
- $ref: '#/components/parameters/workspace'
- name: org
in: path
required: true
schema:
type: string
responses:
"200":
description: The users in this organization
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
post:
tags:
- organizations
summary: Add a user to an organization
operationId: addOrgMember
operationId: addUserToOrg
parameters:
- $ref: '#/components/parameters/workspace'
- name: org
Expand All @@ -518,11 +588,15 @@ paths:
content:
'*/*':
schema:
$ref: '#/components/schemas/AddOrgMemberRequest'
$ref: '#/components/schemas/AddUserToOrgRequest'
required: true
responses:
"204":
description: The user was successfully added to the org
"200":
description: The user added to the organization
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/workspaces/{workspace}/orgs:
get:
tags:
Expand Down Expand Up @@ -828,6 +902,24 @@ components:
type: string
description: The password of the user
example: mycatname
DeveloperGoogleOAuthResponse:
required:
- token
type: object
properties:
user:
$ref: '#/components/schemas/User'
token:
type: string
description: JWT authentication token. Most Nile operations the caller to
pass a valid token in Authorization HTTP header using Bearer schema
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
OrgMembership:
type: object
properties:
joined:
type: string
format: date-time
User:
required:
- email
Expand Down Expand Up @@ -859,6 +951,10 @@ components:
email:
type: string
format: email
orgMemberships:
type: object
additionalProperties:
$ref: '#/components/schemas/OrgMembership'
CreateUserRequest:
required:
- email
Expand Down Expand Up @@ -1010,7 +1106,7 @@ components:
type: string
enum:
- active
AddOrgMemberRequest:
AddUserToOrgRequest:
required:
- email
type: object
Expand Down Expand Up @@ -1065,6 +1161,9 @@ components:
minLength: 1
type: string
UpdateUserRequest:
required:
- email
- password
type: object
properties:
email:
Expand Down
Loading

0 comments on commit 544039f

Please sign in to comment.