Note: keys are stored in plaintext
| 11 | |
| 12 | // Note: keys are stored in plaintext |
| 13 | type APIKey struct { |
| 14 | KeyID int64 `xorm:"pk autoincr 'key_id'" json:"key_id"` |
| 15 | APIKey string `xorm:"'api_key'" json:"api_key"` |
| 16 | Name string `xorm:"'name'" json:"name"` |
| 17 | UserID int64 `xorm:"'user_id'" json:"user_id"` |
| 18 | RevokedAt *time.Time `xorm:"timestampz 'revoked_at'" json:"revoked_at"` |
| 19 | ExpiresAt time.Time `xorm:"timestampz 'expires_at'" json:"expires_at"` |
| 20 | CreatedAt time.Time `xorm:"timestampz created" json:"created_at"` |
| 21 | } |
| 22 | |
| 23 | func instantiateAPIKeysTable() error { |
| 24 | return databaseEngine.Table(apiKeysTable).Sync2(new(APIKey)) |
nothing calls this directly
no outgoing calls
no test coverage detected