feat: add missing IntrospectionResponse getters (#251)

This commit is contained in:
Goran Kovacevic 2022-12-06 11:34:19 +01:00 committed by GitHub
parent 1bed3e1f57
commit 87a545e60b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,16 @@ type IntrospectionResponse interface {
SetAudience(audience []string) SetAudience(audience []string)
SetIssuer(issuer string) SetIssuer(issuer string)
SetJWTID(id string) SetJWTID(id string)
GetScope() []string
GetClientID() string
GetTokenType() string
GetExpiration() time.Time
GetIssuedAt() time.Time
GetNotBefore() time.Time
GetSubject() string
GetAudience() []string
GetIssuer() string
GetJWTID() string
} }
func NewIntrospectionResponse() IntrospectionResponse { func NewIntrospectionResponse() IntrospectionResponse {
@ -144,6 +154,42 @@ func (i *introspectionResponse) GetClaims() map[string]interface{} {
return i.claims return i.claims
} }
func (i *introspectionResponse) GetScope() []string {
return []string(i.Scope)
}
func (i *introspectionResponse) GetClientID() string {
return i.ClientID
}
func (i *introspectionResponse) GetTokenType() string {
return i.TokenType
}
func (i *introspectionResponse) GetExpiration() time.Time {
return time.Time(i.Expiration)
}
func (i *introspectionResponse) GetIssuedAt() time.Time {
return time.Time(i.IssuedAt)
}
func (i *introspectionResponse) GetNotBefore() time.Time {
return time.Time(i.NotBefore)
}
func (i *introspectionResponse) GetAudience() []string {
return []string(i.Audience)
}
func (i *introspectionResponse) GetIssuer() string {
return i.Issuer
}
func (i *introspectionResponse) GetJWTID() string {
return i.JWTID
}
func (i *introspectionResponse) SetActive(active bool) { func (i *introspectionResponse) SetActive(active bool) {
i.Active = active i.Active = active
} }