Skip to content

Commit ef84692

Browse files
Merge pull request #19 from ConductorOne/auto-cli
[BB-495] Add different authentication modes
2 parents b2673e7 + c016042 commit ef84692

File tree

716 files changed

+63445
-33412
lines changed

Some content is hidden

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

716 files changed

+63445
-33412
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@v3
1313
- name: Run linters
14-
uses: golangci/golangci-lint-action@v3
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@v3
1616
- name: Run linters
17-
uses: golangci/golangci-lint-action@v3
17+
uses: golangci/golangci-lint-action@v8
1818
with:
1919
version: latest
2020
args: --timeout=3m

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
# Output of the go coverage tool, specifically when used with LiteIDE
1313
*.out
1414

15+
# VSCode / Codium
16+
.DS_Store
17+
.vscode
18+
__debug*
19+
1520
# Dependency directories (remove the comment below to include it)
1621
# vendor/
1722
dist/
23+

.golangci.yml

Lines changed: 107 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,111 @@
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-
- exportloopref # checks for pointers to enclosing loop variables
75-
- forbidigo # Forbids identifiers
76-
- gochecknoinits # Checks that no init functions are present in Go code
77-
- goconst # Finds repeated strings that could be replaced by a constant
78-
- gocritic # Provides diagnostics that check for bugs, performance and style issues.
79-
- godot # Check if comments end in a period
80-
- goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt.
81-
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
82-
- goprintffuncname # Checks that printf-like functions are named with f at the end
83-
- gosec # Inspects source code for security problems
84-
- nakedret # Finds naked returns in functions greater than a specified function length
85-
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
86-
- noctx # noctx finds sending http request without context.Context
87-
- nolintlint # Reports ill-formed or insufficient nolint directives
88-
- nonamedreturns # Reports all named returns
89-
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL.
90-
- predeclared # find code that shadows one of Go's predeclared identifiers
91-
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
92-
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
93-
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
94-
- unconvert # Remove unnecessary type conversions
95-
- usestdlibvars # detect the possibility to use variables/constants from the Go standard library
96-
- whitespace # Tool for detection of leading and trailing whitespace
97-
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+
settings:
42+
underef:
43+
skipRecvDeref: false
44+
govet:
45+
disable:
46+
- fieldalignment
47+
- shadow
48+
enable-all: true
49+
nakedret:
50+
max-func-lines: 0
51+
nolintlint:
52+
require-explanation: true
53+
require-specific: true
54+
allow-no-explanation:
55+
- forbidigo
56+
- tracecheck
57+
- gomnd
58+
- gochecknoinits
59+
- makezero
60+
revive:
61+
severity: error
62+
rules:
63+
- name: atomic
64+
- name: line-length-limit
65+
arguments:
66+
- 200
67+
- name: unhandled-error
68+
arguments:
69+
- fmt.Printf
70+
- fmt.Println
71+
- fmt.Fprintf
72+
- fmt.Fprintln
73+
- os.Stderr.Sync
74+
- sb.WriteString
75+
- buf.WriteString
76+
- hasher.Write
77+
- os.Setenv
78+
- os.RemoveAll
79+
- name: var-naming
80+
arguments:
81+
- - ID
82+
- URL
83+
- HTTP
84+
- API
85+
- []
86+
exclusions:
87+
generated: lax
88+
presets:
89+
- comments
90+
- common-false-positives
91+
- legacy
92+
- std-error-handling
93+
rules:
94+
- linters:
95+
- godot
96+
source: (TODO)
97+
paths:
98+
- third_party$
99+
- builtin$
100+
- examples$
98101
issues:
99102
max-same-issues: 50
100-
101-
exclude-rules:
102-
# Don't require TODO comments to end in a period
103-
- source: "(TODO)"
104-
linters: [ godot ]
103+
formatters:
104+
enable:
105+
- goimports
106+
exclusions:
107+
generated: lax
108+
paths:
109+
- third_party$
110+
- builtin$
111+
- examples$

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ Available Commands:
6161
help Help about any command
6262
6363
Flags:
64-
--address string required: Sign in address of your 1Password account ($BATON_ADDRESS)
64+
--address string Sign in address of your 1Password account. Defaults to 'my.1password.com' ($BATON_ADDRESS)
65+
--email string Email for your 1Password account. ($BATON_EMAIL)
66+
--secret-key string Secret Key for your 1Password account. ($BATON_SECRET_KEY)
67+
--password string Password for your 1Password account. ($BATON_PASSWORD) If not provided, manual input required.
68+
--auth-type string How the CLI should authenticate. Options: "user" (default) and "service". If using "service" authentication the OP_SERVICE_ACCOUNT_TOKEN environment variable must be set.
6569
--client-id string The client ID used to authenticate with ConductorOne ($BATON_CLIENT_ID)
6670
--client-secret string The client secret used to authenticate with ConductorOne ($BATON_CLIENT_SECRET)
6771
-f, --file string The path to the c1z file to sync with ($BATON_FILE) (default "sync.c1z")

0 commit comments

Comments
 (0)