From 6211e87f8dfe18cd270e613fc74b36af94295918 Mon Sep 17 00:00:00 2001 From: Danny Turcotte Date: Sun, 24 Jan 2021 21:50:52 -0500 Subject: [PATCH 1/6] Boilerplate --- internal/cli/actions.go | 40 ++++++++++++++++++++++++++++++++++++++++ internal/cli/root.go | 1 + 2 files changed, 41 insertions(+) create mode 100644 internal/cli/actions.go diff --git a/internal/cli/actions.go b/internal/cli/actions.go new file mode 100644 index 000000000..7f1e707ae --- /dev/null +++ b/internal/cli/actions.go @@ -0,0 +1,40 @@ +package cli + +import ( + "github.com/spf13/cobra" +) + +func actionsCmd(cli *cli) *cobra.Command { + cmd := &cobra.Command{ + Use: "actions", + Short: "manage resources for actions.", + } + + cmd.SetUsageTemplate(resourceUsageTemplate()) + cmd.AddCommand(listActionsCmd(cli)) + + return cmd +} + +func listActionsCmd(cli *cli) *cobra.Command { + cmd := &cobra.Command{ + Use: "list", + Short: "Lists your existing actions", + Long: `$ auth0 actions list +Lists your existing actions. To create one try: + + $ auth0 actions create +`, + RunE: func(cmd *cobra.Command, args []string) error { + list, err := cli.api.Client.List() + if err != nil { + return err + } + + cli.renderer.ClientList(list.Clients) + return nil + }, + } + + return cmd +} diff --git a/internal/cli/root.go b/internal/cli/root.go index 716b3ba02..2387b0b4f 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -51,6 +51,7 @@ func Execute() { rootCmd.AddCommand(loginCmd(cli)) rootCmd.AddCommand(clientsCmd(cli)) rootCmd.AddCommand(logsCmd(cli)) + rootCmd.AddCommand(actionsCmd(cli)) // TODO(cyx): backport this later on using latest auth0/v5. // rootCmd.AddCommand(actionsCmd(cli)) From 214a2f016eaf8143cb719f3aad50788cb0e6423f Mon Sep 17 00:00:00 2001 From: Danny Turcotte Date: Mon, 25 Jan 2021 10:02:33 -0500 Subject: [PATCH 2/6] wip --- go.mod | 3 + go.sum | 7 +- internal/cli/actions.go | 4 +- internal/display/actions.go | 37 +++++ vendor/gopkg.in/auth0.v5/go.sum | 2 + .../gopkg.in/auth0.v5/management/actions.go | 154 ++++++++++++++++++ .../auth0.v5/management/connection.go | 3 + .../auth0.v5/management/management.go | 3 + vendor/gopkg.in/auth0.v5/management/user.go | 10 +- vendor/gopkg.in/auth0.v5/meta.go | 2 +- vendor/modules.txt | 3 +- 11 files changed, 217 insertions(+), 11 deletions(-) create mode 100644 internal/display/actions.go create mode 100644 vendor/gopkg.in/auth0.v5/management/actions.go diff --git a/go.mod b/go.mod index 4cc9fd448..e983b6a69 100644 --- a/go.mod +++ b/go.mod @@ -18,3 +18,6 @@ require ( gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v2 v2.2.8 // indirect ) + +// replace gopkg.in/auth0.v5 => ../auth0 +replace gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b diff --git a/go.sum b/go.sum index 6b5f67bbc..07b0b7363 100644 --- a/go.sum +++ b/go.sum @@ -59,6 +59,7 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -192,7 +193,9 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -217,6 +220,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b h1:pUBBBpHjHeO4Li8vtUylTAReh/t9899rFULZRiG1xls= +github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -478,8 +483,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/auth0.v5 v5.8.0 h1:JWZV4CGRrWQeztZFuW1LWxgUqet6zLiZelGv470CxzU= -gopkg.in/auth0.v5 v5.8.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/internal/cli/actions.go b/internal/cli/actions.go index 7f1e707ae..e9740c420 100644 --- a/internal/cli/actions.go +++ b/internal/cli/actions.go @@ -26,12 +26,12 @@ Lists your existing actions. To create one try: $ auth0 actions create `, RunE: func(cmd *cobra.Command, args []string) error { - list, err := cli.api.Client.List() + list, err := cli.api.Action.List() if err != nil { return err } - cli.renderer.ClientList(list.Clients) + cli.renderer.ActionList(list.Actions) return nil }, } diff --git a/internal/display/actions.go b/internal/display/actions.go new file mode 100644 index 000000000..02c14da11 --- /dev/null +++ b/internal/display/actions.go @@ -0,0 +1,37 @@ +package display + +import ( + "github.com/auth0/auth0-cli/internal/ansi" + "gopkg.in/auth0.v5" + "gopkg.in/auth0.v5/management" +) + +type actionView struct { + Name string + CreatedAt string +} + +func (v *actionView) AsTableHeader() []string { + return []string{"Name", "CreatedAt"} +} + +func (v *actionView) AsTableRow() []string { + return []string{v.Name, v.CreatedAt} +} + +func (r *Renderer) ActionList(actions []*management.Action) { + r.Heading(ansi.Bold(r.Tenant), "actions\n") + + var res []View + for _, a := range actions { + res = append(res, &actionView{ + Name: auth0.StringValue(a.Name), + CreatedAt: a.CreatedAt.String(), + // Type: auth0.StringValue(a.SupportedTriggers[0]), + // Runtime: auth0.StringValue(a.Runtime), + }) + + } + + r.Results(res) +} diff --git a/vendor/gopkg.in/auth0.v5/go.sum b/vendor/gopkg.in/auth0.v5/go.sum index 5b7160aec..2cebc8dee 100644 --- a/vendor/gopkg.in/auth0.v5/go.sum +++ b/vendor/gopkg.in/auth0.v5/go.sum @@ -363,6 +363,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/auth0.v5 v5.8.0 h1:JWZV4CGRrWQeztZFuW1LWxgUqet6zLiZelGv470CxzU= +gopkg.in/auth0.v5 v5.8.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/gopkg.in/auth0.v5/management/actions.go b/vendor/gopkg.in/auth0.v5/management/actions.go new file mode 100644 index 000000000..e0104671c --- /dev/null +++ b/vendor/gopkg.in/auth0.v5/management/actions.go @@ -0,0 +1,154 @@ +package management + +import ( + "time" +) + +type Action struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + SupportedTriggers []Trigger `json:"supported_triggers,omitempty"` + + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + + // TODO: add required configuration / secrets +} + +type VersionStatus string + +const ( + VersionStatusPending VersionStatus = "pending" + VersionStatusRetrying VersionStatus = "retrying" + VersionStatusBuilding VersionStatus = "building" + VersionStatusPackaged VersionStatus = "packaged" + VersionStatusBuilt VersionStatus = "built" +) + +type TriggerID string + +const ( + PostLogin TriggerID = "post-login" + ClientCredentials TriggerID = "client-credentials" +) + +type ActionVersion struct { + ID string `json:"id,omitempty"` + Action *Action `json:"action,omitempty"` + Code string `json:"code"` + Dependencies []Dependency `json:"dependencies,omitempty"` + Runtime string `json:"runtime,omitempty"` + Status VersionStatus `json:"status,omitempty"` + Number int `json:"number,omitempty"` + + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + + // TODO: maybe add errors? +} + +type Dependency struct { + Name string `json:"name"` + Version string `json:"version"` + RegistryURL string `json:"registry_url"` +} + +type Trigger struct { + ID TriggerID `json:"id"` + Version string `json:"version"` + URL string `json:"url"` +} + +type ActionList struct { + List + Actions []*Action `json:"actions"` +} + +type ActionVersionList struct { + List + Versions []*ActionVersion `json:"versions"` +} + +type Object map[string]interface{} + +type ActionManager struct { + *Management +} + +func (m *ActionManager) Create(a *Action) error { + return m.Request("POST", m.URI("actions", "actions"), a) +} + +func (m *ActionManager) Read(id string) (*Action, error) { + var a Action + err := m.Request("GET", m.URI("actions", "actions", id), &a) + return &a, err +} + +func (m *ActionManager) Update(id string, a *Action) error { + // We'll get a 400 if we try to send the following parameters as part + // of the payload. + a.ID = "" + a.CreatedAt = nil + a.UpdatedAt = nil + return m.Request("PATCH", m.URI("actions", "actions", id), a) +} + +func (m *ActionManager) Delete(id string, opts ...RequestOption) error { + return m.Request("DELETE", m.URI("actions", "actions", id), nil, opts...) +} + +// func WithTriggerID(id TriggerID) RequestOption { +// return func(v url.Values) { +// v.Set("triggerId", string(id)) +// } +// } + +func (m *ActionManager) List(opts ...RequestOption) (c *ActionList, err error) { + err = m.Request("GET", m.URI("actions", "actions"), &c, applyListDefaults(opts)) + return +} + +type ActionVersionManager struct { + *Management +} + +func (m *ActionVersionManager) Create(actionID string, v *ActionVersion) error { + return m.Request("POST", m.URI("actions", "actions", actionID, "versions"), v) +} + +// TODO(cyx): This isn't implemented yet. +func (m *ActionVersionManager) Update(actionID string, v *ActionVersion) error { + return m.Request("PATCH", m.URI("actions", "actions", actionID, "versions", "draft"), v) +} + +func (m *ActionVersionManager) Read(actionID, id string) (*ActionVersion, error) { + var v ActionVersion + err := m.Request("GET", m.URI("actions", "actions", actionID, "versions", id), &v) + return &v, err +} + +func (m *ActionVersionManager) Delete(actionID, id string, opts ...RequestOption) error { + return m.Request("DELETE", m.URI("actions", "actions", actionID, "versions", id), nil, opts...) +} + +func (m *ActionVersionManager) List(actionID string, opts ...RequestOption) (c *ActionVersionList, err error) { + err = m.Request("GET", m.URI("actions", "actions", actionID, "versions"), &c, applyListDefaults(opts)) + return +} + +// TODO(cyx): might call this `activate` instead later. Still fleshing out the +// name. +func (m *ActionVersionManager) Promote(actionID, id string) (*ActionVersion, error) { + var v ActionVersion + err := m.Request("POST", m.URI("actions", "actions", actionID, "versions", id, "promote"), &v) + return &v, err +} + +// TODO(cyx): consider how the `draft` test looks like. Will it just use +// `draft` in place of the ID? +func (m *ActionVersionManager) Test(actionID, id string, payload Object) (Object, error) { + v := Object{"payload": payload} + err := m.Request("POST", m.URI("actions", "actions", actionID, "versions", id, "test"), &v) + return v, err +} diff --git a/vendor/gopkg.in/auth0.v5/management/connection.go b/vendor/gopkg.in/auth0.v5/management/connection.go index ab509be4d..8acd67f6a 100644 --- a/vendor/gopkg.in/auth0.v5/management/connection.go +++ b/vendor/gopkg.in/auth0.v5/management/connection.go @@ -730,6 +730,9 @@ func (m *ConnectionManager) Delete(id string, opts ...RequestOption) (err error) // ReadByName retrieves a connection by its name. This is a helper method when a // connection id is not readily available. func (m *ConnectionManager) ReadByName(name string, opts ...RequestOption) (*Connection, error) { + if name == "" { + return nil, &managementError{400, "Bad Request", "Name cannot be empty"} + } c, err := m.List(append(opts, Parameter("name", name))...) if err != nil { return nil, err diff --git a/vendor/gopkg.in/auth0.v5/management/management.go b/vendor/gopkg.in/auth0.v5/management/management.go index 9fe8f2c0e..77427a39c 100644 --- a/vendor/gopkg.in/auth0.v5/management/management.go +++ b/vendor/gopkg.in/auth0.v5/management/management.go @@ -83,6 +83,9 @@ func WithClient(client *http.Client) ManagementOption { // Management API v2. // type Management struct { + // Action manages Auth0 actions + Action *ActionManager + // Client manages Auth0 Client (also known as Application) resources. Client *ClientManager diff --git a/vendor/gopkg.in/auth0.v5/management/user.go b/vendor/gopkg.in/auth0.v5/management/user.go index 8d870714a..9212f391e 100644 --- a/vendor/gopkg.in/auth0.v5/management/user.go +++ b/vendor/gopkg.in/auth0.v5/management/user.go @@ -161,11 +161,11 @@ type UserIdentityLink struct { } type UserIdentity struct { - Connection *string `json:"connection,omitempty"` - UserID *string `json:"-"` - Provider *string `json:"provider,omitempty"` - IsSocial *bool `json:"isSocial,omitempty"` - AccessToken *string `json:"access_token,omitempty"` + Connection *string `json:"connection,omitempty"` + UserID *string `json:"-"` + Provider *string `json:"provider,omitempty"` + IsSocial *bool `json:"isSocial,omitempty"` + AccessToken *string `json:"access_token,omitempty"` RefreshToken *string `json:"refresh_token,omitempty"` } diff --git a/vendor/gopkg.in/auth0.v5/meta.go b/vendor/gopkg.in/auth0.v5/meta.go index 2d50a0c2e..faa0bb258 100644 --- a/vendor/gopkg.in/auth0.v5/meta.go +++ b/vendor/gopkg.in/auth0.v5/meta.go @@ -2,4 +2,4 @@ package auth0 // Version of this library. This value is generated automatically during the // release process; DO NOT EDIT. -var Version = "5.8.0" +var Version = "latest" diff --git a/vendor/modules.txt b/vendor/modules.txt index ac82e58fc..ce14ca610 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -96,7 +96,7 @@ google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface google.golang.org/protobuf/runtime/protoimpl -# gopkg.in/auth0.v5 v5.8.0 +# gopkg.in/auth0.v5 v5.8.0 => github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b ## explicit gopkg.in/auth0.v5 gopkg.in/auth0.v5/internal/client @@ -107,3 +107,4 @@ gopkg.in/auth0.v5/management # gopkg.in/yaml.v2 v2.2.8 ## explicit gopkg.in/yaml.v2 +# gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b From eb7d326ec427fec246eabf3d47f7ea8d156a8dfa Mon Sep 17 00:00:00 2001 From: Danny Turcotte Date: Mon, 25 Jan 2021 10:10:41 -0500 Subject: [PATCH 3/6] working prototype --- go.mod | 4 +-- .../gopkg.in/auth0.v5/management/actions.go | 26 ++++++++++++++----- .../auth0.v5/management/management.go | 1 + vendor/modules.txt | 4 +-- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index e983b6a69..de57897b2 100644 --- a/go.mod +++ b/go.mod @@ -19,5 +19,5 @@ require ( gopkg.in/yaml.v2 v2.2.8 // indirect ) -// replace gopkg.in/auth0.v5 => ../auth0 -replace gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b +replace gopkg.in/auth0.v5 => ../auth0 +// replace gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b diff --git a/vendor/gopkg.in/auth0.v5/management/actions.go b/vendor/gopkg.in/auth0.v5/management/actions.go index e0104671c..7f21f5095 100644 --- a/vendor/gopkg.in/auth0.v5/management/actions.go +++ b/vendor/gopkg.in/auth0.v5/management/actions.go @@ -1,13 +1,14 @@ package management import ( + "net/http" "time" ) type Action struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - SupportedTriggers []Trigger `json:"supported_triggers,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SupportedTriggers *[]Trigger `json:"supported_triggers,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` @@ -75,6 +76,19 @@ type ActionManager struct { *Management } +func newActionManager(m *Management) *ActionManager { + return &ActionManager{m} +} + +func applyActionsListDefaults(options []RequestOption) RequestOption { + return newRequestOption(func(r *http.Request) { + PerPage(50).apply(r) + for _, option := range options { + option.apply(r) + } + }) +} + func (m *ActionManager) Create(a *Action) error { return m.Request("POST", m.URI("actions", "actions"), a) } @@ -88,7 +102,7 @@ func (m *ActionManager) Read(id string) (*Action, error) { func (m *ActionManager) Update(id string, a *Action) error { // We'll get a 400 if we try to send the following parameters as part // of the payload. - a.ID = "" + a.ID = nil a.CreatedAt = nil a.UpdatedAt = nil return m.Request("PATCH", m.URI("actions", "actions", id), a) @@ -105,7 +119,7 @@ func (m *ActionManager) Delete(id string, opts ...RequestOption) error { // } func (m *ActionManager) List(opts ...RequestOption) (c *ActionList, err error) { - err = m.Request("GET", m.URI("actions", "actions"), &c, applyListDefaults(opts)) + err = m.Request("GET", m.URI("actions", "actions"), &c, applyActionsListDefaults(opts)) return } @@ -133,7 +147,7 @@ func (m *ActionVersionManager) Delete(actionID, id string, opts ...RequestOption } func (m *ActionVersionManager) List(actionID string, opts ...RequestOption) (c *ActionVersionList, err error) { - err = m.Request("GET", m.URI("actions", "actions", actionID, "versions"), &c, applyListDefaults(opts)) + err = m.Request("GET", m.URI("actions", "actions", actionID, "versions"), &c, applyActionsListDefaults(opts)) return } diff --git a/vendor/gopkg.in/auth0.v5/management/management.go b/vendor/gopkg.in/auth0.v5/management/management.go index 77427a39c..ececcf771 100644 --- a/vendor/gopkg.in/auth0.v5/management/management.go +++ b/vendor/gopkg.in/auth0.v5/management/management.go @@ -199,6 +199,7 @@ func New(domain string, options ...ManagementOption) (*Management, error) { client.WithUserAgent(m.userAgent), client.WithRateLimit()) + m.Action = newActionManager(m) m.Client = newClientManager(m) m.ClientGrant = newClientGrantManager(m) m.Connection = newConnectionManager(m) diff --git a/vendor/modules.txt b/vendor/modules.txt index ce14ca610..3777d8895 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -96,7 +96,7 @@ google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface google.golang.org/protobuf/runtime/protoimpl -# gopkg.in/auth0.v5 v5.8.0 => github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b +# gopkg.in/auth0.v5 v5.8.0 => ../auth0 ## explicit gopkg.in/auth0.v5 gopkg.in/auth0.v5/internal/client @@ -107,4 +107,4 @@ gopkg.in/auth0.v5/management # gopkg.in/yaml.v2 v2.2.8 ## explicit gopkg.in/yaml.v2 -# gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b +# gopkg.in/auth0.v5 => ../auth0 From 67450ead6f03170868d9bd1b7675d46bae0b0701 Mon Sep 17 00:00:00 2001 From: Danny Turcotte Date: Mon, 25 Jan 2021 10:35:21 -0500 Subject: [PATCH 4/6] fix go.mod --- go.mod | 4 ++-- go.sum | 6 ++++++ vendor/gopkg.in/auth0.v5/go.mod | 9 +++++---- vendor/modules.txt | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index de57897b2..1f94d9b29 100644 --- a/go.mod +++ b/go.mod @@ -19,5 +19,5 @@ require ( gopkg.in/yaml.v2 v2.2.8 // indirect ) -replace gopkg.in/auth0.v5 => ../auth0 -// replace gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b +// replace gopkg.in/auth0.v5 => ../auth0 +replace gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e diff --git a/go.sum b/go.sum index 07b0b7363..555727149 100644 --- a/go.sum +++ b/go.sum @@ -222,6 +222,10 @@ github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b h1:pUBBBpHjHeO4Li8vtUylTAReh/t9899rFULZRiG1xls= github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E= +github.com/turcottedanny/auth0 v1.3.1-0.20210125152726-ff8b7f037643 h1:G6US6wRA06GlYk6Y8PMP1+A8uD8R8IpPOqUYwrtQtkg= +github.com/turcottedanny/auth0 v1.3.1-0.20210125152726-ff8b7f037643/go.mod h1:8z0Q+5B1XS+jEbp2GPGzIJd7nfJkJ74jZFEixmYfRhQ= +github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e h1:QH3gmHc1gH7Eekz6fDXx+75YRU/fLE3MfnrNHxgwa2o= +github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e/go.mod h1:ykikkGrZZrGKgwbdwA4Lgw5a03Vetq+zORg1v8pCVpY= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -483,6 +487,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/auth0.v5 v5.8.0 h1:JWZV4CGRrWQeztZFuW1LWxgUqet6zLiZelGv470CxzU= +gopkg.in/auth0.v5 v5.8.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/vendor/gopkg.in/auth0.v5/go.mod b/vendor/gopkg.in/auth0.v5/go.mod index 66e0f47db..060ff081b 100644 --- a/vendor/gopkg.in/auth0.v5/go.mod +++ b/vendor/gopkg.in/auth0.v5/go.mod @@ -1,11 +1,12 @@ -module gopkg.in/auth0.v5 +// module gopkg.in/auth0.v5 +module github.com/turcottedanny/auth0 go 1.12 require ( github.com/PuerkitoBio/rehttp v1.0.0 - github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 // indirect - github.com/benbjohnson/clock v1.0.3 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 + gopkg.in/auth0.v5 v5.8.0 ) + +replace gopkg.in/auth0.v5 => ./ diff --git a/vendor/modules.txt b/vendor/modules.txt index 3777d8895..d607f073c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -96,7 +96,7 @@ google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface google.golang.org/protobuf/runtime/protoimpl -# gopkg.in/auth0.v5 v5.8.0 => ../auth0 +# gopkg.in/auth0.v5 v5.8.0 => github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e ## explicit gopkg.in/auth0.v5 gopkg.in/auth0.v5/internal/client @@ -107,4 +107,4 @@ gopkg.in/auth0.v5/management # gopkg.in/yaml.v2 v2.2.8 ## explicit gopkg.in/yaml.v2 -# gopkg.in/auth0.v5 => ../auth0 +# gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e From fdb1a372174a0ac2fb5a1145fdff606e0c8bc499 Mon Sep 17 00:00:00 2001 From: Danny Turcotte Date: Mon, 25 Jan 2021 11:27:19 -0500 Subject: [PATCH 5/6] add types --- go.mod | 5 ++++- go.sum | 14 ++++---------- internal/display/actions.go | 16 +++++++++++++--- vendor/gopkg.in/auth0.v5/management/actions.go | 12 +++++++----- vendor/modules.txt | 10 ++++++++-- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 1f94d9b29..93e8b4c75 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,10 @@ module github.com/auth0/auth0-cli go 1.14 require ( + github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 // indirect + github.com/benbjohnson/clock v1.1.0 // indirect github.com/briandowns/spinner v1.11.1 + github.com/dustin/go-humanize v1.0.0 // indirect github.com/fatih/color v1.9.0 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible github.com/mattn/go-colorable v0.1.6 // indirect @@ -20,4 +23,4 @@ require ( ) // replace gopkg.in/auth0.v5 => ../auth0 -replace gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e +replace gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d diff --git a/go.sum b/go.sum index 555727149..d5db4ce59 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 h1:0NmehRCgyk5rljDQLKUO+cRJCnduDyn11+zGZIc9Z48= github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0/go.mod h1:6L7zgvqo0idzI7IO8de6ZC051AfXb5ipkIJ7bIA2tGA= -github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/briandowns/spinner v1.11.1 h1:OixPqDEcX3juo5AjQZAnFPbeUA0jvkp2qzB5gOZJ/L0= @@ -220,12 +220,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b h1:pUBBBpHjHeO4Li8vtUylTAReh/t9899rFULZRiG1xls= -github.com/turcottedanny/auth0 v1.3.1-0.20210125145849-a5a6c0556d7b/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E= -github.com/turcottedanny/auth0 v1.3.1-0.20210125152726-ff8b7f037643 h1:G6US6wRA06GlYk6Y8PMP1+A8uD8R8IpPOqUYwrtQtkg= -github.com/turcottedanny/auth0 v1.3.1-0.20210125152726-ff8b7f037643/go.mod h1:8z0Q+5B1XS+jEbp2GPGzIJd7nfJkJ74jZFEixmYfRhQ= -github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e h1:QH3gmHc1gH7Eekz6fDXx+75YRU/fLE3MfnrNHxgwa2o= -github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e/go.mod h1:ykikkGrZZrGKgwbdwA4Lgw5a03Vetq+zORg1v8pCVpY= +github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d h1:XKIKxOwBMcAzYCqpAFPzS1Ao6lRk4Sm7cqIO2VMguBY= +github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d/go.mod h1:ykikkGrZZrGKgwbdwA4Lgw5a03Vetq+zORg1v8pCVpY= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -487,8 +483,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/auth0.v5 v5.8.0 h1:JWZV4CGRrWQeztZFuW1LWxgUqet6zLiZelGv470CxzU= -gopkg.in/auth0.v5 v5.8.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/internal/display/actions.go b/internal/display/actions.go index 02c14da11..27118b277 100644 --- a/internal/display/actions.go +++ b/internal/display/actions.go @@ -1,22 +1,26 @@ package display import ( + "strings" + "github.com/auth0/auth0-cli/internal/ansi" "gopkg.in/auth0.v5" "gopkg.in/auth0.v5/management" ) type actionView struct { + ID string Name string CreatedAt string + Type string } func (v *actionView) AsTableHeader() []string { - return []string{"Name", "CreatedAt"} + return []string{"ID", "Name", "Type", "CreatedAt"} } func (v *actionView) AsTableRow() []string { - return []string{v.Name, v.CreatedAt} + return []string{v.ID, v.Name, v.Type, v.CreatedAt} } func (r *Renderer) ActionList(actions []*management.Action) { @@ -24,10 +28,16 @@ func (r *Renderer) ActionList(actions []*management.Action) { var res []View for _, a := range actions { + var triggers = make([]string, 0, len(*a.SupportedTriggers)) + for _, t := range *a.SupportedTriggers { + triggers = append(triggers, string(*t.ID)) + } + res = append(res, &actionView{ + ID: auth0.StringValue(a.ID), Name: auth0.StringValue(a.Name), CreatedAt: a.CreatedAt.String(), - // Type: auth0.StringValue(a.SupportedTriggers[0]), + Type: strings.Join(triggers, ", "), // Runtime: auth0.StringValue(a.Runtime), }) diff --git a/vendor/gopkg.in/auth0.v5/management/actions.go b/vendor/gopkg.in/auth0.v5/management/actions.go index 7f21f5095..fb0cc8db5 100644 --- a/vendor/gopkg.in/auth0.v5/management/actions.go +++ b/vendor/gopkg.in/auth0.v5/management/actions.go @@ -29,8 +29,10 @@ const ( type TriggerID string const ( - PostLogin TriggerID = "post-login" - ClientCredentials TriggerID = "client-credentials" + PostLogin TriggerID = "post-login" + ClientCredentials TriggerID = "client-credentials" + PreUserRegistration TriggerID = "pre-user-registration" + PostUserRegistration TriggerID = "post-user-registration" ) type ActionVersion struct { @@ -55,9 +57,9 @@ type Dependency struct { } type Trigger struct { - ID TriggerID `json:"id"` - Version string `json:"version"` - URL string `json:"url"` + ID *TriggerID `json:"id"` + Version *string `json:"version"` + URL *string `json:"url"` } type ActionList struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index d607f073c..58d4b5f63 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,10 +1,16 @@ # github.com/PuerkitoBio/rehttp v1.0.0 github.com/PuerkitoBio/rehttp +# github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 +## explicit +# github.com/benbjohnson/clock v1.1.0 +## explicit # github.com/briandowns/spinner v1.11.1 ## explicit github.com/briandowns/spinner # github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew/spew +# github.com/dustin/go-humanize v1.0.0 +## explicit # github.com/fatih/color v1.9.0 ## explicit github.com/fatih/color @@ -96,7 +102,7 @@ google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface google.golang.org/protobuf/runtime/protoimpl -# gopkg.in/auth0.v5 v5.8.0 => github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e +# gopkg.in/auth0.v5 v5.8.0 => github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d ## explicit gopkg.in/auth0.v5 gopkg.in/auth0.v5/internal/client @@ -107,4 +113,4 @@ gopkg.in/auth0.v5/management # gopkg.in/yaml.v2 v2.2.8 ## explicit gopkg.in/yaml.v2 -# gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125153138-738209e2e46e +# gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d From 17d64bdc05c3f054237927874ec391d77faab611 Mon Sep 17 00:00:00 2001 From: Danny Turcotte Date: Mon, 25 Jan 2021 14:20:03 -0500 Subject: [PATCH 6/6] replace go-auth0 fork --- go.mod | 4 +--- go.sum | 5 +++-- vendor/gopkg.in/auth0.v5/go.mod | 9 +++++---- vendor/gopkg.in/auth0.v5/go.sum | 2 -- vendor/modules.txt | 8 ++------ 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 93e8b4c75..865dbd0df 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,8 @@ module github.com/auth0/auth0-cli go 1.14 require ( - github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 // indirect github.com/benbjohnson/clock v1.1.0 // indirect github.com/briandowns/spinner v1.11.1 - github.com/dustin/go-humanize v1.0.0 // indirect github.com/fatih/color v1.9.0 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible github.com/mattn/go-colorable v0.1.6 // indirect @@ -23,4 +21,4 @@ require ( ) // replace gopkg.in/auth0.v5 => ../auth0 -replace gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d +replace gopkg.in/auth0.v5 => github.com/go-auth0/auth0 v1.3.1-0.20210125191543-690e086040a7 diff --git a/go.sum b/go.sum index d5db4ce59..74c9eb03b 100644 --- a/go.sum +++ b/go.sum @@ -41,6 +41,7 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 h1:0NmehRCgyk5rljDQLKUO+cRJCnduDyn11+zGZIc9Z48= github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0/go.mod h1:6L7zgvqo0idzI7IO8de6ZC051AfXb5ipkIJ7bIA2tGA= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -77,6 +78,8 @@ github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-auth0/auth0 v1.3.1-0.20210125191543-690e086040a7 h1:6kaJtttAsJDTFy0RD2RVPw1DadgzDBiSbrsfTOSBjfI= +github.com/go-auth0/auth0 v1.3.1-0.20210125191543-690e086040a7/go.mod h1:pbIRmwBulkHNKKsUGGvhyIOI2itMhz2OfwtPaFXBSSQ= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -220,8 +223,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d h1:XKIKxOwBMcAzYCqpAFPzS1Ao6lRk4Sm7cqIO2VMguBY= -github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d/go.mod h1:ykikkGrZZrGKgwbdwA4Lgw5a03Vetq+zORg1v8pCVpY= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= diff --git a/vendor/gopkg.in/auth0.v5/go.mod b/vendor/gopkg.in/auth0.v5/go.mod index 060ff081b..ba3e19d44 100644 --- a/vendor/gopkg.in/auth0.v5/go.mod +++ b/vendor/gopkg.in/auth0.v5/go.mod @@ -1,12 +1,13 @@ -// module gopkg.in/auth0.v5 -module github.com/turcottedanny/auth0 +module gopkg.in/auth0.v5 go 1.12 require ( github.com/PuerkitoBio/rehttp v1.0.0 + github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 // indirect + github.com/benbjohnson/clock v1.0.3 // indirect + github.com/dustin/go-humanize v1.0.0 // indirect golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 - gopkg.in/auth0.v5 v5.8.0 ) -replace gopkg.in/auth0.v5 => ./ +// replace gopkg.in/auth0.v5 => ./ diff --git a/vendor/gopkg.in/auth0.v5/go.sum b/vendor/gopkg.in/auth0.v5/go.sum index 2cebc8dee..5b7160aec 100644 --- a/vendor/gopkg.in/auth0.v5/go.sum +++ b/vendor/gopkg.in/auth0.v5/go.sum @@ -363,8 +363,6 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/auth0.v5 v5.8.0 h1:JWZV4CGRrWQeztZFuW1LWxgUqet6zLiZelGv470CxzU= -gopkg.in/auth0.v5 v5.8.0/go.mod h1:jVm6ZyPgF3Y1XpY4SPMPQM9NtRl8o3o/e2OuezsX97E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/modules.txt b/vendor/modules.txt index 58d4b5f63..838cf9879 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,7 +1,5 @@ # github.com/PuerkitoBio/rehttp v1.0.0 github.com/PuerkitoBio/rehttp -# github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 -## explicit # github.com/benbjohnson/clock v1.1.0 ## explicit # github.com/briandowns/spinner v1.11.1 @@ -9,8 +7,6 @@ github.com/PuerkitoBio/rehttp github.com/briandowns/spinner # github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew/spew -# github.com/dustin/go-humanize v1.0.0 -## explicit # github.com/fatih/color v1.9.0 ## explicit github.com/fatih/color @@ -102,7 +98,7 @@ google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface google.golang.org/protobuf/runtime/protoimpl -# gopkg.in/auth0.v5 v5.8.0 => github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d +# gopkg.in/auth0.v5 v5.8.0 => github.com/go-auth0/auth0 v1.3.1-0.20210125191543-690e086040a7 ## explicit gopkg.in/auth0.v5 gopkg.in/auth0.v5/internal/client @@ -113,4 +109,4 @@ gopkg.in/auth0.v5/management # gopkg.in/yaml.v2 v2.2.8 ## explicit gopkg.in/yaml.v2 -# gopkg.in/auth0.v5 => github.com/turcottedanny/auth0 v1.3.1-0.20210125161716-3aaf9db9686d +# gopkg.in/auth0.v5 => github.com/go-auth0/auth0 v1.3.1-0.20210125191543-690e086040a7