String constructs a summary of the session state
()
| 112 | |
| 113 | // String constructs a summary of the session state |
| 114 | func (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 | |
| 139 | func (s *SessionState) GetClaim(claim string) []string { |
| 140 | if s == nil { |
no outgoing calls