Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[A0-CLI 17] feat: actions test #28

Merged
merged 11 commits into from
Jan 26, 2021
Merged

[A0-CLI 17] feat: actions test #28

merged 11 commits into from
Jan 26, 2021

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": "[email protected]",
        "emailVerified": true,
        "id": "auth0|5f7c8ec7c33c6c004bbafe82",
        "identities": [
          {
            "connection": "Username-Password-Authentication",
            "isSocial": false,
            "provider": "auth0",
            "userId": "5f7c8ec7c33c6c004bbafe82"
          }
        ],
        "name": "[email protected]",
        "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
internal/cli/actions.go Outdated Show resolved Hide resolved
internal/cli/actions.go Outdated Show resolved Hide resolved
internal/cli/actions.go Outdated Show resolved Hide resolved
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.

2 participants