model

package
v1.84.5 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectAggregate models.AggregateType = "project"

	ProjectAdded       models.EventType = "project.added"
	ProjectChanged     models.EventType = "project.changed"
	ProjectDeactivated models.EventType = "project.deactivated"
	ProjectReactivated models.EventType = "project.reactivated"
	ProjectRemoved     models.EventType = "project.removed"

	ProjectMemberAdded          models.EventType = "project.member.added"
	ProjectMemberChanged        models.EventType = "project.member.changed"
	ProjectMemberRemoved        models.EventType = "project.member.removed"
	ProjectMemberCascadeRemoved models.EventType = "project.member.cascade.removed"

	ProjectRoleAdded   models.EventType = "project.role.added"
	ProjectRoleChanged models.EventType = "project.role.changed"
	ProjectRoleRemoved models.EventType = "project.role.removed"

	ProjectGrantAdded          models.EventType = "project.grant.added"
	ProjectGrantChanged        models.EventType = "project.grant.changed"
	ProjectGrantRemoved        models.EventType = "project.grant.removed"
	ProjectGrantDeactivated    models.EventType = "project.grant.deactivated"
	ProjectGrantReactivated    models.EventType = "project.grant.reactivated"
	ProjectGrantCascadeChanged models.EventType = "project.grant.cascade.changed"

	ProjectGrantMemberAdded          models.EventType = "project.grant.member.added"
	ProjectGrantMemberChanged        models.EventType = "project.grant.member.changed"
	ProjectGrantMemberRemoved        models.EventType = "project.grant.member.removed"
	ProjectGrantMemberCascadeRemoved models.EventType = "project.grant.member.cascade.removed"

	ApplicationAdded       models.EventType = "project.application.added"
	ApplicationChanged     models.EventType = "project.application.changed"
	ApplicationRemoved     models.EventType = "project.application.removed"
	ApplicationDeactivated models.EventType = "project.application.deactivated"
	ApplicationReactivated models.EventType = "project.application.reactivated"

	OIDCConfigAdded                models.EventType = "project.application.config.oidc.added"
	OIDCConfigChanged              models.EventType = "project.application.config.oidc.changed"
	OIDCConfigSecretChanged        models.EventType = "project.application.config.oidc.secret.changed"
	OIDCClientSecretCheckSucceeded models.EventType = "project.application.oidc.secret.check.succeeded"
	OIDCClientSecretCheckFailed    models.EventType = "project.application.oidc.secret.check.failed"

	APIConfigAdded         models.EventType = "project.application.config.api.added"
	APIConfigChanged       models.EventType = "project.application.config.api.changed"
	APIConfigSecretChanged models.EventType = "project.application.config.api.secret.changed"

	ClientKeyAdded   models.EventType = "project.application.oidc.key.added"
	ClientKeyRemoved models.EventType = "project.application.oidc.key.removed"
)
View Source
const (
	ProjectVersion = "v1"
)

Variables

This section is empty.

Functions

func APIConfigToModel

func APIConfigToModel(config *APIConfig) *model.APIConfig

func ClientKeyToModel

func ClientKeyToModel(key *ClientKey) *model.ClientKey

func ClientKeysToModel

func ClientKeysToModel(keys []*ClientKey) []*model.ClientKey

func ProjectToModel

func ProjectToModel(project *Project) *model.Project

Types

type APIConfig

type APIConfig struct {
	es_models.ObjectRoot
	AppID          string              `json:"appId"`
	ClientID       string              `json:"clientId,omitempty"`
	ClientSecret   *crypto.CryptoValue `json:"clientSecret,omitempty"`
	AuthMethodType int32               `json:"authMethodType,omitempty"`
	ClientKeys     []*ClientKey        `json:"-"`
}

func APIConfigFromModel

func APIConfigFromModel(config *model.APIConfig) *APIConfig

func (*APIConfig) Changes

func (c *APIConfig) Changes(changed *APIConfig) map[string]interface{}

type Application

type Application struct {
	es_models.ObjectRoot
	AppID      string      `json:"appId"`
	State      int32       `json:"-"`
	Name       string      `json:"name,omitempty"`
	Type       int32       `json:"appType,omitempty"`
	OIDCConfig *OIDCConfig `json:"-"`
	APIConfig  *APIConfig  `json:"-"`
}

func GetApplication

func GetApplication(apps []*Application, id string) (int, *Application)

type ApplicationID

type ApplicationID struct {
	es_models.ObjectRoot
	AppID string `json:"appId"`
}

type ClientKey

type ClientKey struct {
	es_models.ObjectRoot `json:"-"`
	ApplicationID        string    `json:"applicationId,omitempty"`
	ClientID             string    `json:"clientId,omitempty"`
	KeyID                string    `json:"keyId,omitempty"`
	Type                 int32     `json:"type,omitempty"`
	ExpirationDate       time.Time `json:"expirationDate,omitempty"`
	PublicKey            []byte    `json:"publicKey,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientKey) AppendEvent

func (key *ClientKey) AppendEvent(event *es_models.Event) (err error)

func (*ClientKey) AppendEvents

func (key *ClientKey) AppendEvents(events ...*es_models.Event) error

func (*ClientKey) GenerateClientKeyPair

func (key *ClientKey) GenerateClientKeyPair(keySize int) error

func (*ClientKey) SetData

func (key *ClientKey) SetData(event *es_models.Event) error

type OIDCConfig

type OIDCConfig struct {
	es_models.ObjectRoot
	Version                  int32               `json:"oidcVersion,omitempty"`
	AppID                    string              `json:"appId"`
	ClientID                 string              `json:"clientId,omitempty"`
	ClientSecret             *crypto.CryptoValue `json:"clientSecret,omitempty"`
	RedirectUris             []string            `json:"redirectUris,omitempty"`
	ResponseTypes            []int32             `json:"responseTypes,omitempty"`
	GrantTypes               []int32             `json:"grantTypes,omitempty"`
	ApplicationType          int32               `json:"applicationType,omitempty"`
	AuthMethodType           int32               `json:"authMethodType,omitempty"`
	PostLogoutRedirectUris   []string            `json:"postLogoutRedirectUris,omitempty"`
	DevMode                  bool                `json:"devMode,omitempty"`
	AccessTokenType          int32               `json:"accessTokenType,omitempty"`
	AccessTokenRoleAssertion bool                `json:"accessTokenRoleAssertion,omitempty"`
	IDTokenRoleAssertion     bool                `json:"idTokenRoleAssertion,omitempty"`
	IDTokenUserinfoAssertion bool                `json:"idTokenUserinfoAssertion,omitempty"`
	ClockSkew                time.Duration       `json:"clockSkew,omitempty"`
	ClientKeys               []*ClientKey        `json:"-"`
}

type Project

type Project struct {
	es_models.ObjectRoot
	Name                 string `json:"name,omitempty"`
	ProjectRoleAssertion bool   `json:"projectRoleAssertion,omitempty"`
	ProjectRoleCheck     bool   `json:"projectRoleCheck,omitempty"`
	HasProjectCheck      bool   `json:"hasProjectCheck,omitempty"`
	State                int32  `json:"-"`
}

func ProjectFromEvents

func ProjectFromEvents(project *Project, events ...*es_models.Event) (*Project, error)

func (*Project) AppendAddProjectEvent

func (p *Project) AppendAddProjectEvent(event *es_models.Event) error

func (*Project) AppendEvent

func (p *Project) AppendEvent(event *es_models.Event) error

func (*Project) AppendEvents

func (p *Project) AppendEvents(events ...*es_models.Event) error

func (*Project) SetData

func (p *Project) SetData(event *es_models.Event) error

type ProjectGrant

type ProjectGrant struct {
	es_models.ObjectRoot
	State        int32                 `json:"-"`
	GrantID      string                `json:"grantId,omitempty"`
	GrantedOrgID string                `json:"grantedOrgId,omitempty"`
	RoleKeys     []string              `json:"roleKeys,omitempty"`
	Members      []*ProjectGrantMember `json:"-"`
}

func GetProjectGrant

func GetProjectGrant(grants []*ProjectGrant, id string) (int, *ProjectGrant)

func (*ProjectGrant) Changes

func (g *ProjectGrant) Changes(changed *ProjectGrant) map[string]interface{}

type ProjectGrantID

type ProjectGrantID struct {
	es_models.ObjectRoot
	GrantID string `json:"grantId"`
}

type ProjectGrantMember

type ProjectGrantMember struct {
	es_models.ObjectRoot
	GrantID string   `json:"grantId,omitempty"`
	UserID  string   `json:"userId,omitempty"`
	Roles   []string `json:"roles,omitempty"`
}

func (*ProjectGrantMember) SetData

func (m *ProjectGrantMember) SetData(event *es_models.Event) error

type ProjectMember

type ProjectMember struct {
	es_models.ObjectRoot
	UserID string   `json:"userId,omitempty"`
	Roles  []string `json:"roles,omitempty"`
}

func (*ProjectMember) SetData

func (m *ProjectMember) SetData(event *es_models.Event) error

Jump to

Keyboard shortcuts

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