diff --git a/api/oi_config.go b/api/oi_config.go index 2390b750a..d17174338 100644 --- a/api/oi_config.go +++ b/api/oi_config.go @@ -41,10 +41,12 @@ func GetOpenIDConfig(c *gin.Context) { "exp", "iat", "iss", + "aud", "build_number", "repo", "token_type", - "build_sender", + "actor", + "commands", "image", "request", }, diff --git a/internal/token/mint.go b/internal/token/mint.go index 8b4f12a90..b223905e8 100644 --- a/internal/token/mint.go +++ b/internal/token/mint.go @@ -21,7 +21,7 @@ import ( type Claims struct { BuildID int64 `json:"build_id,omitempty"` BuildNumber int `json:"build_number,omitempty"` - BuildSender string `json:"build_sender,omitempty"` + Actor string `json:"actor,omitempty"` IsActive bool `json:"is_active,omitempty"` IsAdmin bool `json:"is_admin,omitempty"` Repo string `json:"repo,omitempty"` @@ -104,7 +104,7 @@ func (tm *Manager) MintToken(mto *MintTokenOpts) (string, error) { 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() + claims.Actor = mto.Build.GetSender() claims.Image = mto.Image claims.Request = mto.Request claims.Commands = mto.Commands @@ -148,7 +148,7 @@ func (tm *Manager) MintIDToken(mto *MintTokenOpts, db database.Interface) (strin // set claims based on input claims.BuildNumber = mto.Build.GetNumber() - claims.BuildSender = mto.Build.GetSender() + claims.Actor = mto.Build.GetSender() claims.Repo = mto.Repo claims.Subject = fmt.Sprintf("repo:%s:ref:%s:event:%s", mto.Repo, mto.Build.GetRef(), mto.Build.GetEvent()) claims.Audience = mto.Audience