mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-27 02:59:04 +01:00
feat: allow admins to auto grant APIs to CIMD clients (#1692)
This commit is contained in:
@@ -9,9 +9,10 @@ import (
|
||||
type API struct {
|
||||
model.Base
|
||||
|
||||
Name string `sortable:"true"`
|
||||
Audience string `sortable:"true"`
|
||||
UpdatedAt *datatype.DateTime
|
||||
Name string `sortable:"true"`
|
||||
Audience string `sortable:"true"`
|
||||
UpdatedAt *datatype.DateTime
|
||||
AllowCIMDClients bool `gorm:"column:allow_cimd_clients"`
|
||||
|
||||
Permissions []Permission `gorm:"foreignKey:APIID;references:ID;constraint:OnDelete:CASCADE"`
|
||||
}
|
||||
@@ -19,14 +20,25 @@ type API struct {
|
||||
type Permission struct {
|
||||
model.Base
|
||||
|
||||
APIID string `gorm:"column:api_id"`
|
||||
Key string `sortable:"true"`
|
||||
Name string
|
||||
Description *string
|
||||
APIID string `gorm:"column:api_id"`
|
||||
Key string `sortable:"true"`
|
||||
Name string
|
||||
Description *string
|
||||
AllowedForCIMDClients bool `gorm:"column:allowed_for_cimd_clients"`
|
||||
}
|
||||
|
||||
func (Permission) TableName() string { return "api_permissions" }
|
||||
|
||||
type OidcClientAllowedAPI struct {
|
||||
OidcClientID string
|
||||
APIID string `gorm:"column:api_id"`
|
||||
SubjectType oidc.SubjectType
|
||||
}
|
||||
|
||||
func (OidcClientAllowedAPI) TableName() string {
|
||||
return "oidc_clients_allowed_apis"
|
||||
}
|
||||
|
||||
type OidcClientAllowedAPIPermission struct {
|
||||
OidcClientID string
|
||||
APIPermissionID string
|
||||
|
||||
Reference in New Issue
Block a user