Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BB-44] Unfork privx-sdk-go #2

Merged
merged 3 commits into from
Jul 24, 2024
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
12 changes: 7 additions & 5 deletions cmd/baton-privx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ import (
var (
baseUrlField = field.StringField(
"base-url",
field.WithDescription("The hostname (URL) for your PrivX instance. ($BATON_BASE_URL)"),
field.WithDescription("The hostname (URL) for your PrivX instance"),
)
apiClientIdField = field.StringField(
"api-client-id",
field.WithDescription("The API Client ID (a UUID.) ($BATON_API_CLIENT_ID)"),
field.WithDescription("The API Client ID (a UUID.)"),
)
apiClientSecretField = field.StringField(
"api-client-secret",
field.WithDescription("The API Client Secret (a base64 string.) ($BATON_API_CLIENT_SECRET)"),
field.WithDescription("The API Client Secret (a base64 string.)"),
)
oauthClientIdField = field.StringField(
"oauth-client-id",
field.WithDescription("The OAuth Client ID (e.g. \"privx-external\".) ($BATON_OAUTH_CLIENT_ID)"),
field.WithDescription("The OAuth Client ID (e.g. \"privx-external\".)"),
)
oauthClientSecretField = field.StringField(
"oauth-client-secret",
field.WithDescription("The OAuth Client Secret (a base64 string.) ($BATON_OAUTH_CLIENT_SECRET)"),
field.WithDescription("The OAuth Client Secret (a base64 string.)"),
)
)

Expand All @@ -40,6 +40,8 @@ var configurationFields = []field.SchemaField{
oauthClientSecretField,
}

var configuration = field.NewConfiguration(configurationFields)

// validateConfig is run after the configuration is loaded, and should return an error if it isn't valid.
func validateConfig(ctx context.Context, v *viper.Viper) error {
if v.GetString(baseUrlField.FieldName) == "" {
Expand Down
3 changes: 1 addition & 2 deletions cmd/baton-privx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ func main() {
ctx,
"baton-privx",
getConnector,
configurationFields,
nil,
configuration,
)
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
Expand Down
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ module github.com/conductorone/baton-privx
go 1.21

require (
github.com/SSHcom/privx-sdk-go v1.35.0
github.com/conductorone/baton-sdk v0.2.2
github.com/SSHcom/privx-sdk-go v1.35.1
github.com/conductorone/baton-sdk v0.2.9
Copy link
Contributor

Choose a reason for hiding this comment

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

The newer version of baton-sdk has a slighly different DefineConfiguration function. It accepts a whole config, not just schema fields. You'll have to tweak that before it'll build.

Copy link
Contributor

Choose a reason for hiding this comment

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

github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/spf13/viper v1.18.2
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
)

replace github.com/SSHcom/privx-sdk-go v1.35.0 => github.com/conductorone/privx-sdk-go v0.0.1

require (
filippo.io/age v1.1.1 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/SSHcom/privx-sdk-go v1.35.1 h1:/5bqR11cxDfiFlZvgPij/eGWKomzuiOvcJKpK5ltYVk=
github.com/SSHcom/privx-sdk-go v1.35.1/go.mod h1:8fUcouMBX54uARVPAvYjIgGMPHXZ9T5/qbUFHmjGmSQ=
github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA=
github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=
Expand Down Expand Up @@ -52,10 +54,8 @@ github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/conductorone/baton-sdk v0.2.2 h1:MP/RWf65pq6bAPv5KrKc7mx1EFK1QOciJbrPVDp/Vxk=
github.com/conductorone/baton-sdk v0.2.2/go.mod h1:cg5FyUcJnD7xK5SPbHe/KNpwUVVlpHJ9rnmd3UwxSkU=
github.com/conductorone/privx-sdk-go v0.0.1 h1:bigz8MEkOuLJ3xJVPvOKEs85WHCH7MdMHbKihq4DLSo=
github.com/conductorone/privx-sdk-go v0.0.1/go.mod h1:8fUcouMBX54uARVPAvYjIgGMPHXZ9T5/qbUFHmjGmSQ=
github.com/conductorone/baton-sdk v0.2.9 h1:mXiq9uUHw8gsicPgaLrP2QZECFIT1QB3LWmHf0l7wOg=
github.com/conductorone/baton-sdk v0.2.9/go.mod h1:cg5FyUcJnD7xK5SPbHe/KNpwUVVlpHJ9rnmd3UwxSkU=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -190,8 +190,8 @@ github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ=
github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
Expand Down
23 changes: 13 additions & 10 deletions vendor/github.com/SSHcom/privx-sdk-go/api/rolestore/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/SSHcom/privx-sdk-go/oauth/authtoken.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/SSHcom/privx-sdk-go/pkce/pkce.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/SSHcom/privx-sdk-go/restapi/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading