Type returns the type of the payload.
()
| 63 | |
| 64 | // Type returns the type of the payload. |
| 65 | func (p Payload) Type() Type { |
| 66 | switch { |
| 67 | case p.Google != nil: |
| 68 | return GCP |
| 69 | case p.Amazon != nil: |
| 70 | return AWS |
| 71 | case p.Azure != nil: |
| 72 | return Azure |
| 73 | case p.Issuer == "kubernetes/serviceaccount": |
| 74 | return K8sSA |
| 75 | case p.SHA != "" || len(p.SANs) > 0: |
| 76 | return JWK |
| 77 | case len(p.Audience) > 0 && p.Issuer != "" && p.Subject != "" && !p.Expiry.Time().IsZero() && !p.IssuedAt.Time().IsZero(): |
| 78 | return OIDC |
| 79 | default: |
| 80 | return Unknown |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // GCPGooglePayload represents the Google payload in GCP. |
| 85 | type GCPGooglePayload struct { |
no outgoing calls