Skip to content

Commit 4f46249

Browse files
authored
Merge pull request #128 from ConductorOne/ggreer/upgrade-baton-sdk
Upgrade baton-sdk.
2 parents 579f401 + 95ad382 commit 4f46249

File tree

109 files changed

+11252
-2283
lines changed

Some content is hidden

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

109 files changed

+11252
-2283
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,30 @@ jobs:
1010
go-lint:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
1315
- name: Install Go
1416
uses: actions/setup-go@v5
1517
with:
16-
go-version: 1.23.x
17-
- name: Checkout code
18-
uses: actions/checkout@v4
18+
go-version-file: 'go.mod'
1919
- name: Run linters
20-
uses: golangci/golangci-lint-action@v3
20+
uses: golangci/golangci-lint-action@v8
2121
with:
2222
version: latest
2323
args: --timeout=3m
2424
go-test:
2525
strategy:
2626
matrix:
27-
go-version: [1.23.x]
2827
platform: [ubuntu-latest]
2928
runs-on: ${{ matrix.platform }}
3029
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
3132
- name: Install Go
3233
if: success()
3334
uses: actions/setup-go@v5
3435
with:
35-
go-version: ${{ matrix.go-version }}
36-
- name: Checkout code
37-
uses: actions/checkout@v4
36+
go-version-file: 'go.mod'
3837
- name: go tests
3938
run: go test -v -covermode=count -json ./... > test.json
4039
- name: annotate go tests
@@ -72,12 +71,12 @@ jobs:
7271
BATON_URL: 'ldaps://localhost'
7372
BATON_INSECURE_SKIP_VERIFY: true
7473
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v4
7576
- name: Install Go
7677
uses: actions/setup-go@v5
7778
with:
78-
go-version: 1.23.x
79-
- name: Checkout code
80-
uses: actions/checkout@v4
79+
go-version-file: 'go.mod'
8180
- name: Setup node.js
8281
uses: actions/setup-node@v3
8382
with:

.github/workflows/release.yaml

Lines changed: 13 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,18 @@ name: Release
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
jobs:
9-
goreleaser:
10-
runs-on: macos-latest
11-
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
with:
15-
fetch-depth: 0
16-
- name: Set up Go
17-
uses: actions/setup-go@v5
18-
with:
19-
go-version: 1.23.x
20-
- name: Set up Gon
21-
run: brew tap conductorone/gon && brew install conductorone/gon/gon
22-
- name: Import Keychain Certs
23-
uses: apple-actions/import-codesign-certs@v1
24-
with:
25-
p12-file-base64: ${{ secrets.APPLE_SIGNING_KEY_P12 }}
26-
p12-password: ${{ secrets.APPLE_SIGNING_KEY_P12_PASSWORD }}
27-
- name: Run GoReleaser
28-
uses: goreleaser/goreleaser-action@v6
29-
with:
30-
version: "~> v2"
31-
args: release --clean
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.RELENG_GITHUB_TOKEN }}
34-
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
35-
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
36-
goreleaser-docker:
37-
runs-on: ubuntu-latest
38-
steps:
39-
- name: Checkout
40-
uses: actions/checkout@v4
41-
with:
42-
fetch-depth: 0
43-
- name: Set up Go
44-
uses: actions/setup-go@v5
45-
with:
46-
go-version: 1.23.x
47-
- name: Docker Login
48-
uses: docker/login-action@v1
49-
with:
50-
registry: ghcr.io
51-
username: ${{ github.repository_owner }}
52-
password: ${{ secrets.RELENG_GITHUB_TOKEN }}
53-
- name: Set up Docker Buildx
54-
uses: docker/setup-buildx-action@v1
55-
- name: Run GoReleaser
56-
uses: goreleaser/goreleaser-action@v6
57-
with:
58-
version: "~> v2"
59-
args: release --clean -f .goreleaser.docker.yaml
60-
env:
61-
GITHUB_TOKEN: ${{ secrets.RELENG_GITHUB_TOKEN }}
9+
release:
10+
uses: ConductorOne/github-workflows/.github/workflows/release.yaml@v2
11+
with:
12+
tag: ${{ github.ref_name }}
13+
lambda: false
14+
secrets:
15+
RELENG_GITHUB_TOKEN: ${{ secrets.RELENG_GITHUB_TOKEN }}
16+
APPLE_SIGNING_KEY_P12: ${{ secrets.APPLE_SIGNING_KEY_P12 }}
17+
APPLE_SIGNING_KEY_P12_PASSWORD: ${{ secrets.APPLE_SIGNING_KEY_P12_PASSWORD }}
18+
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
19+
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
20+
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}

.golangci.yml

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

.gon-amd64.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

.gon-arm64.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)