MCPcopy
hub / github.com/smallstep/cli / Type

Method Type

token/parse.go:65–82  ·  view source on GitHub ↗

Type returns the type of the payload.

()

Source from the content-addressed store, hash-verified

63
64// Type returns the type of the payload.
65func (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.
85type GCPGooglePayload struct {

Callers 12

TestPayload_TypeFunction · 0.95
checkOTPFunction · 0.80
CreateSignRequestMethod · 0.80
configActionFunction · 0.80
signCertificateActionFunction · 0.80
initActionFunction · 0.80
certificateActionFunction · 0.80
Test_parseECDSAFunction · 0.80
InspectCertificateFunction · 0.80
PublicKeyFunction · 0.80
publicKeyTypeAndSizeFunction · 0.80
parseResponseFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestPayload_TypeFunction · 0.76
checkOTPFunction · 0.64
Test_parseECDSAFunction · 0.64