iamclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 13

Documentation

Index

Constants

View Source
const (
	AccessTokenKey = iamapi.AccessTokenKey
)

Variables

View Source
var (
	InstanceID         = ""
	InstanceOwner      = ""
	ServiceUrl         = "http://127.0.0.1:9528/iam"
	ServiceUrlFrontend = ""
	ServiceUrlGlobal   = ""
)

Functions

func AccessKeyAuthValid

func AccessKeyAuthValid(aka iamapi.AccessKeyAuth, secret_key string) error

func AccessKeySession

func AccessKeySession(app_aka, user_aka iamapi.AccessKeyAuth) (*iamapi.AccessKeySession, error)

func AccountChargePayout

func AccountChargePayout(req iamapi.AccountChargePayout, ak *hauth.AccessKey) iamapi.AccountChargePayout

func AccountChargePreValid

func AccountChargePreValid(req iamapi.AccountChargePrepay, ak *hauth.AccessKey) iamapi.AccountChargePrepay

func AccountChargePrepay

func AccountChargePrepay(req iamapi.AccountChargePrepay, ak *hauth.AccessKey) iamapi.AccountChargePrepay

func AppRoleList

func AppRoleList(s *httpsrv.Session, appid string) (*iamapi.UserRoleList, error)

func AuthServiceUrl

func AuthServiceUrl(client_id, redirect_uri, state string) string

func Expired

func Expired(ttl int) time.Time

func Instance

func Instance(token string) (*iamapi.UserSession, error)

func LoginUrl

func LoginUrl(backurl string) string

func NewAccessKeyAuth

func NewAccessKeyAuth(user, access_key, secret_key, data string) (iamapi.AccessKeyAuth, error)

func PublicUserEntry

func PublicUserEntry(user string) iamapi.UserEntry

func SessionAccessAllowed

func SessionAccessAllowed(s *httpsrv.Session, privilege, client_id string) bool

func SessionAccessToken

func SessionAccessToken(s *httpsrv.Session) string

func SessionCache

func SessionCache(id string) *iamapi.UserSession

func SessionInstance

func SessionInstance(s *httpsrv.Session) (iamapi.UserSession, error)

func SessionIsLogin

func SessionIsLogin(s *httpsrv.Session) bool

func SessionSync

func SessionSync(v *iamapi.UserSession, tn int64)

func SysMsgPost

func SysMsgPost(req hmsg.MsgItem, ak *hauth.AccessKey) error

Types

type Auth

type Auth struct {
	*httpsrv.Controller
}

func (Auth) AppRoleListAction

func (c Auth) AppRoleListAction()

func (Auth) CbAction

func (c Auth) CbAction()

func (Auth) LoginAction

func (c Auth) LoginAction()

func (Auth) SessionAction

func (c Auth) SessionAction()

func (Auth) SignOutAction

func (c Auth) SignOutAction()

type AuthSession

type AuthSession struct {
	types.TypeMeta `json:",inline"`
	UserName       string            `json:"username"`
	DisplayName    string            `json:"display_name"`
	IamUrl         string            `json:"iam_url"`
	PhotoUrl       string            `json:"photo_url"`
	InstanceOwner  bool              `json:"instance_owner,omitempty"`
	Roles          types.ArrayUint32 `json:"roles,omitempty"`
	Groups         []string          `json:"groups,omitempty"`
}

Jump to

Keyboard shortcuts

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