Skip to content

Commit

Permalink
prepare 3.4.0 release (#58)
Browse files Browse the repository at this point in the history
* change name to 'offset' and type to 'number' (#143)

* Remove broken dependency from prepare.sh (#144)

* Add variation ID to flag response (#145)

* Fix expiriation date type bug (#146)

* Change all int64 values from number to integer (#147)

* Use python3 in release script (#148)

* Fix description of "archived" in flag query (#150)

Setting "archived" excludes all non-archived flags.  It does not include them alongside non-archived flags.

* Access tokens spec (#152)

* access tokens spec

* fix

* more fixes

* add tags

* update example for json patch to something more generic for all resources

* Update definitions.yaml

Co-authored-by: Isabelle Miller <imiller@launchdarkly.com>
Co-authored-by: Henry Barrow <hbarrow@launchdarkly.com>
Co-authored-by: Andrew Shannon Brown <ashanbrown@users.noreply.github.com>
Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>
  • Loading branch information
5 people authored Aug 12, 2020
1 parent 15116f9 commit dbf08ba
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 2 deletions.
67 changes: 66 additions & 1 deletion spec/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,10 @@ PatchOperation:
example: replace
path:
type: string
example: "/on"
example: "/name"
value:
type: object
example: "My resource name"
required:
- op
- path
Expand Down Expand Up @@ -1333,3 +1334,67 @@ FlagListItem:
$ref: "#/definitions/Links"
_site:
$ref: "#/definitions/Site"
Tokens:
type: object
properties:
_links:
$ref: "#/definitions/Links"
items:
type: array
items:
$ref: "#/definitions/Token"
Token:
type: object
properties:
_links:
$ref: "#/definitions/Links"
_id:
$ref: "#/definitions/Id"
ownerId:
$ref: "#/definitions/Id"
memberId:
$ref: "#/definitions/Id"
_member:
$ref: "#/definitions/Member"
creationDate:
type: integer
format: int64
description: A unix epoch time in milliseconds specifying the creation time of this access token.
example: 1443652232590
lastModified:
type: integer
format: int64
example: 1469326565348
description: A unix epoch time in milliseconds specifying the last time this access token was modified.
lastUsed:
type: integer
format: int64
example: 1469326565348
description: A unix epoch time in milliseconds specifying the last time this access token was used to authorize access to the LaunchDarkly REST API.
token:
type: string
example: "3243"
description: The last 4 digits of the unique secret key for this access token. If creating or resetting the token, this will be the full token secret.
name:
type: string
description: A human-friendly name for the access token
example: "My access token"
role:
type: string
description: The name of a built-in role for the token
example: "writer"
customRoleIds:
type: array
items:
type: string
description: A list of custom role IDs to use as access limits for the access token
inlineRole:
type: array
items:
$ref: "#/definitions/Statement"
serviceToken:
type: boolean
description: "Whether the token will be a service token https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens"
defaultApiVersion:
type: integer
description: The default API version for this token
53 changes: 52 additions & 1 deletion spec/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ ArchivedQuery:
name: archived
in: query
required: false
description: When set to 1, archived flags will be included in the list of flags returned. By default, archived flags are not included in the list of flags.
description: When set to 1, only archived flags will be included in the list of flags returned. By default, archived flags are not included in the list of flags.
type: boolean
LimitQuery:
name: limit
Expand Down Expand Up @@ -519,3 +519,54 @@ EvaluationFlagKey:
description: The key of the flag we want metrics for.
type: string
# example: ''
TokensPostRequest:
name: tokenBody
in: body
required: true
description: Create a new access token.
schema:
type: object
properties:
name:
type: string
description: A human-friendly name for the access token
example: "My access token"
role:
type: string
description: The name of a built-in role for the token
example: "writer"
customRoleIds:
type: array
items:
type: string
example: []
description: A list of custom role IDs to use as access limits for the access token
inlineRole:
type: array
items:
$ref: "#/definitions/Statement"
serviceToken:
type: boolean
description: "Whether the token will be a service token https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens"
defaultApiVersion:
type: integer
description: The default API version for this token
TokenId:
name: tokenId
in: path
required: true
description: The access token ID.
type: string
TokenShowAllQuery:
name: showAll
in: query
required: false
description: 'If set to true, and the authentication access token has the "Admin" role, personal access tokens for all members will be retrieved.'
type: boolean
TokenExpiry:
name: expiry
in: query
required: false
type: integer
format: int64
description: An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately.
6 changes: 6 additions & 0 deletions spec/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,11 @@
$ref: ./paths/cmetrics.yaml#/Event
/usage/evaluations/{envId}/{flagKey}:
$ref: ./paths/cmetrics.yaml#/Evaluations
/tokens:
$ref: ./paths/tokens.yaml#/Tokens
/tokens/{tokenId}:
$ref: ./paths/tokens.yaml#/Token
/tokens/{tokenId}/reset:
$ref: ./paths/tokens.yaml#/Reset
/:
$ref: ./paths/root.yaml#/Root
97 changes: 97 additions & 0 deletions spec/paths/tokens.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Tokens:
get:
summary: Returns a list of tokens in the account.
operationId: getTokens
parameters:
- $ref: "#/parameters/TokenShowAllQuery"
responses:
"200":
description: Tokens response.
schema:
$ref: "#/definitions/Tokens"
"401":
$ref: "#/responses/Standard401"
tags:
- Access tokens
post:
summary: Create a new token.
operationId: postToken
parameters:
- $ref: "#/parameters/TokensPostRequest"
responses:
"201":
description: Token response.
schema:
$ref: "#/definitions/Token"
"400":
$ref: "#/responses/Standard400"
"401":
$ref: "#/responses/Standard401"
"409":
$ref: "#/responses/Standard409"
tags:
- Access tokens
Token:
get:
summary: Get a single access token by ID.
operationId: getToken
parameters:
- $ref: "#/parameters/TokenId"
responses:
"200":
$ref: "#/responses/Token2xx"
"400":
$ref: "#/responses/Standard400"
"401":
$ref: "#/responses/Standard401"
tags:
- Access tokens
patch:
summary: Modify an access tokenby ID.
operationId: patchToken
parameters:
- $ref: "#/parameters/TokenId"
- $ref: "#/parameters/PatchRequest"
responses:
"200":
$ref: "#/responses/Token2xx"
"400":
$ref: "#/responses/Standard400"
"401":
$ref: "#/responses/Standard401"
"404":
$ref: "#/responses/Standard404"
"409":
$ref: "#/responses/Standard409"
tags:
- Access tokens
delete:
summary: Delete an access token by ID.
operationId: deleteToken
parameters:
- $ref: "#/parameters/TokenId"
responses:
"204":
$ref: "#/responses/Standard204"
"401":
$ref: "#/responses/Standard401"
"404":
$ref: "#/responses/Standard404"
tags:
- Access tokens
Reset:
post:
summary: Reset an access token's secret key with an optional expiry time for the old key.
operationId: resetToken
parameters:
- $ref: "#/parameters/TokenId"
- $ref: "#/parameters/TokenExpiry"
responses:
"200":
$ref: "#/responses/Token2xx"
"400":
$ref: "#/responses/Standard400"
"401":
$ref: "#/responses/Standard401"
tags:
- Access tokens
4 changes: 4 additions & 0 deletions spec/responses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ Destination2xx:
description: Destination response.
schema:
$ref: "#/definitions/Destination"
Token2xx:
description: Token response.
schema:
$ref: "#/definitions/Token"

0 comments on commit dbf08ba

Please sign in to comment.