Skip to content

Commit 0f67fe1

Browse files
Merge pull request #23 from ConductorOne/goldschmidt/add-permissions
[BB-1013] Add permissions support
2 parents 9808359 + 6173b8c commit 0f67fe1

File tree

1,756 files changed

+1665484
-233817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,756 files changed

+1665484
-233817
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Checkout code
1212
uses: actions/checkout@v4
1313
- name: Run linters
14-
uses: golangci/golangci-lint-action@v6
14+
uses: golangci/golangci-lint-action@v8
1515
with:
1616
version: latest
1717
args: --timeout=3m

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
1616
- name: Run linters
17-
uses: golangci/golangci-lint-action@v6
17+
uses: golangci/golangci-lint-action@v8
1818
with:
1919
version: latest
2020
args: --timeout=3m

.golangci.yml

Lines changed: 112 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,116 @@
1-
linters-settings:
2-
exhaustive:
3-
default-signifies-exhaustive: true
4-
5-
gocritic:
6-
# The list of supported checkers can be find in https://go-critic.github.io/overview.
7-
settings:
8-
underef:
9-
# Whether to skip (*x).method() calls where x is a pointer receiver.
10-
skipRecvDeref: false
11-
12-
govet:
13-
enable-all: true
14-
disable:
15-
- fieldalignment # too strict
16-
- shadow # complains too much about shadowing errors. All research points to this being fine.
17-
18-
nakedret:
19-
max-func-lines: 0
20-
21-
nolintlint:
22-
allow-no-explanation: [ forbidigo, tracecheck, gomnd, gochecknoinits, makezero ]
23-
require-explanation: true
24-
require-specific: true
25-
26-
revive:
27-
ignore-generated-header: true
28-
severity: error
29-
rules:
30-
- name: atomic
31-
- name: line-length-limit
32-
arguments: [ 200 ]
33-
# These are functions that we use without checking the errors often. Most of these can't return an error even
34-
# though they implement an interface that can.
35-
- name: unhandled-error
36-
arguments:
37-
- fmt.Printf
38-
- fmt.Println
39-
- fmt.Fprintf
40-
- fmt.Fprintln
41-
- os.Stderr.Sync
42-
- sb.WriteString
43-
- buf.WriteString
44-
- hasher.Write
45-
- os.Setenv
46-
- os.RemoveAll
47-
- name: var-naming
48-
arguments: [["ID", "URL", "HTTP", "API"], []]
49-
50-
tenv:
51-
all: true
52-
53-
varcheck:
54-
exported-fields: false # this appears to improperly detect exported variables as unused when they are used from a package with the same name
55-
56-
1+
version: "2"
572
linters:
58-
disable-all: true
3+
default: none
594
enable:
60-
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
61-
- gosimple # Linter for Go source code that specializes in simplifying a code
62-
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
63-
- ineffassign # Detects when assignments to existing variables are not used
64-
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
65-
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
66-
- unused # Checks Go code for unused constants, variables, functions and types
67-
- asasalint # Check for pass []any as any in variadic func(...any)
68-
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
69-
- bidichk # Checks for dangerous unicode character sequences
70-
- bodyclose # checks whether HTTP response body is closed successfully
71-
- durationcheck # check for two durations multiplied together
72-
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
73-
- exhaustive # check exhaustiveness of enum switch statements
74-
- forbidigo # Forbids identifiers
75-
- gochecknoinits # Checks that no init functions are present in Go code
76-
- goconst # Finds repeated strings that could be replaced by a constant
77-
- gocritic # Provides diagnostics that check for bugs, performance and style issues.
78-
- godot # Check if comments end in a period
79-
- goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt.
80-
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
81-
- goprintffuncname # Checks that printf-like functions are named with f at the end
82-
- gosec # Inspects source code for security problems
83-
- nakedret # Finds naked returns in functions greater than a specified function length
84-
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
85-
- noctx # noctx finds sending http request without context.Context
86-
- nolintlint # Reports ill-formed or insufficient nolint directives
87-
- nonamedreturns # Reports all named returns
88-
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL.
89-
- predeclared # find code that shadows one of Go's predeclared identifiers
90-
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
91-
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
92-
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
93-
- unconvert # Remove unnecessary type conversions
94-
- usestdlibvars # detect the possibility to use variables/constants from the Go standard library
95-
- whitespace # Tool for detection of leading and trailing whitespace
96-
5+
- asasalint
6+
- asciicheck
7+
- bidichk
8+
- bodyclose
9+
- durationcheck
10+
- errcheck
11+
- errorlint
12+
- exhaustive
13+
- forbidigo
14+
- gochecknoinits
15+
- goconst
16+
- gocritic
17+
- godot
18+
- gomoddirectives
19+
- goprintffuncname
20+
- gosec
21+
- govet
22+
- ineffassign
23+
- nakedret
24+
- nilerr
25+
- noctx
26+
- nolintlint
27+
- nonamedreturns
28+
- nosprintfhostport
29+
- predeclared
30+
- revive
31+
- staticcheck
32+
- tparallel
33+
- unconvert
34+
- unused
35+
- usestdlibvars
36+
- whitespace
37+
settings:
38+
exhaustive:
39+
default-signifies-exhaustive: true
40+
gocritic:
41+
enabled-checks:
42+
- ruleguard
43+
settings:
44+
ruleguard:
45+
rules: ${base-path}/tools/rules.go
46+
underef:
47+
skipRecvDeref: false
48+
govet:
49+
disable:
50+
- fieldalignment
51+
- shadow
52+
enable-all: true
53+
nakedret:
54+
max-func-lines: 0
55+
nolintlint:
56+
require-explanation: true
57+
require-specific: true
58+
allow-no-explanation:
59+
- forbidigo
60+
- tracecheck
61+
- gomnd
62+
- gochecknoinits
63+
- makezero
64+
revive:
65+
severity: error
66+
rules:
67+
- name: atomic
68+
- name: line-length-limit
69+
arguments:
70+
- 250
71+
- name: unhandled-error
72+
arguments:
73+
- fmt.Printf
74+
- fmt.Println
75+
- fmt.Fprint
76+
- fmt.Fprintf
77+
- fmt.Fprintln
78+
- os.Stderr.Sync
79+
- sb.WriteString
80+
- buf.WriteString
81+
- hasher.Write
82+
- os.Setenv
83+
- os.RemoveAll
84+
- name: var-naming
85+
arguments:
86+
- - ID
87+
- URL
88+
- HTTP
89+
- API
90+
- []
91+
exclusions:
92+
generated: lax
93+
presets:
94+
- comments
95+
- common-false-positives
96+
- legacy
97+
- std-error-handling
98+
rules:
99+
- linters:
100+
- godot
101+
source: (TODO)
102+
paths:
103+
- third_party$
104+
- builtin$
105+
- examples$
97106
issues:
98107
max-same-issues: 50
99-
100-
exclude-rules:
101-
# Don't require TODO comments to end in a period
102-
- source: "(TODO)"
103-
linters: [ godot ]
108+
formatters:
109+
enable:
110+
- goimports
111+
exclusions:
112+
generated: lax
113+
paths:
114+
- third_party$
115+
- builtin$
116+
- examples$

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ The permissions needed are:
6363
- Read Organization Members
6464
- Read Roles
6565
- Read Role Members
66+
- Read Resource Servers
67+
- If syncPermissions it's true
6668

6769

6870
# `baton-auth0` Command Line Usage

cmd/baton-auth0/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func getConnector(ctx context.Context, v *viper.Viper) (types.ConnectorServer, e
5151
v.GetString(config2.BaseUrlField.FieldName),
5252
v.GetString(config2.ClientIdField.FieldName),
5353
v.GetString(config2.ClientSecretField.FieldName),
54+
v.GetBool(config2.SyncPermissions.FieldName),
5455
)
5556
if err != nil {
5657
l.Error("error creating connector", zap.Error(err))

0 commit comments

Comments
 (0)