read_test_signin_code #

View this page as Markdown

On this page

Generated automatically from the published contract sources.

A script calls this action over HTTPS at POST https://tzcloud.turnzero.ai/v1/read_test_signin_code, with a bearer credential and the action's payload as the JSON body. It also accepts GET. An MCP connection lists this action as the tool tzcloud_read_test_signin_code.

OAuth access tokens and minted tokens, including the turnzero command's computer token, are bearer credentials. The action determines which kinds, scopes and grants it accepts (Sign-in, sessions, and tokens).

Build metadata: Registered in this build. Registration describes the default dispatcher in this build. It does not guarantee that a caller has the required credential or grant, that a tool is listed for that connection, or that the required service is configured.

Contract description #

Read the unspent sign-in codes for one of your test end users, newest first, instead of a mailbox. First start sign-in for that address at the realm's test sign-in page, returned by add_test_end_users, or its email sign-in page. Without a start, no code is held. Pass binding to select one start. A code lasts ten minutes, allows five attempts and confirms only in the browser that started sign-in. The call works only for your account and application. On production or workforce realms, a minted token needs test_end_users. Your session needs none.

More about this action #

The environment argument is required: pass development or production, the environment whose realm you address. The development realm exists only after create_environment has turned development on.

Under the workforce audience, a minted token reads them on a realm only with the test_end_users grant. The read works while the platform's TEST_END_USERS setting is off. Every read is recorded as an action, and no code is written to any record.

An end_user matching no id or label is refused no_such_end_user. An email reaching no unexpired test end user is refused not_test_end_user, as is a real or expired user. Use the id, label or address returned by add_test_end_users; create the user afresh if expired. While TEST_END_USERS is off, the read still works but no code is held.

Access and action metadata #

{
  "name": "read_test_signin_code",
  "resource": "realm",
  "tier": "observe",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "summary": "Read the unspent emailed sign-in codes held for one test end user of one realm of your account's own application, by `end_user` or `email`, `application` and `environment` both required. They come newest first, each with its issued and expiry instants, its binding hash, and the attempts remaining. Where `binding` gives your own binding hash (base64url of the SHA-256 of the binding cookie's value), you get that one ticket's code alone. Admitted to the account's session, its account-wide token, or a token bounded to that application and to no other credential, `super_admin` widening it to no other account's application. On a production realm, and on a workforce application's realm, it admits the session and a token carrying `test_end_users`, any other minted token refused `test_end_users_not_admitted`. Refused `not_test_end_user` for a user who is not an unexpired test end user of the realm; readable while `TEST_END_USERS` reads `off`, every read one action record, and no code reaching any record.",
  "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "openWorldHint": false,
    "idempotentHint": true
  }
}

MCP catalog entry #

{
  "name": "read_test_signin_code",
  "title": "Read test sign-in code",
  "tier": "observe",
  "summary": "Read the unspent sign-in codes for one of your test end users, newest first, instead of a mailbox. First start sign-in for that address at the realm's test sign-in page, returned by `add_test_end_users`, or its email sign-in page. Without a start, no code is held. Pass `binding` to select one start. A code lasts ten minutes, allows five attempts and confirms only in the browser that started sign-in. The call works only for your account and application. On production or `workforce` realms, a minted token needs `test_end_users`. Your session needs none.",
  "owners": [
    "ACS-L0-21",
    "ACS-L0-20",
    "ACS-L0-12",
    "PLD-L0-40"
  ],
  "scenario": "ACS-L0-21"
}

request #

JSON pointer Description and constraints
"" (root) Type: object
Required fields: ["application","environment"]
Additional properties: false
/properties/application Your account's application id from list_applications, not its name or label.

Type: string
/properties/environment Required. The environment whose realm the call addresses, development or production.

Type: string
Pattern: ^(development|production)$
/properties/end_user Test user id or label from add_test_end_users, or use email, never both; no matching id or label draws no_such_end_user.

