Skip to content

Commit 8ca91f3

Browse files
authored
Merge pull request #656 from bbiggerr/add/profile/security-questions
Add Security Questions endpoints
2 parents bb45e5f + c6b253b commit 8ca91f3

File tree

1 file changed

+158
-5
lines changed

1 file changed

+158
-5
lines changed

openapi.yaml

Lines changed: 158 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16730,12 +16730,12 @@ paths:
1673016730
tags:
1673116731
- Profile
1673216732
summary: Two Factor Secret Create
16733-
description: >
16734-
Generates a Two Factor secret for your User. TFA will
16735-
not be enabled until you have successfully confirmed the code you
16736-
were given with [tfa-enable-confirm](/docs/api/profile/#two-factor-secret-create) (see below).
16737-
Once enabled, logins from untrusted computers will be required to provide
16733+
description: |
16734+
Generates a Two Factor secret for your User. To enable TFA for your User, enter the secret obtained from this command with the **Two Factor Authentication Confirm/Enable** ([POST /profile/tfa-enable-confirm](/docs/api/profile/#two-factor-authentication-confirmenable)) command.
16735+
Once enabled, logins from untrusted computers are required to provide
1673816736
a TFA code before they are successful.
16737+
16738+
**Note**: Before you can enable TFA, security questions must be answered for your User by accessing the **Security Questions Answer** ([POST /profile/security-questions](/docs/api/profile/#security-questions-answer)) command.
1673916739
operationId: tfaEnable
1674016740
x-linode-cli-action: tfa-enable
1674116741
security:
@@ -17256,6 +17256,107 @@ paths:
1725617256
- lang: CLI
1725717257
source: >
1725817258
linode-cli profile device-revoke 123
17259+
/profile/security-questions:
17260+
x-linode-cli-command: security-questions
17261+
get:
17262+
x-linode-grant: read_only
17263+
servers:
17264+
- url: https://api.linode.com/v4
17265+
tags:
17266+
- Profile
17267+
summary: Security Questions List
17268+
description: >
17269+
Returns a collection of security questions and their responses, if any, for your User Profile.
17270+
operationId: getSecurityQuestions
17271+
x-linode-cli-action: list
17272+
security:
17273+
- personalAccessToken: []
17274+
- oauth:
17275+
- account:read_only
17276+
responses:
17277+
'200':
17278+
description: Returns a list of security questions.
17279+
content:
17280+
application/json:
17281+
x-linode-cli-nested-list: security_questions
17282+
x-linode-cli-use-schema:
17283+
type: object
17284+
properties:
17285+
security_questions.id:
17286+
x-linode-cli-display: 1
17287+
security_questions.question:
17288+
x-linode-cli-display: 2
17289+
security_questions.response:
17290+
x-linode-cli-display: 3
17291+
schema:
17292+
$ref: '#/components/schemas/SecurityQuestionsGet'
17293+
default:
17294+
$ref: '#/components/responses/ErrorResponse'
17295+
x-code-samples:
17296+
- lang: Shell
17297+
source: >
17298+
curl -H "Content-Type: application/json" \
17299+
-H "Authorization: Bearer $TOKEN" \
17300+
https://api.linode.com/v4/profile/security-questions
17301+
- lang: CLI
17302+
source: >
17303+
linode-cli security-questions list
17304+
post:
17305+
tags:
17306+
- Profile
17307+
summary: Security Questions Answer
17308+
description: |
17309+
Adds security question responses for your User.
17310+
17311+
Requires exactly three unique questions.
17312+
17313+
Previous responses are overwritten if answered or reset to `null` if unanswered.
17314+
17315+
**Note**: Security questions must be answered for your User prior to accessing the **Two Factor Secret Create** ([POST /profile/tfa-enable](/docs/api/profile/#two-factor-secret-create)) command.
17316+
operationId: postSecurityQuestions
17317+
x-linode-cli-action: answer
17318+
x-linode-cli-skip: true
17319+
security:
17320+
- personalAccessToken: []
17321+
- oauth:
17322+
- account:read_write
17323+
requestBody:
17324+
description: Answer Security Questions
17325+
content:
17326+
application/json:
17327+
schema:
17328+
$ref: '#/components/schemas/SecurityQuestionsPost'
17329+
responses:
17330+
'200':
17331+
description: Security Questions answered successfully.
17332+
content:
17333+
application/json:
17334+
schema:
17335+
$ref: '#/components/schemas/SecurityQuestionsPost'
17336+
default:
17337+
$ref: '#/components/responses/ErrorResponse'
17338+
x-code-samples:
17339+
- lang: Shell
17340+
source: >
17341+
curl -H "Content-Type: application/json" \
17342+
-H "Authorization: Bearer $TOKEN" \
17343+
-X POST -d '{
17344+
"security_questions": [
17345+
{
17346+
"question_id": 1,
17347+
"response": "secret answer 1"
17348+
},
17349+
{
17350+
"question_id": 2,
17351+
"response": "secret answer 2"
17352+
},
17353+
{
17354+
"question_id": 11,
17355+
"response": "secret answer 3"
17356+
}
17357+
]
17358+
}' \
17359+
https://api.linode.com/v4/profile/security-questions
1725917360
/profile/sshkeys:
1726017361
x-linode-cli-command: sshkeys
1726117362
get:
@@ -25992,6 +26093,58 @@ components:
2599226093
The last IP Address to successfully authenticate with this TrustedDevice.
2599326094
example: 12.34.56.78
2599426095
readOnly: true
26096+
SecurityQuestion:
26097+
type: object
26098+
description: Single security question and response object.
26099+
properties:
26100+
id:
26101+
type: integer
26102+
description: The ID representing the security question.
26103+
example: 1
26104+
question:
26105+
type: string
26106+
readOnly: true
26107+
description: The security question.
26108+
example: "In what city were you born?"
26109+
response:
26110+
type: string
26111+
minLength: 3
26112+
maxLength: 17
26113+
description: |
26114+
The security question response.
26115+
example: "Gotham City"
26116+
SecurityQuestionsGet:
26117+
type: object
26118+
description: Security questions and responses object for GET operation.
26119+
properties:
26120+
security_questions:
26121+
type: array
26122+
items:
26123+
type: object
26124+
description: Single security question and response object for GET operation.
26125+
properties:
26126+
id:
26127+
$ref: '#/components/schemas/SecurityQuestion/properties/id'
26128+
question:
26129+
$ref: '#/components/schemas/SecurityQuestion/properties/question'
26130+
response:
26131+
$ref: '#/components/schemas/SecurityQuestion/properties/response'
26132+
SecurityQuestionsPost:
26133+
type: object
26134+
description: Security questions and responses object for POST operation.
26135+
properties:
26136+
security_questions:
26137+
type: array
26138+
items:
26139+
type: object
26140+
description: Single security question and response object for POST operation.
26141+
properties:
26142+
question_id:
26143+
$ref: '#/components/schemas/SecurityQuestion/properties/id'
26144+
response:
26145+
$ref: '#/components/schemas/SecurityQuestion/properties/response'
26146+
security_question:
26147+
$ref: '#/components/schemas/SecurityQuestion/properties/question'
2599526148
ServiceTransfer:
2599626149
type: object
2599726150
description: >

0 commit comments

Comments
 (0)