Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Run linters
uses: golangci/golangci-lint-action@v9
with:
version: v2.9.0
version: v2.15.0
args: --timeout=3m
go-test:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Run linters
uses: golangci/golangci-lint-action@v9
with:
version: v2.9.0
version: v2.15.0
args: --timeout=3m
go-test:
strategy:
Expand Down
10 changes: 5 additions & 5 deletions cmd/cone/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func createAWSProfile(entitlement *shared.AppEntitlement, resource *shared.AppRe
profileName := sanitizeINIValue(fmt.Sprintf("%s-%s", accountName, strings.ToLower(roleName)))

awsConfigDir := filepath.Join(os.Getenv("HOME"), ".aws")
if err := os.MkdirAll(awsConfigDir, 0700); err != nil {
if err := os.MkdirAll(awsConfigDir, 0700); err != nil { //nolint:gosec // trusted path ~/.aws
return "", fmt.Errorf("failed to create ~/.aws: %w", err)
}

Expand Down Expand Up @@ -265,7 +265,7 @@ sso_registration_scopes = sso:account:access
`, ssoURL, ssoRegion)
}

if err := os.WriteFile(configPath, append(configContent, []byte(newConfig)...), 0600); err != nil {
if err := os.WriteFile(configPath, append(configContent, []byte(newConfig)...), 0600); err != nil { //nolint:gosec // trusted path ~/.aws/config
return "", fmt.Errorf("failed to write AWS config: %w", err)
}

Expand Down Expand Up @@ -484,7 +484,7 @@ func awsCredentialsRun(cmd *cobra.Command, args []string) error {
return credErr
}

jsonOutput, err := json.Marshal(creds)
jsonOutput, err := json.Marshal(creds) //nolint:gosec // credentials are intentionally emitted for credential_process
if err != nil {
return fmt.Errorf("failed to marshal credentials: %w", err)
}
Expand Down Expand Up @@ -527,7 +527,7 @@ func sanitizeINIValue(s string) string {
case '\n', '\r', '\x00', '[', ']', '"', '\\':
continue
default:
b.WriteRune(r)
_, _ = b.WriteRune(r)
}
}
return b.String()
Expand Down Expand Up @@ -616,7 +616,7 @@ func ssoLogin(ctx context.Context) error {
}

func getRoleCredentials(ctx context.Context, token, accountID, roleName, ssoRegion string) ([]byte, error) {
cmd := exec.CommandContext(ctx, "aws", "sso", "get-role-credentials",
cmd := exec.CommandContext(ctx, "aws", "sso", "get-role-credentials", //nolint:gosec // fixed aws binary, args from validated config
"--access-token", token,
"--account-id", accountID,
"--role-name", roleName,
Expand Down
14 changes: 7 additions & 7 deletions cmd/cone/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestEncryptDecryptRoundtrip(t *testing.T) {
{name: "simple", plaintext: "hello world"},
{name: "empty", plaintext: ""},
{name: "multiline", plaintext: "line1\nline2\nline3"},
{name: "json", plaintext: `{"key":"value","n":1}`},
{name: "json", plaintext: `{"key":"value","n":1}`}, //nolint:goconst // test fixture
{name: "unicode", plaintext: "héllo 🌍 wörld"},
{name: "large", plaintext: strings.Repeat("a", 50000)},
}
Expand Down Expand Up @@ -145,9 +145,9 @@ func TestCreateInputFormat(t *testing.T) {
want shared.PaperSecretServiceCreateInternalRequestInputFormat
}{
{name: "json", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatJSON},
{name: "yaml", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatYaml},
{name: "key-value", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatKeyValue},
{name: "plaintext", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatPlaintext},
{name: "yaml", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatYaml}, //nolint:goconst // test fixture
{name: "key-value", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatKeyValue}, //nolint:goconst // test fixture
{name: "plaintext", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatPlaintext}, //nolint:goconst // test fixture
{name: "unknown", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatPlaintext},
{name: "", want: shared.PaperSecretServiceCreateInternalRequestInputFormatSecretInputFormatPlaintext},
}
Expand All @@ -171,8 +171,8 @@ func TestValidateSecretCreateInput(t *testing.T) {
input secretCreateInput
wantErr string
}{
{name: "valid internal text", input: secretCreateInput{userIDs: []string{"u1"}, hasInlineContent: true, expiresIn: "3600s"}},
{name: "valid external file", input: secretCreateInput{emails: []string{"a@b.com"}, filePath: "/tmp/f", expiresIn: "1h"}},
{name: "valid internal text", input: secretCreateInput{userIDs: []string{"u1"}, hasInlineContent: true, expiresIn: "3600s"}}, //nolint:goconst // test fixture
{name: "valid external file", input: secretCreateInput{emails: []string{"a@b.com"}, filePath: "/tmp/f", expiresIn: "1h"}}, //nolint:goconst // test fixture
{name: "valid content file", input: secretCreateInput{userRefs: []string{"alice@example.com"}, contentFilePath: "/tmp/content", expiresIn: "3600s"}},
{name: "no recipient", input: secretCreateInput{hasInlineContent: true, expiresIn: "3600s"}, wantErr: "one of"},
{name: "both recipients", input: secretCreateInput{userIDs: []string{"u1"}, emails: []string{"a@b.com"}, expiresIn: "3600s", hasInlineContent: true}, wantErr: "mutually exclusive"},
Expand Down Expand Up @@ -532,7 +532,7 @@ func TestValidateSecretTextContent(t *testing.T) {

func TestShareCodeFromSecretRef(t *testing.T) {
tests := map[string]string{
"ABCD-EFGH-IJKL": "ABCD-EFGH-IJKL",
"ABCD-EFGH-IJKL": "ABCD-EFGH-IJKL", //nolint:goconst // test fixture
"abcd-efgh-ijkl": "ABCD-EFGH-IJKL",
"https://tenant.example.com/secrets/view/abcd-efgh-ijkl": "ABCD-EFGH-IJKL",
"https://tenant.example.com/ext/secrets/share/abcd-efgh-ijkl?x=ignore": "ABCD-EFGH-IJKL",
Expand Down
50 changes: 22 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
module github.com/conductorone/cone

go 1.26

require (
go.uber.org/zap v1.27.0
golang.org/x/net v0.55.0
google.golang.org/grpc v1.73.0
google.golang.org/protobuf v1.36.6
)
go 1.27.3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion (confidence: medium): ci.yaml and main.yaml pin golangci-lint to v2.9.0. That release came out before Go 1.27 and was built with an older Go. golangci-lint v2 refuses to run when the Go it was built with is older than the go directive in go.mod ("the Go language version ... used to build golangci-lint is lower than the targeted Go version"), so the go-lint job will probably fail. Bump the pinned version to a release built with Go ≥ 1.27 in both workflows.


require (
filippo.io/age v1.3.1
github.com/conductorone/baton-sdk v0.3.17
github.com/conductorone/conductorone-sdk-go v1.29.1
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/pquerna/xjwt v0.3.0
github.com/pterm/pterm v0.12.81
github.com/spf13/cobra v1.9.1
github.com/spf13/viper v1.20.1
github.com/toqueteos/webbrowser v1.2.0
github.com/xhit/go-str2duration/v2 v2.1.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b
golang.org/x/net v0.55.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sync v0.20.0
google.golang.org/grpc v1.73.0
google.golang.org/protobuf v1.36.6
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v3 v3.0.1
)

require (
Expand All @@ -27,38 +32,27 @@ require (
filippo.io/hpke v0.4.0 // indirect
github.com/containerd/console v1.0.5 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/lithammer/fuzzysearch v1.1.8 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sagikazarmark/locafero v0.9.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spyzhov/ajson v0.9.6 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.52.0 // indirect
golang.org/x/term v0.43.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
)

require (
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pquerna/xjwt v0.3.0
github.com/spf13/afero v1.14.0 // indirect
github.com/spf13/cast v1.9.2 // indirect
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6 // indirect
github.com/spf13/viper v1.20.1
github.com/spyzhov/ajson v0.9.6 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b
golang.org/x/oauth2 v0.30.0
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.52.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/term v0.43.0 // indirect
golang.org/x/text v0.37.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v3 v3.0.1
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
)
2 changes: 1 addition & 1 deletion pkg/output/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *tableManager) sortData(header []string, tableData [][]string, out inter
sorter, sorterOk := out.(TableSort)
if sorterOk {
for _, col := range sorter.OrderedSortColumns() {
sortCol := slices.Index(header, col)
sortCol := slices.Index(header, col) //nolint:govet // inline analyzer false positive
if sortCol != -1 {
sortCols = append(sortCols, sortCol)
sortColsMap[sortCol] = true
Expand Down
2 changes: 1 addition & 1 deletion pkg/uhttp/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (t *Transport) make(ctx context.Context) (http.RoundTripper, error) {
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
DualStack: true, //nolint:staticcheck // preserve existing dialer behavior
}).DialContext,
ForceAttemptHTTP2: true,
MaxIdleConns: 100,
Expand Down
Loading