auth

Paddy 2014-09-01 Child:5bf0a5fd1d01

26:c50153e44821 Go to Latest

auth/grant.go

Add Grant type and GrantStore interface. Rough out a Grant type that will handle OAuth2 authorization grants that can be exchanged for access tokens. Rough out a GrantStore interface that will be used to retrieve and store grants.

History
1 package auth
3 import (
4 "time"
6 "secondbit.org/uuid"
7 )
9 type Grant struct {
10 Code string
11 Created time.Time
12 ExpiresIn int32
13 ClientID uuid.ID
14 Scope string
15 RedirectURI string
16 State string
17 }
19 type GrantStore interface {
20 GetGrant(code string) (Grant, error)
21 SaveGrant(grant Grant) error
22 DeleteGrant(id uuid.ID) error
23 }