Skip to content

Commit

Permalink
Using kubernetes authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobbrewer1 committed Nov 10, 2024
1 parent 49e095a commit cdc78f6
Show file tree
Hide file tree
Showing 11 changed files with 319 additions and 9 deletions.
5 changes: 1 addition & 4 deletions cmd/data/cmd_serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ func (s *serveCmd) setup(ctx context.Context, r *mux.Router) (err error) {
vc, err := vaulty.NewClient(
vaulty.WithContext(ctx),
vaulty.WithGeneratedVaultClient(v.GetString("vault.address")),
vaulty.WithUserPassAuth(
v.GetString("vault.auth.username"),
v.GetString("vault.auth.password"),
),
vaulty.WithKubernetesAuthDefault(),
vaulty.WithKvv2Mount(v.GetString("vault.kvv2_mount")),
)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/jacobbrewer1/pagefilter v0.1.4
github.com/jacobbrewer1/patcher v0.1.10
github.com/jacobbrewer1/uhttp v0.0.4
github.com/jacobbrewer1/vaulty v0.1.3
github.com/jacobbrewer1/vaulty v0.1.4
github.com/jacobbrewer1/workerpool v0.0.2
github.com/jmoiron/sqlx v1.4.0
github.com/oapi-codegen/runtime v1.1.1
Expand Down Expand Up @@ -55,6 +55,7 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/vault/api v1.15.0 // indirect
github.com/hashicorp/vault/api/auth/approle v0.8.0 // indirect
github.com/hashicorp/vault/api/auth/kubernetes v0.8.0 // indirect
github.com/hashicorp/vault/api/auth/userpass v0.8.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ github.com/hashicorp/vault/api v1.15.0 h1:O24FYQCWwhwKnF7CuSqP30S51rTV7vz1iACXE/
github.com/hashicorp/vault/api v1.15.0/go.mod h1:+5YTO09JGn0u+b6ySD/LLVf8WkJCPLAL2Vkmrn2+CM8=
github.com/hashicorp/vault/api/auth/approle v0.8.0 h1:FuVtWZ0xD6+wz1x0l5s0b4852RmVXQNEiKhVXt6lfQY=
github.com/hashicorp/vault/api/auth/approle v0.8.0/go.mod h1:NV7O9r5JUtNdVnqVZeMHva81AIdpG0WoIQohNt1VCPM=
github.com/hashicorp/vault/api/auth/kubernetes v0.8.0 h1:6jPcORq7OHwf+MCbaaUmiBvMhETAaZ7+i97WfZtF5kc=
github.com/hashicorp/vault/api/auth/kubernetes v0.8.0/go.mod h1:nfl5sRUUork0ZSfV3xf+pgAFQSD5kSkL0k9axg523DM=
github.com/hashicorp/vault/api/auth/userpass v0.8.0 h1:JFFzMld+VO/S1v8HQNJzcy+3o+xfx/iH49dsiQ1G5jk=
github.com/hashicorp/vault/api/auth/userpass v0.8.0/go.mod h1:+XbsSnbbyo+yjySfKcIsyl28kO4C/c4Czo7og0XCtUo=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
Expand All @@ -137,8 +139,8 @@ github.com/jacobbrewer1/patcher v0.1.10 h1:k0T4/hW6F5r5bQ+WDzeaBg0u5ykAr6shQ7Z1P
github.com/jacobbrewer1/patcher v0.1.10/go.mod h1:DbPetwfn5Fgarwn5VOjALRjNflSX0rbkGssZ0cRsOlo=
github.com/jacobbrewer1/uhttp v0.0.4 h1:3RrRmz0fjsnLKuAs5fkflOcsjuBFoL0XvC6Xct/TDCk=
github.com/jacobbrewer1/uhttp v0.0.4/go.mod h1:qwLAdGw4SLYJY2MS0sE1m/w1ILTr61bjwRtlbGwqo5c=
github.com/jacobbrewer1/vaulty v0.1.3 h1:0L3JnmzqcxL91COVMUkT+HWje3jTy9YjYbpFOyGmHBo=
github.com/jacobbrewer1/vaulty v0.1.3/go.mod h1:c1miXLEnUIejWOZpp2mEl7Jc/0jlVPtcKTrPbmnASXk=
github.com/jacobbrewer1/vaulty v0.1.4 h1:JLcSDX5f1UMBxNNzCxQ0neqV4Mvw6030OgxE44B/pqI=
github.com/jacobbrewer1/vaulty v0.1.4/go.mod h1:BDrZxaM1mMWSqJ3UXHGOQyy6+2l5NxjAjva2V7ijwNI=
github.com/jacobbrewer1/workerpool v0.0.2 h1:H5+PRi1JLtOvPXHiER6+MCEfqIMn8d0MyZ0Mi4emYqM=
github.com/jacobbrewer1/workerpool v0.0.2/go.mod h1:PKV+PF+dbELi8p+abwzVDRy2FtgpdLJCFKlsz5thaYY=
github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg=
Expand Down
92 changes: 92 additions & 0 deletions vendor/github.com/hashicorp/vault/api/auth/kubernetes/LICENSE

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

136 changes: 136 additions & 0 deletions vendor/github.com/hashicorp/vault/api/auth/kubernetes/kubernetes.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/jacobbrewer1/vaulty/.clog.toml

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

3 changes: 3 additions & 0 deletions vendor/github.com/jacobbrewer1/vaulty/Makefile

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

36 changes: 36 additions & 0 deletions vendor/github.com/jacobbrewer1/vaulty/client_options.go

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

5 changes: 5 additions & 0 deletions vendor/github.com/jacobbrewer1/vaulty/consts.go

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

35 changes: 35 additions & 0 deletions vendor/github.com/jacobbrewer1/vaulty/kubernetes.go

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

Loading

0 comments on commit cdc78f6

Please sign in to comment.