Skip to content

Commit

Permalink
pull in types and add event to subject
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed May 16, 2024
1 parent ebc9518 commit 9b451c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/go-vela/server

go 1.21.9

replace github.com/go-vela/types => ../types

require (
github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb
github.com/DATA-DOG/go-sqlmock v1.5.2
Expand All @@ -18,7 +16,7 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/gin-gonic/gin v1.9.1
github.com/go-playground/assert/v2 v2.2.0
github.com/go-vela/types v0.23.4-0.20240417135026-fb4a95c30338
github.com/go-vela/types v0.23.4-0.20240516161114-57d6b8f77b10
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-cmp v0.6.0
github.com/google/go-github/v61 v61.0.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/go-vela/types v0.23.4-0.20240516161114-57d6b8f77b10 h1:VQxIqxpJKIOzRnMi4z/d+EOo7jc5PXCnlUvZZl5ajzA=
github.com/go-vela/types v0.23.4-0.20240516161114-57d6b8f77b10/go.mod h1:vISsYDdjz9RPEK6qZ+MxtrdZEjTVU4K30NomB3826u8=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down
4 changes: 2 additions & 2 deletions internal/token/mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (tm *Manager) MintToken(mto *MintTokenOpts) (string, error) {
}

claims.Repo = mto.Repo
claims.Subject = fmt.Sprintf("repo:%s:ref:%s", mto.Repo, mto.Build.GetRef())
claims.Subject = fmt.Sprintf("repo:%s:ref:%s:event:%s", mto.Repo, mto.Build.GetRef(), mto.Build.GetEvent())
claims.BuildID = mto.Build.GetID()
claims.BuildNumber = mto.Build.GetNumber()
claims.BuildSender = mto.Build.GetSender()
Expand Down Expand Up @@ -147,7 +147,7 @@ func (tm *Manager) MintIDToken(mto *MintTokenOpts, db database.Interface) (strin
claims.BuildNumber = mto.Build.GetNumber()
claims.BuildSender = mto.Build.GetSender()
claims.Repo = mto.Repo
claims.Subject = fmt.Sprintf("repo:%s:ref:%s", mto.Repo, mto.Build.GetRef())
claims.Subject = fmt.Sprintf("repo:%s:ref:%s:event:%s", mto.Repo, mto.Build.GetRef(), mto.Build.GetEvent())
claims.Audience = mto.Audience
claims.TokenType = mto.TokenType
claims.Image = mto.Image
Expand Down

0 comments on commit 9b451c6

Please sign in to comment.