Skip to content

Commit a6414e4

Browse files
authored
Upgrade baton-sdk. (#86)
1 parent 801c23a commit a6414e4

File tree

102 files changed

+11132
-1961
lines changed

Some content is hidden

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

102 files changed

+11132
-1961
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ jobs:
44
go-lint:
55
runs-on: ubuntu-latest
66
steps:
7+
- name: Checkout code
8+
uses: actions/checkout@v4
79
- name: Install Go
810
uses: actions/setup-go@v5
911
with:
10-
go-version: 1.23.x
11-
- name: Checkout code
12-
uses: actions/checkout@v4
12+
go-version-file: go.mod
1313
- name: Run linters
1414
uses: golangci/golangci-lint-action@v8
1515
with:
@@ -18,17 +18,16 @@ jobs:
1818
go-test:
1919
strategy:
2020
matrix:
21-
go-version: [1.23.x]
2221
platform: [ubuntu-latest]
2322
runs-on: ${{ matrix.platform }}
2423
steps:
25-
- name: Install Go
24+
- name: Checkout code
2625
if: success()
26+
uses: actions/checkout@v4
27+
- name: Install Go
2728
uses: actions/setup-go@v5
2829
with:
29-
go-version: ${{ matrix.go-version }}
30-
- name: Checkout code
31-
uses: actions/checkout@v4
30+
go-version-file: go.mod
3231
- name: go tests
3332
run: (set -o pipefail && go test -v -covermode=count -json ./... | tee test.json)
3433
- name: annotate go tests
@@ -47,12 +46,12 @@ jobs:
4746
BATON_GLOBAL_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
4847
BATON_GLOBAL_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4948
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v4
5051
- name: Install Go
5152
uses: actions/setup-go@v5
5253
with:
53-
go-version: 1.23.x
54-
- name: Checkout code
55-
uses: actions/checkout@v4
54+
go-version-file: go.mod
5655
- name: Build baton-aws
5756
run: go build ./cmd/baton-aws
5857
- name: Test grant/revoking IAM entitlements

.github/workflows/main.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
go-lint:
88
runs-on: ubuntu-latest
99
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
1012
- name: Install Go
1113
uses: actions/setup-go@v5
1214
with:
13-
go-version: 1.23.x
14-
- name: Checkout code
15-
uses: actions/checkout@v4
15+
go-version-file: go.mod
1616
- name: Run linters
1717
uses: golangci/golangci-lint-action@v8
1818
with:
@@ -21,17 +21,16 @@ jobs:
2121
go-test:
2222
strategy:
2323
matrix:
24-
go-version: [ 1.23.x ]
2524
platform: [ ubuntu-latest ]
2625
runs-on: ${{ matrix.platform }}
2726
steps:
28-
- name: Install Go
27+
- name: Checkout code
2928
if: success()
29+
uses: actions/checkout@v4
30+
- name: Install Go
3031
uses: actions/setup-go@v5
3132
with:
32-
go-version: ${{ matrix.go-version }}
33-
- name: Checkout code
34-
uses: actions/checkout@v4
33+
go-version-file: go.mod
3534
- name: go tests
3635
run: (set -o pipefail && go test -v -covermode=count -json ./... | tee test.json)
3736
- name: annotate go tests

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/conductorone/baton-aws
22

3-
go 1.23.4
3+
go 1.25
44

55
require (
66
github.com/aws/aws-sdk-go-v2 v1.36.3
@@ -12,7 +12,7 @@ require (
1212
github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.27.5
1313
github.com/aws/aws-sdk-go-v2/service/sts v1.33.10
1414
github.com/aws/smithy-go v1.22.2
15-
github.com/conductorone/baton-sdk v0.3.35
15+
github.com/conductorone/baton-sdk v0.4.2
1616
github.com/ennyjfrick/ruleguard-logfatal v0.0.2
1717
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
1818
github.com/quasilyte/go-ruleguard/dsl v0.3.22
@@ -65,7 +65,7 @@ require (
6565
github.com/hashicorp/hcl v1.0.0 // indirect
6666
github.com/inconshreveable/mousetrap v1.1.0 // indirect
6767
github.com/jellydator/ttlcache/v3 v3.3.0 // indirect
68-
github.com/klauspost/compress v1.17.11 // indirect
68+
github.com/klauspost/compress v1.18.0 // indirect
6969
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
7070
github.com/magiconair/properties v1.8.9 // indirect
7171
github.com/mattn/go-isatty v0.0.20 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY
6666
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
6767
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
6868
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
69-
github.com/conductorone/baton-sdk v0.3.35 h1:8yzc1e/Dsmw5/a7zZcJklMeetjA7hRfD33zdD7WMHAs=
70-
github.com/conductorone/baton-sdk v0.3.35/go.mod h1:L55WO3ERMx1mfpjDgwK3jWNRGRF2E76WrQHmW6ev8VY=
69+
github.com/conductorone/baton-sdk v0.4.2 h1:hj/aXdaz850EVqnErw9DN/+3864LSdVcwa6p3vMrAfI=
70+
github.com/conductorone/baton-sdk v0.4.2/go.mod h1:Csa1C2KrI4TxJAtC3WjQqOn24u0g2f4/5FgiYqZWpN4=
7171
github.com/conductorone/dpop v0.2.3 h1:s91U3845GHQ6P6FWrdNr2SEOy1ES/jcFs1JtKSl2S+o=
7272
github.com/conductorone/dpop v0.2.3/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s=
7373
github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 h1:kLMCNIh0Mo2vbvvkCmJ3ixsPbXEJ6HPcW53Ku9yje3s=
@@ -152,8 +152,8 @@ github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHT
152152
github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw=
153153
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
154154
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
155-
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
156-
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
155+
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
156+
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
157157
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
158158
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
159159
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=

pkg/connector/iam_user.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ type iamUserResourceType struct {
2626
awsClientFactory *AWSClientFactory
2727
}
2828

29+
var _ connectorbuilder.AccountManager = &iamUserResourceType{}
30+
2931
func (o *iamUserResourceType) ResourceType(_ context.Context) *v2.ResourceType {
3032
return o.resourceType
3133
}
@@ -148,15 +150,15 @@ func getLastLogin(ctx context.Context, client *iam.Client, user iamTypes.User) *
148150

149151
res, err := client.ListAccessKeys(ctx, &iam.ListAccessKeysInput{UserName: user.UserName})
150152
if err != nil {
151-
logger.Error("Error listing access keys", zap.Error(err))
153+
logger.Warn("Error listing access keys", zap.Error(err))
152154
return user.PasswordLastUsed
153155
}
154156

155157
accessKeyLastUsedDates := make([]time.Time, 0, len(res.AccessKeyMetadata))
156158
for _, key := range res.AccessKeyMetadata {
157159
accessKeyLastUsed := getAccessKeyLastUsedDate(ctx, client, awsSdk.ToString(key.AccessKeyId))
158160
if accessKeyLastUsed == nil {
159-
logger.Error("Error getting access key last used", zap.String("access_key_id", awsSdk.ToString(key.AccessKeyId)))
161+
logger.Warn("Error getting access key last used", zap.String("access_key_id", awsSdk.ToString(key.AccessKeyId)))
160162
continue
161163
}
162164
accessKeyLastUsedDates = append(accessKeyLastUsedDates, *accessKeyLastUsed)
@@ -214,7 +216,7 @@ func (o *iamUserResourceType) CreateAccountCapabilityDetails(ctx context.Context
214216
func (o *iamUserResourceType) CreateAccount(
215217
ctx context.Context,
216218
accountInfo *v2.AccountInfo,
217-
credentialOptions *v2.CredentialOptions,
219+
credentialOptions *v2.LocalCredentialOptions,
218220
) (connectorbuilder.CreateAccountResponse, []*v2.PlaintextData, annotations.Annotations, error) {
219221
profile := accountInfo.Profile.AsMap()
220222

vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.go

Lines changed: 45 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_resource_tree.pb.validate.go

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)