Access tokens, server, moving things
- Added placeholder funcs for access tokens - Moved an error definition and added another constant - Changed (passkey) auth fail to return a json error for now - TODO: Change that into checking for a provided access token before failing
This commit is contained in:
parent
4f761c20c0
commit
391d8b1b48
5 changed files with 56 additions and 6 deletions
44
storage/accessTokens.go
Normal file
44
storage/accessTokens.go
Normal file
|
@ -0,0 +1,44 @@
|
|||
package storage
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type AccessToken struct {
|
||||
gorm.Model
|
||||
BelongsToUserId string
|
||||
Name string
|
||||
Token string
|
||||
ExpiresAt time.Time
|
||||
}
|
||||
|
||||
func (s *Storage) GetTokensForAccId(accId uint) ([]AccessToken, error) {
|
||||
// TODO: Implement me
|
||||
panic("Not implemented")
|
||||
}
|
||||
|
||||
func (s *Storage) NewAccessToken(
|
||||
forAccId uint,
|
||||
name string,
|
||||
expiresAt time.Time,
|
||||
) (*AccessToken, error) {
|
||||
// TODO: Implement me
|
||||
panic("Not implemented")
|
||||
}
|
||||
|
||||
func (s *Storage) ExtendToken(accId uint, newExpiry time.Time) error {
|
||||
// TODO: Implement me
|
||||
panic("Not implemented")
|
||||
}
|
||||
|
||||
func (s *Storage) RenameToken(accId, oldName string, newName string) error {
|
||||
// TODO: Implement me
|
||||
panic("Not implemented")
|
||||
}
|
||||
|
||||
func (s *Storage) DiscardToken(accId uint, name string) error {
|
||||
// TODO: Implement me
|
||||
panic("Not implemented")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue