initiall commit

This commit is contained in:
Tomas Dvorak
2026-04-10 12:03:31 +02:00
commit 7ddfb1f52b
276 changed files with 37629 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package models
import "github.com/google/uuid"
type ActorType string
const (
ActorTypeUser ActorType = "user"
ActorTypeAPIKey ActorType = "api_key"
)
type Actor struct {
Type ActorType
UserID *uuid.UUID
AuthSubject string
Email string
EmailVerified bool
Name string
SessionID string
ProjectID *uuid.UUID
OrganizationID *uuid.UUID
APIKeyID *uuid.UUID
APIKeyPrefix string
}
func (a *Actor) IsUser() bool {
return a != nil && a.Type == ActorTypeUser
}
func (a *Actor) IsAPIKey() bool {
return a != nil && a.Type == ActorTypeAPIKey
}