From e91bc17257bc91f7a15eaf1c3d4ab98d62bccf84 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Wed, 15 Jun 2022 11:28:16 -0400 Subject: [PATCH 01/11] Correct enumeration for update window day of week --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 11cfdc03e..64c722bd9 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -19484,7 +19484,7 @@ components: type: integer minimum: 1 maximum: 7 - description: The day to perform maintenance. 1=Monday, 2=Tuesday, etc. + description: The day to perform maintenance. 1=Sunday, 2=Monday, etc. example: 1 week_of_month: type: integer From 4d83edb1a153b094a2f81134aabf634e001460ab Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 17 Jun 2022 11:19:17 -0400 Subject: [PATCH 02/11] Add Phone Number Endpoints --- openapi.yaml | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 160 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 11cfdc03e..1f1c72575 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2631,7 +2631,7 @@ paths: email address. Linode Managed can monitor any service or software stack reachable over TCP or HTTP. See our [Linode Managed guide](/docs/platform/linode-managed/) to learn more. - operationId: enableAccountManged + operationId: enableAccountManaged x-linode-cli-action: enable-managed security: - personalAccessToken: [] @@ -17463,6 +17463,165 @@ paths: - lang: CLI source: > linode-cli sshkey delete 42 + /profile/phone-number: + x-linode-cli-command: profile + delete: + x-linode-grant: read_write + tags: + - Profile + summary: Phone Number Delete + description: | + Delete the verified phone number for the User making this request. + + Use this command to opt out of SMS messages for the requesting User after a phone number has been verified with the **Phone Number Verify** ([POST /profile/phone-number/verify](/docs/api/profile/#phone-number-verify)) command. + operationId: deleteProfilePhone + x-linode-cli-command: phone-delete + security: + - personalAccessToken: [] + - oauth: + - account:read_write + responses: + '200': + description: > + Phone number deletion request successful. + content: + application/json: + schema: + type: object + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Content-Type: application/json" \ + -H "Authorization: Bearer $TOKEN" \ + -X DELETE \ + https://api.linode.com/v4/profile/phone-number + - lang: CLI + source: > + linode-cli profile phone-delete + post: + x-linode-grant: read_write + tags: + - Profile + summary: Phone Number Verification Code Send + description: | + Send a one-time verification code via SMS message to the submitted phone number. Providing your phone number helps ensure you can securely access your Account in case other ways to connect are lost. Your phone number is only used to verify your identity by sending an SMS message. Standard carrier messaging fees may apply. + + * By accessing this command you are opting in to receive SMS messages. You can opt out of SMS messages by using the **Phone Number Delete** ([DELETE /profile/phone-number](/docs/api/profile/#phone-number-delete)) command after your phone number is verified. + + * Verification codes are valid for 10 minutes after they are sent. + + * Subsequent requests made prior to code expiration result in sending the same code. + + Once a verification code is received, verify your phone number with the **Phone Number Verify** ([POST /profile/phone-number/verify](/docs/api/profile/#phone-number-verify)) command. + operationId: sendProfilePhoneVerificationCode + x-linode-cli-command: phone-code-send + security: + - personalAccessToken: [] + - oauth: + - account:read_write + requestBody: + description: Enter a phone number and country code for verification. + content: + application/json: + schema: + required: + - iso_code + - phone_number + type: object + properties: + iso_code: + type: string + description: The two-letter ISO 3166 country code associated with the phone number. + example: US + phone_number: + type: string + description: A valid phone number. + format: phone + example: 555-555-5555 + responses: + '200': + description: > + Phone number verification code request successful. + content: + application/json: + schema: + type: object + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Content-Type: application/json" \ + -H "Authorization: Bearer $TOKEN" \ + -X POST -d '{ + "iso_code": "US", + "phone_number": "555-555-5555" + }' \ + https://api.linode.com/v4/profile/phone-number + - lang: CLI + source: > + linode-cli profile phone-code-send \ + --iso-code US \ + --phone-number 555-555-5555 + /profile/phone-number/verify: + x-linode-cli-command: profile + post: + x-linode-grant: read_write + tags: + - Profile + summary: Phone Number Verify + description: | + Verify a phone number by confirming the one-time code received via SMS message after accessing the **Phone Verification Code Send** ([POST /profile/phone-number](/docs/api/profile/#phone-number-verification-code-send)) command. + + * Verification codes are valid for 10 minutes after they are sent. + + * Only the same User that made the verification code request can use that code with this command. + + Once completed, the verified phone number is assigned to the User making the request. To change the verified phone number for a User, first use the **Phone Number Delete** ([DELETE /profile/phone-number](/docs/api/profile/#phone-number-delete)) command, then begin the verification process again with the **Phone Verification Code Send** ([POST /profile/phone-number](/docs/api/profile/#phone-number-verification-code-send)) command. + operationId: checkProfilePhoneVerificationCode + x-linode-cli-command: phone-verify + security: + - personalAccessToken: [] + - oauth: + - account:read_write + requestBody: + description: Enter a phone verification code for confirmation. + content: + application/json: + schema: + required: + - otp_code + type: object + properties: + otp_code: + type: string + description: The one-time, six-digit code received via SMS message after accessing the **Phone Verification Code Send** ([POST /profile/phone-number](/docs/api/profile/#phone-number-verification-code-send)) command. + example: "US" + responses: + '200': + description: > + Phone number verification successful. + content: + application/json: + schema: + type: object + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Content-Type: application/json" \ + -H "Authorization: Bearer $TOKEN" \ + -X POST -d '{ + "otp_code": "123456" + }' \ + https://api.linode.com/v4/profile/phone-number/verify + - lang: CLI + source: > + linode-cli profile phone-verify \ + --otp_code 123456 /profile/preferences: x-linode-cli-command: profile get: From 1e7b03fff5ab2871cfda8fa84e4e9c4e1a105b76 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 23 Jun 2022 13:46:04 -0400 Subject: [PATCH 03/11] Update operationId's --- openapi.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 1f1c72575..60f47f354 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -17474,7 +17474,7 @@ paths: Delete the verified phone number for the User making this request. Use this command to opt out of SMS messages for the requesting User after a phone number has been verified with the **Phone Number Verify** ([POST /profile/phone-number/verify](/docs/api/profile/#phone-number-verify)) command. - operationId: deleteProfilePhone + operationId: deleteProfilePhoneNumber x-linode-cli-command: phone-delete security: - personalAccessToken: [] @@ -17515,7 +17515,7 @@ paths: * Subsequent requests made prior to code expiration result in sending the same code. Once a verification code is received, verify your phone number with the **Phone Number Verify** ([POST /profile/phone-number/verify](/docs/api/profile/#phone-number-verify)) command. - operationId: sendProfilePhoneVerificationCode + operationId: postProfilePhoneNumber x-linode-cli-command: phone-code-send security: - personalAccessToken: [] @@ -17580,7 +17580,7 @@ paths: * Only the same User that made the verification code request can use that code with this command. Once completed, the verified phone number is assigned to the User making the request. To change the verified phone number for a User, first use the **Phone Number Delete** ([DELETE /profile/phone-number](/docs/api/profile/#phone-number-delete)) command, then begin the verification process again with the **Phone Verification Code Send** ([POST /profile/phone-number](/docs/api/profile/#phone-number-verification-code-send)) command. - operationId: checkProfilePhoneVerificationCode + operationId: postProfilePhoneNumberVerify x-linode-cli-command: phone-verify security: - personalAccessToken: [] From adcc33257bf6b08e3623520d6725eb14cbb44d30 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 23 Jun 2022 13:49:05 -0400 Subject: [PATCH 04/11] Update cli commands --- openapi.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 60f47f354..6034d6179 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -17464,7 +17464,7 @@ paths: source: > linode-cli sshkey delete 42 /profile/phone-number: - x-linode-cli-command: profile + x-linode-cli-command: phone delete: x-linode-grant: read_write tags: @@ -17475,7 +17475,7 @@ paths: Use this command to opt out of SMS messages for the requesting User after a phone number has been verified with the **Phone Number Verify** ([POST /profile/phone-number/verify](/docs/api/profile/#phone-number-verify)) command. operationId: deleteProfilePhoneNumber - x-linode-cli-command: phone-delete + x-linode-cli-command: delete security: - personalAccessToken: [] - oauth: @@ -17499,7 +17499,7 @@ paths: https://api.linode.com/v4/profile/phone-number - lang: CLI source: > - linode-cli profile phone-delete + linode-cli phone delete post: x-linode-grant: read_write tags: @@ -17516,7 +17516,7 @@ paths: Once a verification code is received, verify your phone number with the **Phone Number Verify** ([POST /profile/phone-number/verify](/docs/api/profile/#phone-number-verify)) command. operationId: postProfilePhoneNumber - x-linode-cli-command: phone-code-send + x-linode-cli-command: sms-code-send security: - personalAccessToken: [] - oauth: @@ -17562,11 +17562,11 @@ paths: https://api.linode.com/v4/profile/phone-number - lang: CLI source: > - linode-cli profile phone-code-send \ + linode-cli phone sms-code-send \ --iso-code US \ --phone-number 555-555-5555 /profile/phone-number/verify: - x-linode-cli-command: profile + x-linode-cli-command: phone post: x-linode-grant: read_write tags: @@ -17581,7 +17581,7 @@ paths: Once completed, the verified phone number is assigned to the User making the request. To change the verified phone number for a User, first use the **Phone Number Delete** ([DELETE /profile/phone-number](/docs/api/profile/#phone-number-delete)) command, then begin the verification process again with the **Phone Verification Code Send** ([POST /profile/phone-number](/docs/api/profile/#phone-number-verification-code-send)) command. operationId: postProfilePhoneNumberVerify - x-linode-cli-command: phone-verify + x-linode-cli-command: verify security: - personalAccessToken: [] - oauth: @@ -17620,7 +17620,7 @@ paths: https://api.linode.com/v4/profile/phone-number/verify - lang: CLI source: > - linode-cli profile phone-verify \ + linode-cli phone verify \ --otp_code 123456 /profile/preferences: x-linode-cli-command: profile From 2c38f2bd8cb8308e12dad196de62b137087f835a Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 23 Jun 2022 13:02:41 -0400 Subject: [PATCH 05/11] Add Security Questions endpoints --- openapi.yaml | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 11cfdc03e..cb61f7871 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -17256,6 +17256,93 @@ paths: - lang: CLI source: > linode-cli profile device-revoke 123 + /profile/security-questions: + x-linode-cli-command: security-questions + get: + x-linode-grant: read_only + tags: + - Profile + summary: Security Questions List + description: > + Returns a collection of security questions and their responses, if any, for your User Profile. + operationId: getSecurityQuestions + x-linode-cli-action: list + security: + - personalAccessToken: [] + - oauth: + - account:read_only + responses: + '200': + description: Returns a list of security questions. + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestionsGet' + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Content-Type: application/json" \ + -H "Authorization: Bearer $TOKEN" \ + https://api.linode.com/v4/profile/security-questions + - lang: CLI + source: > + linode-cli security-questions list + post: + tags: + - Profile + summary: Security Questions Answer + description: | + Adds security question responses for your User Profile. + + Requires exactly three unique questions. + + Previous responses are overwritten if answered or reset to `null` if unanswered. + operationId: postSecurityQuestions + x-linode-cli-action: answer + x-linode-cli-skip: true + security: + - personalAccessToken: [] + - oauth: + - account:read_write + requestBody: + description: Answer Security Questions + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestionsPost' + responses: + '200': + description: Security Questions answered successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestionsPost' + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Content-Type: application/json" \ + -H "Authorization: Bearer $TOKEN" \ + -X POST -d '{ + "security_questions": [ + { + "question_id": 1, + "response": "Gotham City" + }, + { + "question_id": 2, + "response": "Gotham City" + }, + { + "question_id": 11, + "response": "Gotham City" + } + ] + }' \ + https://api.linode.com/v4/profile/security-questions /profile/sshkeys: x-linode-cli-command: sshkeys get: @@ -25992,6 +26079,63 @@ components: The last IP Address to successfully authenticate with this TrustedDevice. example: 12.34.56.78 readOnly: true + SecurityQuestion: + type: object + description: Single security question and response object. + properties: + id: + type: integer + readOnly: true + description: The ID representing the security question. + example: 1 + question: + type: string + readOnly: true + description: The security question. + example: "In what city were you born?" + question_id: + type: integer + description: The ID representing the security question. + example: 1 + response: + type: string + minLength: 3 + maxLength: 17 + description: | + The security question response. + example: "Gotham City" + SecurityQuestionsGet: + type: object + description: Security questions and responses object for GET operation. + properties: + security_questions: + type: array + items: + type: object + description: Single security question and response object for GET operation. + properties: + id: + $ref: '#/components/schemas/SecurityQuestion/properties/id' + question: + $ref: '#/components/schemas/SecurityQuestion/properties/question' + response: + $ref: '#/components/schemas/SecurityQuestion/properties/response' + SecurityQuestionsPost: + type: object + description: Security questions and responses object for POST operation. + properties: + security_questions: + type: array + items: + type: object + description: Single security question and response object for POST operation. + properties: + question_id: + $ref: '#/components/schemas/SecurityQuestion/properties/question_id' + response: + $ref: '#/components/schemas/SecurityQuestion/properties/response' + security_question: + $ref: '#/components/schemas/SecurityQuestion/properties/question' ServiceTransfer: type: object description: > From 806992dbe7152deadcdd0170c93cca99fce73f38 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 24 Jun 2022 10:49:58 -0400 Subject: [PATCH 06/11] Add TFA security questions requirements --- openapi.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index cb61f7871..10b4d3e08 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -16730,12 +16730,12 @@ paths: tags: - Profile summary: Two Factor Secret Create - description: > - Generates a Two Factor secret for your User. TFA will - not be enabled until you have successfully confirmed the code you - were given with [tfa-enable-confirm](/docs/api/profile/#two-factor-secret-create) (see below). - Once enabled, logins from untrusted computers will be required to provide + description: | + 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. + Once enabled, logins from untrusted computers are required to provide a TFA code before they are successful. + + **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. operationId: tfaEnable x-linode-cli-action: tfa-enable security: @@ -17294,11 +17294,13 @@ paths: - Profile summary: Security Questions Answer description: | - Adds security question responses for your User Profile. + Adds security question responses for your User. Requires exactly three unique questions. Previous responses are overwritten if answered or reset to `null` if unanswered. + + **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. operationId: postSecurityQuestions x-linode-cli-action: answer x-linode-cli-skip: true From 41ebfd6696a069c5720a718bb98d20ac39648798 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 24 Jun 2022 13:08:04 -0400 Subject: [PATCH 07/11] Fix security questions list cli output --- openapi.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 10b4d3e08..f2a38d04e 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -17260,6 +17260,8 @@ paths: x-linode-cli-command: security-questions get: x-linode-grant: read_only + servers: + - url: https://api.linode.com/v4 tags: - Profile summary: Security Questions List @@ -17276,6 +17278,16 @@ paths: description: Returns a list of security questions. content: application/json: + x-linode-cli-nested-list: security_questions + x-linode-cli-use-schema: + type: object + properties: + security_questions.id: + x-linode-cli-display: 1 + security_questions.question: + x-linode-cli-display: 2 + security_questions.response: + x-linode-cli-display: 3 schema: $ref: '#/components/schemas/SecurityQuestionsGet' default: @@ -17332,15 +17344,15 @@ paths: "security_questions": [ { "question_id": 1, - "response": "Gotham City" + "response": "secret answer 1" }, { "question_id": 2, - "response": "Gotham City" + "response": "secret answer 2" }, { "question_id": 11, - "response": "Gotham City" + "response": "secret answer 3" } ] }' \ From 6a9fdaf35225a3f43e7c5871322f8e09b3ae6a9c Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 24 Jun 2022 13:45:02 -0400 Subject: [PATCH 08/11] Add verified_phone_number to Profile --- openapi.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 6034d6179..b46c7ebcc 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -17494,9 +17494,9 @@ paths: - lang: Shell source: > curl -H "Content-Type: application/json" \ - -H "Authorization: Bearer $TOKEN" \ + -H "Authorization: Bearer $TOKEN_BBIGGER_DEV" \ -X DELETE \ - https://api.linode.com/v4/profile/phone-number + https://api.dev.linode.com/v4/profile/phone-number - lang: CLI source: > linode-cli phone delete @@ -17554,12 +17554,12 @@ paths: - lang: Shell source: > curl -H "Content-Type: application/json" \ - -H "Authorization: Bearer $TOKEN" \ + -H "Authorization: Bearer $TOKEN_BBIGGER_DEV" \ -X POST -d '{ "iso_code": "US", - "phone_number": "555-555-5555" + "phone_number": "267-273-8229" }' \ - https://api.linode.com/v4/profile/phone-number + https://api.dev.linode.com/v4/profile/phone-number - lang: CLI source: > linode-cli phone sms-code-send \ @@ -25217,6 +25217,15 @@ components: as necessary. example: example-user@gmail.com x-linode-cli-display: 2 + verified_phone_number: + type: string + format: phone + readOnly: true + description: | + The phone number verified for this Profile with the **Phone Number Verify** ([POST /profile/phone-number/verify](/docs/api/profile/#phone-number-verify)) command. + + `null` if this Profile has no verified phone number. + example: "+5555555555" timezone: type: string description: > From e6937bd53763ee65c57a15edc2d421c29949958a Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 24 Jun 2022 13:46:16 -0400 Subject: [PATCH 09/11] Remove question_id from SecurityQuestion --- openapi.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index f2a38d04e..81251138e 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -26107,10 +26107,6 @@ components: readOnly: true description: The security question. example: "In what city were you born?" - question_id: - type: integer - description: The ID representing the security question. - example: 1 response: type: string minLength: 3 @@ -26145,7 +26141,7 @@ components: description: Single security question and response object for POST operation. properties: question_id: - $ref: '#/components/schemas/SecurityQuestion/properties/question_id' + $ref: '#/components/schemas/SecurityQuestion/properties/id' response: $ref: '#/components/schemas/SecurityQuestion/properties/response' security_question: From c6b253bcb285ffc7fb6a9d4f068d079124d2b352 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 24 Jun 2022 14:05:28 -0400 Subject: [PATCH 10/11] Remove readOnly for SecurityQuestion.id --- openapi.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 81251138e..116b01b7e 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -26099,7 +26099,6 @@ components: properties: id: type: integer - readOnly: true description: The ID representing the security question. example: 1 question: From 53315e8c016b226567984ae3b2b97fc19d69ef0f Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 24 Jun 2022 15:33:35 -0400 Subject: [PATCH 11/11] Bump version to 4.129.0 --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index e47ce9980..93a64a61d 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.1 info: - version: 4.128.0 + version: 4.129.0 title: Linode API description: |