feat: token introspection (#83)
* introspect * introspect and client assertion * introspect and client assertion * scopes * token introspection * introspect * refactoring * fixes * clenaup * Update example/internal/mock/storage.go Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com> * clenaup Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
This commit is contained in:
parent
fa92a20615
commit
1518c843de
46 changed files with 1672 additions and 570 deletions
|
@ -73,6 +73,19 @@ func (s *Scopes) MarshalText() ([]byte, error) {
|
|||
return []byte(s.Encode()), nil
|
||||
}
|
||||
|
||||
func (s *Scopes) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal((*s).Encode())
|
||||
}
|
||||
|
||||
func (s *Scopes) UnmarshalJSON(data []byte) error {
|
||||
var str string
|
||||
if err := json.Unmarshal(data, &str); err != nil {
|
||||
return err
|
||||
}
|
||||
*s = strings.Split(str, " ")
|
||||
return nil
|
||||
}
|
||||
|
||||
type Time time.Time
|
||||
|
||||
func (t *Time) UnmarshalJSON(data []byte) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue