casdoor

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCasdoorAdapter

func InitCasdoorAdapter()

Types

type Adapter

type Adapter struct {
	Engine *xorm.Engine
	// contains filtered or unexported fields
}

Adapter represents the MySQL adapter for policy storage.

func NewAdapter

func NewAdapter(driverName string, dataSourceName string, dbName string) *Adapter

NewAdapter is the constructor for Adapter.

type Application

type Application struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName         string   `xorm:"varchar(100)" json:"displayName"`
	HomepageUrl         string   `xorm:"varchar(100)" json:"homepageUrl"`
	Description         string   `xorm:"varchar(100)" json:"description"`
	Organization        string   `xorm:"varchar(100)" json:"organization"`
	Cert                string   `xorm:"varchar(100)" json:"cert"`
	EnablePassword      bool     `json:"enablePassword"`
	EnableSignUp        bool     `json:"enableSignUp"`
	EnableSigninSession bool     `json:"enableSigninSession"`
	EnableAutoSignin    bool     `json:"enableAutoSignin"`
	EnableCodeSignin    bool     `json:"enableCodeSignin"`
	EnableSamlCompress  bool     `json:"enableSamlCompress"`
	EnableWebAuthn      bool     `json:"enableWebAuthn"`
	EnableLinkWithEmail bool     `json:"enableLinkWithEmail"`
	OrgChoiceMode       string   `json:"orgChoiceMode"`
	SamlReplyUrl        string   `xorm:"varchar(100)" json:"samlReplyUrl"`
	GrantTypes          []string `xorm:"varchar(1000)" json:"grantTypes"`
	Tags                []string `xorm:"mediumtext" json:"tags"`

	ClientId             string   `xorm:"varchar(100)" json:"clientId"`
	ClientSecret         string   `xorm:"varchar(100)" json:"clientSecret"`
	RedirectUris         []string `xorm:"varchar(1000)" json:"redirectUris"`
	TokenFormat          string   `xorm:"varchar(100)" json:"tokenFormat"`
	ExpireInHours        int      `json:"expireInHours"`
	RefreshExpireInHours int      `json:"refreshExpireInHours"`
	SignupUrl            string   `xorm:"varchar(200)" json:"signupUrl"`
	SigninUrl            string   `xorm:"varchar(200)" json:"signinUrl"`
	ForgetUrl            string   `xorm:"varchar(200)" json:"forgetUrl"`
	AffiliationUrl       string   `xorm:"varchar(100)" json:"affiliationUrl"`
	TermsOfUse           string   `xorm:"varchar(100)" json:"termsOfUse"`
	SignupHtml           string   `xorm:"mediumtext" json:"signupHtml"`
	SigninHtml           string   `xorm:"mediumtext" json:"signinHtml"`
	FormCss              string   `xorm:"text" json:"formCss"`
	FormCssMobile        string   `xorm:"text" json:"formCssMobile"`
	FormOffset           int      `json:"formOffset"`
	FormSideHtml         string   `xorm:"mediumtext" json:"formSideHtml"`
	FormBackgroundUrl    string   `xorm:"varchar(200)" json:"formBackgroundUrl"`

	CertObj *Cert `xorm:"-" json:"certObj"`
}

func GetApplication

func GetApplication(id string) (*Application, error)

func GetApplications

func GetApplications(owner string) ([]*Application, error)

type Cert

type Cert struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`

	DisplayName     string `xorm:"varchar(100)" json:"displayName"`
	Scope           string `xorm:"varchar(100)" json:"scope"`
	Type            string `xorm:"varchar(100)" json:"type"`
	CryptoAlgorithm string `xorm:"varchar(100)" json:"cryptoAlgorithm"`
	BitSize         int    `json:"bitSize"`
	ExpireInYears   int    `json:"expireInYears"`

	Certificate            string `xorm:"mediumtext" json:"certificate"`
	PrivateKey             string `xorm:"mediumtext" json:"privateKey"`
	AuthorityPublicKey     string `xorm:"mediumtext" json:"authorityPublicKey"`
	AuthorityRootPublicKey string `xorm:"mediumtext" json:"authorityRootPublicKey"`
}

func GetCert

func GetCert(id string) (*Cert, error)

func GetCerts

func GetCerts(owner string) ([]*Cert, error)

type Session

type Session struct {
	SessionKey    string  `xorm:"char(64) notnull pk"`
	SessionData   []uint8 `xorm:"blob"`
	SessionExpiry int     `xorm:"notnull"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL