Add --audience-claim for GCR Receivers
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
@@ -90,10 +90,11 @@ type Options struct {
|
||||
GitHubAppBaseURL string
|
||||
|
||||
// Receiver options
|
||||
ReceiverType string
|
||||
Token string
|
||||
Hostname string
|
||||
EmailClaim string
|
||||
ReceiverType string
|
||||
Token string
|
||||
Hostname string
|
||||
EmailClaim string
|
||||
AudienceClaim string
|
||||
}
|
||||
|
||||
type VerificationCrt struct {
|
||||
|
||||
@@ -306,7 +306,11 @@ func GenerateReceiver(options Options) (*manifestgen.Manifest, error) {
|
||||
return nil, fmt.Errorf("email-claim is required for gcr receiver type")
|
||||
}
|
||||
secret.StringData[EmailSecretKey] = options.EmailClaim
|
||||
secret.StringData[AudienceSecretKey] = webhookURL
|
||||
if options.AudienceClaim != "" {
|
||||
secret.StringData[AudienceSecretKey] = options.AudienceClaim
|
||||
} else {
|
||||
secret.StringData[AudienceSecretKey] = webhookURL
|
||||
}
|
||||
}
|
||||
|
||||
return secretToManifest(secret, options)
|
||||
|
||||
Reference in New Issue
Block a user