Type: string
/properties/email Test user fixture-domain email, lowercased; use it or end_user, never both. Without an unexpired match, refused not_test_end_user.

Type: string
Format: email
/properties/binding Optional: your own binding hash, base64url of the SHA-256 of the binding cookie's value the sign-in start set, selecting that ticket's code alone; leave it out and you get every unspent code, newest first.

Type: string

response #

JSON pointer Description and constraints
"" (root) Type: object
Required fields: ["contract_version","realm","end_user","codes"]
Additional properties: false
/properties/contract_version Required value: 1
/properties/realm The realm identifier: the application id for production, <id>:development for development.

Type: string
/properties/end_user The test end user the codes are held for.

Type: string
/properties/codes The unspent codes the route holds for the user, newest first; empty where none is held, where every code is spent or expired, or where binding matches no held ticket.

Type: array
/properties/codes/items Type: object
Required fields: ["code","issued_at","expires_at","binding","attempts_remaining"]
/properties/codes/items/properties/code The six-digit code you type on the code page.

Type: string
Pattern: ^[0-9]{6}$
/properties/codes/items/properties/issued_at Type: string
/properties/codes/items/properties/expires_at The ticket's expiry, ten minutes after the start.

Type: string
/properties/codes/items/properties/binding The ticket's binding hash, the browser that started the sign-in.

Type: string
/properties/codes/items/properties/attempts_remaining The confirmations the code still admits, five at issue.

Type: integer
Minimum: 0
/properties/detail Type: string

Complete payload contract #

{
  "request": {
    "type": "object",
    "required": [
      "application",
      "environment"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "Your account's application `id` from `list_applications`, not its name or label."
      },
      "environment": {
        "type": "string",
        "pattern": "^(development|production)$",
        "description": "Required. The environment whose realm the call addresses, `development` or `production`."
      },
      "end_user": {
        "type": "string",
        "description": "Test user id or label from `add_test_end_users`, or use `email`, never both; no matching id or label draws `no_such_end_user`."
      },
      "email": {
        "type": "string",
        "format": "email",
        "description": "Test user fixture-domain email, lowercased; use it or `end_user`, never both. Without an unexpired match, refused `not_test_end_user`."
      },
      "binding": {
        "type": "string",
        "description": "Optional: your own binding hash, base64url of the SHA-256 of the binding cookie's value the sign-in start set, selecting that ticket's code alone; leave it out and you get every unspent code, newest first."
      }
    },
    "additionalProperties": false
  },
  "response": {
    "type": "object",
    "required": [
      "contract_version",
      "realm",
      "end_user",
      "codes"
    ],
    "properties": {
      "contract_version": {
        "const": 1
      },
      "realm": {
        "type": "string",
        "description": "The realm identifier: the application id for production, `<id>:development` for development."
      },
      "end_user": {
        "type": "string",
        "description": "The test end user the codes are held for."
      },
      "codes": {
        "type": "array",
        "description": "The unspent codes the route holds for the user, newest first; empty where none is held, where every code is spent or expired, or where `binding` matches no held ticket.",
        "items": {
          "type": "object",
          "required": [
            "code",
            "issued_at",
            "expires_at",
            "binding",
            "attempts_remaining"
          ],
          "properties": {
            "code": {
              "type": "string",
              "pattern": "^[0-9]{6}$",
              "description": "The six-digit code you type on the code page."
            },
            "issued_at": {
              "type": "string"
            },
            "expires_at": {
              "type": "string",
              "description": "The ticket's expiry, ten minutes after the start (ACS-L0-12)."
            },
            "binding": {
              "type": "string",
              "description": "The ticket's binding hash, the browser that started the sign-in."
            },
            "attempts_remaining": {
              "type": "integer",
              "minimum": 0,
              "description": "The confirmations the code still admits, five at issue (ACS-L0-12)."
            }
          }
        }
      },
      "detail": {
        "type": "string"
      }
    },
    "additionalProperties": false
  }
}

Shared contracts #