Skip to content
Merged
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
fix(oidc): no trailing colon on non-action events in claim
  • Loading branch information
ecrupper committed Sep 17, 2025
commit 667c4ef5d563399084e55eb1568a9e42e4e26e83
7 changes: 6 additions & 1 deletion internal/token/mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,19 @@ func (tm *Manager) MintIDToken(ctx context.Context, mto *MintTokenOpts, db datab
return "", errors.New("missing build sender for ID token")
}

event := mto.Build.GetEvent()
if len(mto.Build.GetEventAction()) > 0 {
event = fmt.Sprintf("%s:%s", mto.Build.GetEvent(), mto.Build.GetEventAction())
}

// set claims based on input
claims.Actor = mto.Build.GetSender()
claims.ActorSCMID = mto.Build.GetSenderSCMID()
claims.Branch = mto.Build.GetBranch()
claims.BuildNumber = strconv.FormatInt(mto.Build.GetNumber(), 10)
claims.BuildID = strconv.FormatInt(mto.Build.GetID(), 10)
claims.Repo = mto.Repo
claims.Event = fmt.Sprintf("%s:%s", mto.Build.GetEvent(), mto.Build.GetEventAction())
claims.Event = event
claims.PullFork = strconv.FormatBool(mto.Build.GetFork())
claims.SHA = mto.Build.GetCommit()
claims.Ref = mto.Build.GetRef()
Expand Down