Documentation ¶
Index ¶
- Constants
- Variables
- func SubjectFromToken(token *jwt.Token) string
- func TestingToken(t *testing.T) *jwt.Token
- func TestingToken2(t *testing.T) *jwt.Token
- func TestingTransport(t *testing.T) http.RoundTripper
- func TokenHasRole(token *jwt.Token, expectedRole string) error
- func TokenWithClaims(bearer string, pubkey interface{}, allowUnsafe bool) (*jwt.Token, jwt.MapClaims, error)
- type ActionToken
- func (*ActionToken) Descriptor() ([]byte, []int)
- func (m *ActionToken) GetAsid() string
- func (m *ActionToken) GetAud() string
- func (m *ActionToken) GetAuthTime() *time.Time
- func (m *ActionToken) GetAzp() string
- func (m *ActionToken) GetExp() *time.Time
- func (m *ActionToken) GetIat() *time.Time
- func (m *ActionToken) GetIss() string
- func (m *ActionToken) GetJti() string
- func (m *ActionToken) GetNbf() float32
- func (m *ActionToken) GetNonce() string
- func (m *ActionToken) GetScope() string
- func (m *ActionToken) GetSessionState() string
- func (m *ActionToken) GetSub() string
- func (m *ActionToken) GetTyp() string
- func (m *ActionToken) Marshal() (dAtA []byte, err error)
- func (m *ActionToken) MarshalTo(dAtA []byte) (int, error)
- func (m *ActionToken) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ActionToken) ProtoMessage()
- func (m *ActionToken) Reset()
- func (m *ActionToken) Size() (n int)
- func (m *ActionToken) String() string
- func (m *ActionToken) Unmarshal(dAtA []byte) error
- func (m *ActionToken) XXX_DiscardUnknown()
- func (m *ActionToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ActionToken) XXX_Merge(src proto.Message)
- func (m *ActionToken) XXX_Size() int
- func (m *ActionToken) XXX_Unmarshal(b []byte) error
- type Claims
- func (*Claims) Descriptor() ([]byte, []int)
- func (m *Claims) GetActionToken() *ActionToken
- func (m *Claims) GetEmail() string
- func (m *Claims) GetEmailVerified() bool
- func (m *Claims) GetFamilyName() string
- func (m *Claims) GetGivenName() string
- func (m *Claims) GetPreferredUsername() string
- func (m *Claims) Marshal() (dAtA []byte, err error)
- func (m *Claims) MarshalTo(dAtA []byte) (int, error)
- func (m *Claims) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Claims) ProtoMessage()
- func (m *Claims) Reset()
- func (m *Claims) Size() (n int)
- func (m *Claims) String() string
- func (m *Claims) Unmarshal(dAtA []byte) error
- func (m *Claims) XXX_DiscardUnknown()
- func (m *Claims) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Claims) XXX_Merge(src proto.Message)
- func (m *Claims) XXX_Size() int
- func (m *Claims) XXX_Unmarshal(b []byte) error
- type Client
- type Opts
Constants ¶
View Source
const KeycloakBaseURL = "https://id.pathwar.land"
Variables ¶
Functions ¶
func SubjectFromToken ¶
func TestingTransport ¶
func TestingTransport(t *testing.T) http.RoundTripper
Types ¶
type ActionToken ¶
type ActionToken struct { Typ string `protobuf:"bytes,1,opt,name=typ,proto3" json:"typ,omitempty"` Iat *time.Time `protobuf:"bytes,2,opt,name=iat,proto3,stdtime" json:"iat,omitempty"` Exp *time.Time `protobuf:"bytes,3,opt,name=exp,proto3,stdtime" json:"exp,omitempty"` Sub string `protobuf:"bytes,4,opt,name=sub,proto3" json:"sub,omitempty"` Azp string `protobuf:"bytes,5,opt,name=azp,proto3" json:"azp,omitempty"` Iss string `protobuf:"bytes,6,opt,name=iss,proto3" json:"iss,omitempty"` Aud string `protobuf:"bytes,7,opt,name=aud,proto3" json:"aud,omitempty"` Asid string `protobuf:"bytes,8,opt,name=asid,proto3" json:"asid,omitempty"` Nonce string `protobuf:"bytes,9,opt,name=nonce,proto3" json:"nonce,omitempty"` // additional keycloak internals SessionState string `protobuf:"bytes,100,opt,name=session_state,json=sessionState,proto3" json:"session_state,omitempty"` Scope string `protobuf:"bytes,101,opt,name=scope,proto3" json:"scope,omitempty"` Nbf float32 `protobuf:"fixed32,102,opt,name=nbf,proto3" json:"nbf,omitempty"` Jti string `protobuf:"bytes,103,opt,name=jti,proto3" json:"jti,omitempty"` AuthTime *time.Time `protobuf:"bytes,104,opt,name=auth_time,json=authTime,proto3,stdtime" json:"auth_time,omitempty"` }
See https://www.keycloak.org/docs/latest/server_development/index.html#_action_token_anatomy
func (*ActionToken) Descriptor ¶
func (*ActionToken) Descriptor() ([]byte, []int)
func (*ActionToken) GetAsid ¶
func (m *ActionToken) GetAsid() string
func (*ActionToken) GetAud ¶
func (m *ActionToken) GetAud() string
func (*ActionToken) GetAuthTime ¶
func (m *ActionToken) GetAuthTime() *time.Time
func (*ActionToken) GetAzp ¶
func (m *ActionToken) GetAzp() string
func (*ActionToken) GetExp ¶
func (m *ActionToken) GetExp() *time.Time
func (*ActionToken) GetIat ¶
func (m *ActionToken) GetIat() *time.Time
func (*ActionToken) GetIss ¶
func (m *ActionToken) GetIss() string
func (*ActionToken) GetJti ¶
func (m *ActionToken) GetJti() string
func (*ActionToken) GetNbf ¶
func (m *ActionToken) GetNbf() float32
func (*ActionToken) GetNonce ¶
func (m *ActionToken) GetNonce() string
func (*ActionToken) GetScope ¶
func (m *ActionToken) GetScope() string
func (*ActionToken) GetSessionState ¶
func (m *ActionToken) GetSessionState() string
func (*ActionToken) GetSub ¶
func (m *ActionToken) GetSub() string
func (*ActionToken) GetTyp ¶
func (m *ActionToken) GetTyp() string
func (*ActionToken) Marshal ¶
func (m *ActionToken) Marshal() (dAtA []byte, err error)
func (*ActionToken) MarshalToSizedBuffer ¶
func (m *ActionToken) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ActionToken) ProtoMessage ¶
func (*ActionToken) ProtoMessage()
func (*ActionToken) Reset ¶
func (m *ActionToken) Reset()
func (*ActionToken) Size ¶
func (m *ActionToken) Size() (n int)
func (*ActionToken) String ¶
func (m *ActionToken) String() string
func (*ActionToken) Unmarshal ¶
func (m *ActionToken) Unmarshal(dAtA []byte) error
func (*ActionToken) XXX_DiscardUnknown ¶
func (m *ActionToken) XXX_DiscardUnknown()
func (*ActionToken) XXX_Marshal ¶
func (m *ActionToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ActionToken) XXX_Merge ¶
func (m *ActionToken) XXX_Merge(src proto.Message)
func (*ActionToken) XXX_Size ¶
func (m *ActionToken) XXX_Size() int
func (*ActionToken) XXX_Unmarshal ¶
func (m *ActionToken) XXX_Unmarshal(b []byte) error
type Claims ¶
type Claims struct { PreferredUsername string `protobuf:"bytes,1,opt,name=preferred_username,json=preferredUsername,proto3" json:"preferred_username,omitempty"` Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` EmailVerified bool `protobuf:"varint,3,opt,name=email_verified,json=emailVerified,proto3" json:"email_verified,omitempty"` FamilyName string `protobuf:"bytes,4,opt,name=family_name,json=familyName,proto3" json:"family_name,omitempty"` GivenName string `protobuf:"bytes,5,opt,name=given_name,json=givenName,proto3" json:"given_name,omitempty"` ActionToken *ActionToken `protobuf:"bytes,100,opt,name=action_token,json=actionToken,proto3" json:"action_token,omitempty"` }
func ClaimsFromToken ¶
func TestingClaims ¶
func (*Claims) Descriptor ¶
func (*Claims) GetActionToken ¶
func (m *Claims) GetActionToken() *ActionToken
func (*Claims) GetEmailVerified ¶
func (*Claims) GetFamilyName ¶
func (*Claims) GetGivenName ¶
func (*Claims) GetPreferredUsername ¶
func (*Claims) MarshalToSizedBuffer ¶
func (*Claims) ProtoMessage ¶
func (*Claims) ProtoMessage()
func (*Claims) XXX_DiscardUnknown ¶
func (m *Claims) XXX_DiscardUnknown()
func (*Claims) XXX_Marshal ¶
func (*Claims) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.