auth
auth/grant.go
Rough out profiles. Create a Profile type that stores information about user profiles. Create a Login type that stores information about a login strategy for user profiles. This is necessary so that a user can login with their username or email address, with usernames not being required if an email address is supplied and email addresses not being required if a username is supplied.
| paddy@26 | 1 package auth |
| paddy@26 | 2 |
| paddy@26 | 3 import ( |
| paddy@26 | 4 "time" |
| paddy@26 | 5 |
| paddy@26 | 6 "secondbit.org/uuid" |
| paddy@26 | 7 ) |
| paddy@26 | 8 |
| paddy@26 | 9 type Grant struct { |
| paddy@26 | 10 Code string |
| paddy@26 | 11 Created time.Time |
| paddy@26 | 12 ExpiresIn int32 |
| paddy@26 | 13 ClientID uuid.ID |
| paddy@26 | 14 Scope string |
| paddy@26 | 15 RedirectURI string |
| paddy@26 | 16 State string |
| paddy@26 | 17 } |
| paddy@26 | 18 |
| paddy@26 | 19 type GrantStore interface { |
| paddy@26 | 20 GetGrant(code string) (Grant, error) |
| paddy@26 | 21 SaveGrant(grant Grant) error |
| paddy@26 | 22 DeleteGrant(id uuid.ID) error |
| paddy@26 | 23 } |