Add OIDC provider db model

This commit is contained in:
Akshay Gaikwad
2022-01-20 11:41:05 +05:30
parent de7e491802
commit aa98bcd215

View File

@@ -0,0 +1,32 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type OIDCProvider struct {
bun.BaseModel `bun:"table:authsrv_oidc_provider,alias:oidcprovider"`
Id uuid.UUID `bun:"id,type:uuid,pk,default:uuid_generate_v4()"`
Name string `bun:"name,notnull,unique"`
Description string `bun:"description"`
CreatedAt time.Time `bun:"created_at,notnull,default:current_timestamp"`
ModifiedAt time.Time `bun:"modified_at,notnull,default:current_timestamp"`
ProviderName string `bun:"provider_name,notnull"`
MapperURL string `bun:"mapper_url"`
MapperFilename string `bun:"mapper_filename"`
ClientId string `bun:"client_id,notnull"`
ClientSecret string `bun:"client_secret,notnull"`
Scopes []string `bun:"scopes,notnull"`
IssuerURL string `bun:"issuer_url,notnull"`
AuthURL string `bun:"auth_url"`
TokenURL string `bun:"token_url"`
RequestedClaims map[string]interface{} `bun:"type:jsonb"`
Predefined bool `bun:"predefined,notnull"`
CallbackURL string `bun:"callback_url,notnull"`
Trash bool `bun:"trash,default:false"`
}