MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / String

Method String

pkg/apis/sessions/session_state.go:114–137  ·  view source on GitHub ↗

String constructs a summary of the session state

()

Source from the content-addressed store, hash-verified

112
113// String constructs a summary of the session state
114func (s *SessionState) String() string {
115 o := fmt.Sprintf("Session{email:%s user:%s PreferredUsername:%s", s.Email, s.User, s.PreferredUsername)
116 if s.AccessToken != "" {
117 o += " token:true"
118 }
119 if s.IDToken != "" {
120 o += " id_token:true"
121 }
122 if s.CreatedAt != nil && !s.CreatedAt.IsZero() {
123 o += fmt.Sprintf(" created:%s", s.CreatedAt)
124 }
125 if s.ExpiresOn != nil && !s.ExpiresOn.IsZero() {
126 o += fmt.Sprintf(" expires:%s", s.ExpiresOn)
127 }
128 if s.RefreshToken != "" {
129 o += " refresh_token:true"
130 } else {
131 o += " refresh_token:false"
132 }
133 if len(s.Groups) > 0 {
134 o += fmt.Sprintf(" groups:%v", s.Groups)
135 }
136 return o + "}"
137}
138
139func (s *SessionState) GetClaim(claim string) []string {
140 if s == nil {

Callers 15

getOAuthRedirectURIMethod · 0.45
TestRobotsTxtFunction · 0.45
TestBasicAuthPasswordFunction · 0.45
getEndpointWithCookieMethod · 0.45
GetEndpointMethod · 0.45
AuthenticateMethod · 0.45
TestRequestSignatureFunction · 0.45
Test_noCacheHeadersFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestRobotsTxtFunction · 0.36
TestBasicAuthPasswordFunction · 0.36
getEndpointWithCookieMethod · 0.36
GetEndpointMethod · 0.36
AuthenticateMethod · 0.36
TestRequestSignatureFunction · 0.36
Test_noCacheHeadersFunction · 0.36