mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-07-17 08:19:53 +00:00
39 lines
909 B
Go
39 lines
909 B
Go
package api
|
|
|
|
import (
|
|
"github.com/pocket-id/pocket-id/backend/internal/model"
|
|
datatype "github.com/pocket-id/pocket-id/backend/internal/model/types"
|
|
"github.com/pocket-id/pocket-id/backend/internal/oidc"
|
|
)
|
|
|
|
type API struct {
|
|
model.Base
|
|
|
|
Name string `sortable:"true"`
|
|
Audience string `sortable:"true"`
|
|
UpdatedAt *datatype.DateTime
|
|
|
|
Permissions []Permission `gorm:"foreignKey:APIID;references:ID;constraint:OnDelete:CASCADE"`
|
|
}
|
|
|
|
type Permission struct {
|
|
model.Base
|
|
|
|
APIID string `gorm:"column:api_id"`
|
|
Key string `sortable:"true"`
|
|
Name string
|
|
Description *string
|
|
}
|
|
|
|
func (Permission) TableName() string { return "api_permissions" }
|
|
|
|
type OidcClientAllowedAPIPermission struct {
|
|
OidcClientID string
|
|
APIPermissionID string
|
|
SubjectType oidc.SubjectType
|
|
}
|
|
|
|
func (OidcClientAllowedAPIPermission) TableName() string {
|
|
return "oidc_clients_allowed_api_permissions"
|
|
}
|