sso

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Jika true, maka role dan permission user akan diambil dari SSO
	IsRoleFromSso bool

	// Jika true, maka group akan dimapping langsung ke role
	IsGroupMappedDirectlyToRole bool

	// Referensi role yang tersedia
	Roles

	RolePermissions // Mapping role ke permission

	// Mapping group ke role ID
	GroupRoleMapping
}

type Group

type Group struct {
	GroupId   string `json:"group_id"`
	GroupName string `json:"group_name"`
}

type GroupRoleMapping

type GroupRoleMapping map[string]string

type Role

type Role struct {
	RoleId    string       `json:"role_id"`
	RoleName  string       `json:"role_name"`
	IsDefault stringAsBool `json:"is_default"`
}

type RolePermissions

type RolePermissions map[string][]string

type Roles

type Roles map[string]Role

type Sso

type Sso struct {
	// contains filtered or unexported fields
}

func NewSso

func NewSso(appCfg map[string]interface{}, client *oidc.Client) *Sso

func (*Sso) GetUserFromAuthorizationCode

func (s *Sso) GetUserFromAuthorizationCode(ctx *web.Context, code string, state string) (*models.User, error)

Jump to

Keyboard shortcuts

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