-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
856 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# project artifacts | ||
auth0 | ||
/auth0 | ||
|
||
# Swap | ||
[._]*.s[a-v][a-z] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package auth0 | ||
|
||
import "gopkg.in/auth0.v5/management" | ||
|
||
type ActionsAPI interface { | ||
Create(a *management.Action) error | ||
Read(id string) (*management.Action, error) | ||
Update(id string, a *management.Action) error | ||
Delete(id string, opts ...management.RequestOption) error | ||
List(opts ...management.RequestOption) (c *management.ActionList, err error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package auth0 | ||
|
||
// API mimics `management.Management`s general interface, except it uses | ||
// methods since we can't really mock fields. | ||
type API interface { | ||
Actions() ActionsAPI | ||
Client() ClientAPI | ||
Connection() ConnectionAPI | ||
Log() LogAPI | ||
Rule() RuleAPI | ||
ResourceServer() ResourceServerAPI | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//go:generate mockgen -source=client.go -destination=client_mock.go -package=auth0 | ||
|
||
package auth0 | ||
|
||
import "gopkg.in/auth0.v5/management" | ||
|
||
type ClientAPI interface { | ||
// Create a new client application. | ||
Create(c *management.Client, opts ...management.RequestOption) (err error) | ||
|
||
// Read a client by its id. | ||
Read(id string, opts ...management.RequestOption) (c *management.Client, err error) | ||
|
||
// List all client applications. | ||
List(opts ...management.RequestOption) (c *management.ClientList, err error) | ||
|
||
// Update a client. | ||
Update(id string, c *management.Client, opts ...management.RequestOption) (err error) | ||
|
||
// RotateSecret rotates a client secret. | ||
RotateSecret(id string, opts ...management.RequestOption) (c *management.Client, err error) | ||
|
||
// Delete a client and all its related assets (like rules, connections, etc) | ||
// given its id. | ||
Delete(id string, opts ...management.RequestOption) error | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//go:generate mockgen -source=connection.go -destination=connection_mock.go -package=auth0 | ||
|
||
package auth0 | ||
|
||
import "gopkg.in/auth0.v5/management" | ||
|
||
type ConnectionAPI interface { | ||
// Create a new connection. | ||
Create(c *management.Connection, opts ...management.RequestOption) error | ||
|
||
// Read retrieves a connection by its id. | ||
Read(id string, opts ...management.RequestOption) (c *management.Connection, err error) | ||
|
||
// List all connections. | ||
List(opts ...management.RequestOption) (c *management.ConnectionList, err error) | ||
|
||
// Update a connection. | ||
Update(id string, c *management.Connection, opts ...management.RequestOption) (err error) | ||
|
||
// Delete a connection and all its users. | ||
Delete(id string, opts ...management.RequestOption) (err error) | ||
|
||
// ReadByName retrieves a connection by its name. This is a helper method when a | ||
// connection id is not readily available. | ||
ReadByName(name string, opts ...management.RequestOption) (*management.Connection, error) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.