Skip to content

Commit

Permalink
Fix JSON attribute inconsistencies (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahParks authored Oct 13, 2024
1 parent b9757aa commit c366a2e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 131 deletions.
82 changes: 18 additions & 64 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,62 +190,22 @@ components:
type: string
description: A UUID that uniquely identifies the request.
format: uuid
APIKey:
ServiceAccount:
type: object
properties:
uuid:
type: string
description: The UUID of the service account.
format: uuid
apiKey:
type: string
description: The API key.
Audience:
type: object
properties:
apiKeys:
type: array
description: API keys for this audience.
items:
$ref: '#/components/schemas/APIKey'
description: The API key of the service account.
aud:
type: string
description: The audience of JWTs created for this service account context.
serviceLogo:
type: string
description: The URL of the service account's service logo.
serviceName:
type: string
description: The name of the service account's service.
serviceURL:
type: string
description: The URL of the landing page for the service account's service.
ServiceAccountMeta:
type: object
properties:
description: The audience of the service account.
admin:
type: boolean
description: Whether the service account is an admin.
uuid:
type: string
description: The UUID of the service account.
format: uuid
ServiceAccount:
type: object
properties:
audiences:
type: array
description: The audiences for this service account.
items:
$ref: '#/components/schemas/Audience'
meta:
$ref: '#/components/schemas/ServiceAccountMeta'
JWTClaims:
type: object
properties:
claims:
type: object
properties: {}
description: Any valid JSON object. Do not provide any JSON attributes mentioned
in RFC 7519 section 4.1 as this will cause an error. These are JWT "Registered
Claim Names".
description: Any valid JSON object.
JWTCreateRequest:
required:
- jwtCreateArgs
Expand All @@ -263,7 +223,15 @@ components:
on the server's configuration. The default server configuration is "EdDSA".
The default server options are "EdDSA" and "RS256".
jwtClaims:
$ref: '#/components/schemas/JWTClaims'
type: object
properties:
claims:
type: object
properties: {}
description: Any valid JSON object. Do not provide any JSON attributes
mentioned in RFC 7519 section 4.1 as this will cause an error. These
are JWT "Registered Claim Names".
description: The JWT claims used to create the signed JWT.
jwtLifespanSeconds:
type: integer
description: "The lifespan of the JWT in seconds. The JWT's lifespan starts\
Expand Down Expand Up @@ -319,8 +287,6 @@ components:
$ref: '#/components/schemas/RequestMetadata'
description: The response body for the /jwt/validate endpoint.
LinkCreateArgs:
required:
- redirectURL
type: object
properties:
jwtCreateArgs:
Expand All @@ -334,7 +300,7 @@ components:
type: string
description: "The URL query key in the redirectURL to contain the signed\
\ JWT when the magic link is used. By default, \"jwt\" is used."
redirectURL:
redirectUrl:
type: string
description: The URL to redirect to with the signed JWT when the link is
used.
Expand Down Expand Up @@ -451,18 +417,6 @@ components:
description: The response body from the /email-link/create endpoint.
ServiceAccountCreateArgs:
type: object
properties:
serviceLogo:
type: string
description: The URL of the service account's service's logo.
format: uri
serviceName:
type: string
description: The name of the service account's service.
serviceURL:
type: string
description: The landing page URL for the service account's service.
format: uri
description: Parameters to create a service account.
ServiceAccountCreateRequest:
required:
Expand All @@ -481,7 +435,7 @@ components:
ServiceAccountCreateResponse:
type: object
properties:
serviceAccountCreateResults:
createServiceAccountResults:
$ref: '#/components/schemas/ServiceAccountCreateResults'
requestMetadata:
$ref: '#/components/schemas/RequestMetadata'
Expand Down
85 changes: 18 additions & 67 deletions swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,67 +177,22 @@ definitions:
description: "A UUID that uniquely identifies the request."
format: "uuid"

APIKey:
ServiceAccount:
type: "object"
properties:
uuid:
type: "string"
description: "The UUID of the service account."
format: "uuid"
apiKey:
type: "string"
description: "The API key."

Audience:
type: "object"
properties:
apiKeys:
type: "array"
description: "API keys for this audience."
items:
$ref: "#/definitions/APIKey"
description: "The API key of the service account."
aud:
type: "string"
description: "The audience of JWTs created for this service account context."
serviceLogo:
type: "string"
description: "The URL of the service account's service logo."
serviceName:
type: "string"
description: "The name of the service account's service."
serviceURL:
type: "string"
description: "The URL of the landing page for the service account's service."

ServiceAccountMeta:
type: "object"
properties:
description: "The audience of the service account."
admin:
type: "boolean"
description: "Whether the service account is an admin."
uuid:
type: "string"
description: "The UUID of the service account."
format: "uuid"

ServiceAccount:
type: "object"
properties:
audiences:
type: "array"
description: "The audiences for this service account."
items:
$ref: "#/definitions/Audience"
meta:
$ref: "#/definitions/ServiceAccountMeta"

JWTClaims:
description: "Any valid JSON object."
type: "object"
properties:
claims:
description: 'Any valid JSON object. Do not provide any JSON attributes mentioned in RFC 7519 section 4.1 as
this will cause an error. These are JWT "Registered Claim Names".'
type: "object"
externalDocs:
description: "RFC 7519 section 4.1"
url: "https://tools.ietf.org/html/rfc7519#section-4.1"

JWTCreateRequest:
description: "The request body for the /jwt/create endpoint."
Expand All @@ -258,7 +213,15 @@ definitions:
type: "string"
jwtClaims:
description: "The JWT claims used to create the signed JWT."
$ref: "#/definitions/JWTClaims"
type: "object"
properties:
claims:
description: 'Any valid JSON object. Do not provide any JSON attributes mentioned in RFC 7519 section 4.1 as
this will cause an error. These are JWT "Registered Claim Names".'
type: "object"
externalDocs:
description: "RFC 7519 section 4.1"
url: "https://tools.ietf.org/html/rfc7519#section-4.1"
jwtLifespanSeconds:
description: "The lifespan of the JWT in seconds. The JWT's lifespan starts after the magic link has been
visited and the JWT is signed. It defaults to 5 minutes. The minimum value is 5 and the maximum value is
Expand Down Expand Up @@ -337,7 +300,7 @@ definitions:
description: 'The URL query key in the redirectURL to contain the signed JWT when the magic link is used. By
default, "jwt" is used.'
type: "string"
redirectURL:
redirectUrl:
description: "The URL to redirect to with the signed JWT when the link is used."
type: "string"
required:
Expand Down Expand Up @@ -459,18 +422,6 @@ definitions:
ServiceAccountCreateArgs:
description: "Parameters to create a service account."
type: "object"
properties:
serviceLogo:
description: "The URL of the service account's service's logo."
type: "string"
format: "uri"
serviceName:
description: "The name of the service account's service."
type: "string"
serviceURL:
description: "The landing page URL for the service account's service."
type: "string"
format: "uri"

ServiceAccountCreateRequest:
description: "The request body for the /admin/service-account/create endpoint."
Expand All @@ -493,7 +444,7 @@ definitions:
description: "The response body for the /admin/service-account/create endpoint."
type: "object"
properties:
serviceAccountCreateResults:
createServiceAccountResults:
$ref: "#/definitions/ServiceAccountCreateResults"
requestMetadata:
$ref: "#/definitions/RequestMetadata"
Expand Down

0 comments on commit c366a2e

Please sign in to comment.