Skip to content

Conversation

@turcottedanny
Copy link
Contributor

@turcottedanny turcottedanny commented Jan 25, 2021

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Add the ability to test an action (draft version by default)

References

https://auth0team.atlassian.net/browse/A0CLI-17

Testing

payload.json for post-login

{
    "event": {
      "accessToken": {
        "customClaims": {},
        "scope": []
      },
      "actor": {
        "body": {},
        "hostname": "example.auth0.com",
        "ip": "13.33.86.47",
        "query": {
          "protocol": "oauth2",
          "client_id": "gmOWNgklfRm4tyl5YYnl3JDSJy19h1bR",
          "response_type": "code",
          "connection": "Username-Password-Authentication",
          "prompt": "login",
          "scope": "openid profile",
          "redirect_uri": "https://example/tester/callback?connection=Username-Password-Authentication"
        }
      },
      "authentication": {
        "methods": [
          {
            "name": "pwd",
            "timestamp": 1602097198594
          }
        ]
      },
      "client": {
        "id": "gmOWNgklfRm4tyl5YYnl3JDSJy19h1bR",
        "metadata": {},
        "name": "All Applications"
      },
      "connection": {
        "id": "con_fpe5kj482KO1eOzQ",
        "name": "Username-Password-Authentication",
        "strategy": "auth0"
      },
      "idToken": {
        "customClaims": {},
        "scope": []
      },
      "protocol": "oidc-basic-profile",
      "stats": {
        "loginsCount": 62
      },
      "tenant": {
        "id": "example"
      },
      "user": {
        "appMetadata": {},
        "createdAt": "2021-01-25T17:35:31.811Z",
        "email": "j+smith@example.com",
        "emailVerified": true,
        "id": "auth0|5f7c8ec7c33c6c004bbafe82",
        "identities": [
          {
            "connection": "Username-Password-Authentication",
            "isSocial": false,
            "provider": "auth0",
            "userId": "5f7c8ec7c33c6c004bbafe82"
          }
        ],
        "name": "j+smith@example.com",
        "nickname": "j+smith",
        "picture": "http://www.gravatar.com/avatar/?d=identicon",
        "updatedAt": "2021-01-25T17:35:31.811Z",
        "userMetadata": {}
      }
    }
  }

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@turcottedanny
Copy link
Contributor Author

image

@turcottedanny turcottedanny marked this pull request as ready for review January 26, 2021 02:55
Copy link
Contributor

@paddycarey paddycarey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small comments, but looks good!

It could be nice for a future iteration to allow passing the payload in via stdin. Allow piping a payload around and make it easier to script.

@turcottedanny
Copy link
Contributor Author

@paddycarey Thanks for the review! I've applied your comments.

Using stdin would be nice! I'll look into this on another PR more towards the end of the hackathon.

@turcottedanny turcottedanny merged commit 521a47a into main Jan 26, 2021
@turcottedanny turcottedanny deleted the A0CLI-17-test-action branch January 26, 2021 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants