Skip to content

Commit

Permalink
New API definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Application Services committed May 10, 2024
1 parent 0e62749 commit 83bc6a0
Show file tree
Hide file tree
Showing 124 changed files with 366 additions and 124 deletions.
2 changes: 1 addition & 1 deletion api-customs.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"basePath":"/","info":{"title":"Firefox Accounts Customs Server API Documentation","version":"0.0.1","description":"# Overview\n\n## Request Format\nNone of the requests are authenticated. The customs server is an internal service that is running on the same machine as the service that uses it (currently only the auth server) and is listening on localhost.\n\n## Response Format\nAll successful requests will produce a response with HTTP status code of \"200\" and content-type of \"application/json\". The structure of the response body will depend on the endpoint in question.\n\nFailures due to invalid behavior from the client will produce a response with HTTP status code of \"400\" and content-type of \"application/json\". Failures due to an unexpected situation on the server will produce a response with HTTP status code of \"500\" and content-type of \"application/json\".\n\n## API Endpoints\n- [GET /allowedEmailDomains](#operation/getAllowedemaildomains)\n- [GET /allowedIps](#operation/getAllowedips)\n- [GET /allowedPhoneNumbers](#operation/getAllowedphonenumbers)\n- [GET /limits](#operation/getLimits)\n- [GET /](#operation/get)\n- [POST /blockEmail](#operation/postBlockemail)\n- [POST /blockIp](#operation/postBlockip)\n- [POST /check](#operation/postCheck)\n- [POST /checkAuthenticated](#operation/postCheckauthenticated)\n- [POST /checkIpOnly](#operation/postCheckiponly)\n- [POST /failedLoginAttempt](#operation/postFailedloginattempt)\n- [POST /passwordReset](#operation/postPasswordreset)"},"schemes":["https"],"swagger":"2.0","host":"graphql.accounts.firefox.com","tags":[],"paths":{"/allowedEmailDomains":{"get":{"summary":"/allowedEmailDomains","operationId":"getAllowedemaildomains","responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/allowedIPs":{"get":{"summary":"/allowedIps","operationId":"getAllowedips","responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/allowedPhoneNumbers":{"get":{"summary":"/allowedPhoneNumbers","operationId":"getAllowedphonenumbers","responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/limits":{"get":{"summary":"/limits","operationId":"getLimits","responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/":{"get":{"summary":"/","operationId":"get","responses":{"default":{"schema":{"type":"string"},"description":"Successful"}}}},"/blockEmail":{"post":{"summary":"/blockEmail","operationId":"postBlockemail","description":"*Not currently used by anyone.*\n\nUsed by internal services to temporarily ban requests associated with a given email address. These bans last for `config.limits.blockIntervalSeconds` (default: 24 hours).\n\nREQUEST BODY SCHEMA: `application/json`\n- `email`: the email address associated with the account to ban","responses":{"200":{"description":"Successful requests will produce a \"200 OK\" response with an empty JSON object as the body: {}","schema":{"type":"string"}},"400":{"description":"Failing requests may be caused by the following errors:\n- code MissingParameters: email is required"}},"x-codeSamples":[{"lang":"JavaScript","source":"curl -v \\\n-H \"Content-Type: application/json\" \\\n\"http://localhost:7000/blockEmail\" \\\n-d '{\n \"email\": \"me@example.com\"\n}'"}]}},"/blockIp":{"post":{"summary":"/blockIp","operationId":"postBlockip","description":"*Not currently used by anyone.*\n\nUsed by internal services to temporarily ban requests associated with a given IP address. These bans last for `config.limits.blockIntervalSeconds` (default: 24 hours).\n\nREQUEST BODY SCHEMA: `application/json`\n- `ip`: the IP address to ban","responses":{"200":{"description":"Successful requests will produce a \"200 OK\" response with an empty JSON object as the body: {}","schema":{"type":"string"}},"400":{"description":"Failing requests may be caused by the following errors:\n- code MissingParameters: ip is required"}},"x-codeSamples":[{"lang":"JavaScript","source":"curl -v \\\n-H \"Content-Type: application/json\" \\\n\"http://localhost:7000/blockIp\" \\\n-d '{\n \"ip\": \"192.0.2.1\"\n}'"}]}},"/check":{"post":{"summary":"/check","operationId":"postCheck","description":"Called by the auth server before performing an action on its end to check whether or not the action should be blocked. The endpoint is capable of rate-limiting and blocking requests that involve a variety of [actions](https://github.com/mozilla/fxa/blob/main/packages/fxa-customs-server/lib/actions.js).\n\nREQUEST BODY SCHEMA: `application/json`\n- `email`: the email address associated with the account\n- `ip`: the IP address where the request originates\n- `action`: the name of the action under consideration\n- `headers`: the forwarded headers of the original request\n- `payload`: the payload of the original request\n- `phoneNumber`: optional phone number of request","responses":{"200":{"description":"Successful requests will produce a \"200 OK\" response with the blocking advice in the JSON body:\n\n``` js\n {\n \"block\": true,\n \"retryAfter\": 86396\n }\n```\n\n- `block` indicates whether or not the action should be blocked and `retyAfter` tells the client how long it should wait (in seconds) before attempting this action again.","schema":{"type":"string"}},"400":{"description":"Failing requests may be caused by the following errors:\n- code MissingParameters: email, ip and action are all required"}},"x-codeSamples":[{"lang":"JavaScript","source":"curl -v \\\n-H \"Content-Type: application/json\" \\\n\"http://localhost:7000/check\" \\\n-d '{\n \"email\": \"me@example.com\",\n \"ip\": \"192.0.2.1\",\n \"action\": \"accountCreate\"\n}'"}]}},"/checkAuthenticated":{"post":{"summary":"/checkAuthenticated","operationId":"postCheckauthenticated","description":"Called by the auth server before performing an authenticated action to check whether or not the action should be blocked.\n\nREQUEST BODY SCHEMA: `application/json`\n- `action`: the name of the action under consideration\n- `ip`: the IP address where the request originates\n- `uid`: account identifier","responses":{"200":{"description":"Successful requests will produce a \"200 OK\" response with the blocking advice in the JSON body:\n\n``` js\n {\n \"block\": true,\n \"retryAfter\": 86396\n }\n```\n\n- `block` indicates whether or not the action should be blocked and `retryAfter` tells the client how long it should wait (in seconds) before attempting this action again.","schema":{"type":"string"}},"400":{"description":"Failing requests may be caused by the following errors:\n- code MissingParameters: action, ip and uid are all required"}},"x-codeSamples":[{"lang":"JavaScript","source":"curl -v \\\n-H \"Content-Type: application/json\" \\\n\"http://localhost:7000/checkAuthenticated\" \\\n-d '{\n \"action\": \"devicesNotify\",\n \"ip\": \"192.0.2.1\",\n \"uid\": \"0b65dd742b5a415487f2108cca597044\",\n}'"}]}},"/checkIpOnly":{"post":{"summary":"/checkIpOnly","operationId":"postCheckiponly","description":"Like [/check](#operation/postCheck), called by the auth server before performing an action on its end to check whether or not the action should be blocked based only on the request IP.\n\nREQUEST BODY SCHEMA: `application/json`\n- `email`: (optional) the email address associated with the account\n- `ip`: the IP address where the request originates\n- `action`: the name of the action under consideration","responses":{"200":{"description":"Successful requests will produce a \"200 OK\" response with the blocking advice in the JSON body:\n\n``` js\n {\n \"block\": true,\n \"retryAfter\": 86396\n }\n```\n\n- `block` indicates whether or not the action should be blocked and `retyAfter` tells the client how long it should wait (in seconds) before attempting this action again.","schema":{"type":"string"}},"400":{"description":"Failing requests may be caused by the following errors:\n- code MissingParameters: ip and action are both required"}},"x-codeSamples":[{"lang":"JavaScript","source":"curl -v \\\n-H \"Content-Type: application/json\" \\\n\"http://localhost:7000/checkIpOnly\" \\\n-d '{\n \"ip\": \"192.0.2.1\",\n \"action\": \"accountCreate\"\n}'"}]}},"/failedLoginAttempt":{"post":{"summary":"/failedLoginAttempt","operationId":"postFailedloginattempt","description":"Called by the auth server to signal to the customs server that a failed login attempt has occured.\n\nThis information is stored by the customs server to enforce some of its policies.\n\nREQUEST BODY SCHEMA: `application/json`\n- `email`: the email address associated with the account\n- `ip`: the IP address where the request originates\n- `action`: (optional) the name of the action under consideration","responses":{"200":{"description":"Successful requests will produce a \"200 OK\" response: {}\n\n- `lockout` indicates whether or not the account should be locked out.","schema":{"type":"string"}},"400":{"description":"Failing requests may be caused by the following errors:\n- code MissingParameters: email and ip are both required"}},"x-codeSamples":[{"lang":"JavaScript","source":"curl -v \\\n-H \"Content-Type: application/json\" \\\n\"http://localhost:7000/failedLoginAttempt\" \\\n-d '{\n \"email\": \"me@example.com\",\n \"ip\": \"192.0.2.1\",\n}'"}]}},"/passwordReset":{"post":{"summary":"/passwordReset","operationId":"postPasswordreset","description":"Called by the auth server to signal to the customs server that the password on the account has been successfully reset.\n\nThe customs server uses this information to update its state (expiring bad logins for example).\n\nREQUEST BODY SCHEMA: `application/json`\n- `email`: the email address associated with the account","responses":{"200":{"description":"Successful requests will produce a \"200 OK\" response with an empty JSON object as the body: {}","schema":{"type":"string"}},"400":{"description":"Failing requests may be caused by the following errors:\n- code MissingParameters: email is required"}},"x-codeSamples":[{"lang":"JavaScript","source":"curl -v \\\n-H \"Content-Type: application/json\" \\\n\"http://localhost:7000/passwordReset\" \\\n-d '{\n \"email\": \"me@example.com\",\n}'"}]}}},"definitions":{}}
{"message":"Cannot GET /swagger.json","error":"Not Found","statusCode":404}
2 changes: 1 addition & 1 deletion api-swagger.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/gql-api/directives/deprecated.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down
2 changes: 2 additions & 0 deletions docs/gql-api/directives/include.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down
2 changes: 2 additions & 0 deletions docs/gql-api/directives/skip.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down
2 changes: 2 additions & 0 deletions docs/gql-api/directives/specified-by.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down
2 changes: 1 addition & 1 deletion docs/gql-api/generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Use the docs in the sidebar to find out how to use the schema:
- **Allowed operations**: queries and mutations.
- **Schema-defined types**: scalars, objects, enums, interfaces, unions, and input objects.

<small><i>Generated on 9/7/2023, 8:05:45 AM.</i></small>
<small><i>Generated on 5/10/2024, 8:06:37 AM.</i></small>
6 changes: 4 additions & 2 deletions docs/gql-api/inputs/account-reset-input-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -67,7 +69,7 @@ input AccountResetInputOptions {


### Member of
### Member Of

[`AccountResetInput`](/gql-api/inputs/account-reset-input) <Badge class="secondary" text="input"/>
[`AccountResetInput`](/gql-api/inputs/account-reset-input) <Badge class="badge badge--secondary" text="input"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/account-reset-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -88,7 +90,7 @@ input AccountResetInput {


### Member of
### Member Of

[`accountReset`](/gql-api/mutations/account-reset) <Badge class="secondary" text="mutation"/>
[`accountReset`](/gql-api/mutations/account-reset) <Badge class="badge badge--secondary" text="mutation"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/account-status-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -67,7 +69,7 @@ input AccountStatusInput {


### Member of
### Member Of

[`accountStatus`](/gql-api/queries/account-status) <Badge class="secondary" text="query"/>
[`accountStatus`](/gql-api/queries/account-status) <Badge class="badge badge--secondary" text="query"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/attached-client-disconnect-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -88,7 +90,7 @@ input AttachedClientDisconnectInput {


### Member of
### Member Of

[`attachedClientDisconnect`](/gql-api/mutations/attached-client-disconnect) <Badge class="secondary" text="mutation"/>
[`attachedClientDisconnect`](/gql-api/mutations/attached-client-disconnect) <Badge class="badge badge--secondary" text="mutation"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/basic-mutation-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -60,7 +62,7 @@ input BasicMutationInput {


### Member of
### Member Of

[`resendVerifyCode`](/gql-api/mutations/resend-verify-code) <Badge class="secondary" text="mutation"/>
[`resendVerifyCode`](/gql-api/mutations/resend-verify-code) <Badge class="badge badge--secondary" text="mutation"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/change-recovery-codes-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -60,7 +62,7 @@ input ChangeRecoveryCodesInput {


### Member of
### Member Of

[`changeRecoveryCodes`](/gql-api/mutations/change-recovery-codes) <Badge class="secondary" text="mutation"/>
[`changeRecoveryCodes`](/gql-api/mutations/change-recovery-codes) <Badge class="badge badge--secondary" text="mutation"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/create-password.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -74,7 +76,7 @@ input CreatePassword {


### Member of
### Member Of

[`createPassword`](/gql-api/mutations/create-password) <Badge class="secondary" text="mutation"/>
[`createPassword`](/gql-api/mutations/create-password) <Badge class="badge badge--secondary" text="mutation"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/create-totp-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -67,7 +69,7 @@ input CreateTotpInput {


### Member of
### Member Of

[`createTotp`](/gql-api/mutations/create-totp) <Badge class="secondary" text="mutation"/>
[`createTotp`](/gql-api/mutations/create-totp) <Badge class="badge badge--secondary" text="mutation"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/delete-avatar-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -67,7 +69,7 @@ input DeleteAvatarInput {


### Member of
### Member Of

[`deleteAvatar`](/gql-api/mutations/delete-avatar) <Badge class="secondary" text="mutation"/>
[`deleteAvatar`](/gql-api/mutations/delete-avatar) <Badge class="badge badge--secondary" text="mutation"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/delete-recovery-key-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -60,7 +62,7 @@ input DeleteRecoveryKeyInput {


### Member of
### Member Of

[`deleteRecoveryKey`](/gql-api/mutations/delete-recovery-key) <Badge class="secondary" text="mutation"/>
[`deleteRecoveryKey`](/gql-api/mutations/delete-recovery-key) <Badge class="badge badge--secondary" text="mutation"/>

6 changes: 4 additions & 2 deletions docs/gql-api/inputs/delete-totp-input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ hide_table_of_contents: false
---




export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em', color: 'var(--ifm-color-secondary-darkest)' }}>&nbsp;&nbsp;</span></>

export const SpecifiedBy = (props) => <>Specification<a className="link" style={{ fontSize:'1.5em', paddingLeft:'4px' }} target="_blank" href={props.url} title={'Specified by ' + props.url}>⎘</a></>
Expand Down Expand Up @@ -60,7 +62,7 @@ input DeleteTotpInput {


### Member of
### Member Of

[`deleteTotp`](/gql-api/mutations/delete-totp) <Badge class="secondary" text="mutation"/>
[`deleteTotp`](/gql-api/mutations/delete-totp) <Badge class="badge badge--secondary" text="mutation"/>

Loading

0 comments on commit 83bc6a0

Please sign in to comment.