Skip to content

Commit

Permalink
Cli 169 log streams (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
bright-poku authored Jun 2, 2021
1 parent a1d2bbd commit a600d49
Show file tree
Hide file tree
Showing 8 changed files with 934 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var requiredScopes = []string{
"read:connections", "update:connections",
"read:client_keys", "read:logs", "read:tenant_settings", "read:custom_domains",
"read:anomaly_blocks", "delete:anomaly_blocks",
"create:log_streams", "delete:log_streams", "read:log_streams", "update:log_streams",
}

// RequiredScopes returns the scopes used for login.
Expand Down
1 change: 1 addition & 0 deletions internal/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ func TestRequiredScopes(t *testing.T) {
t.Run("verify CRUD", func(t *testing.T) {
crudResources := []string{
"clients",
"log_streams",
"resource_servers",
"roles",
"rules",
Expand Down
2 changes: 2 additions & 0 deletions internal/auth0/auth0.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type API struct {
Connection ConnectionAPI
CustomDomain CustomDomainAPI
Log LogAPI
LogStream LogStreamAPI
ResourceServer ResourceServerAPI
Role RoleAPI
Rule RuleAPI
Expand All @@ -28,6 +29,7 @@ func NewAPI(m *management.Management) *API {
Client: m.Client,
CustomDomain: m.CustomDomain,
Log: m.Log,
LogStream: m.LogStream,
ResourceServer: m.ResourceServer,
Role: m.Role,
Rule: m.Rule,
Expand Down
22 changes: 22 additions & 0 deletions internal/auth0/log_stream.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//go:generate mockgen -source=log_stream.go -destination=log_stream_mock.go -package=auth0

package auth0

import "gopkg.in/auth0.v5/management"

type LogStreamAPI interface {
// Create a log stream.
Create(ls *management.LogStream, opts ...management.RequestOption) (err error)

// Read a log stream.
Read(id string, opts ...management.RequestOption) (ls *management.LogStream, err error)

// Update a log stream.
Update(id string, ls *management.LogStream, opts ...management.RequestOption) (err error)

// List all log streams.
List(opts ...management.RequestOption) (ls []*management.LogStream, err error)

// Delete a log stream.
Delete(id string, opts ...management.RequestOption) (err error)
}
Loading

0 comments on commit a600d49

Please sign in to comment.