Thanks to visit codestin.com
Credit goes to github.com

Skip to content

New actions not exposed on Auth0 class #292

@jrzerr

Description

@jrzerr

Describe the problem

Actions was added in 3.18 but it is not exposed on the Auth0 class so you can't use it in the standard way where you would do:

from auth0.v3.management import Auth0
tenant_domain = ""
mgmt_api_token = ""
auth0 = Auth0(tenant_domain, mgmt_api_token)
action = auth0.actions.create_action(
    {
        "name": "TEST",
        "supported_triggers": [
            {
                "id": "post-login",
                "version": "v2"
            }
        ],
        "code": "exports.onExecutePostLogin = async (event, api) => { };",
        "runtime": "node16"
    }
)

you get an error:

AttributeError: 'Auth0' object has no attribute actions.

What was the expected behavior?

auth0.actions would be the method to access the management api for actions

Reproduction

from auth0.v3.management import Auth0
tenant_domain = ""
mgmt_api_token = ""
auth0 = Auth0(tenant_domain, mgmt_api_token)
action = auth0.actions.create_action(
    {
        "name": "TEST",
        "supported_triggers": [
            {
                "id": "post-login",
                "version": "v2"
            }
        ],
        "code": "exports.onExecutePostLogin = async (event, api) => { };",
        "runtime": "node16"
    }
)

you get an error:

AttributeError: 'Auth0' object has no attribute actions.

Environment

  • Version of this library used: 3.18.0
  • Which framework are you using, if applicable:
  • Other modules/plugins/libraries that might be involved:
  • Any other relevant information you think would be useful:

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for customerThis issue is waiting for a response from the issue or PR author

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions