authcloud

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALGORITHM                = "HmacSHA1"
	METHOD                   = "POST"
	SIGANDAUTH_INTERFACENAME = "logic.cam.sigAndAuth"
	SIGNMODE                 = 1
	AUTHMODE                 = 2
)
View Source
const AUTHMETHODNAME = "CAM"

Variables

This section is empty.

Functions

func Auth

func Auth(
	apiIp string,
	ownerUin string,
	uin string,
	action string,
	resource string,
	connectTimeOut int,
	readTimeOut int) (map[string]interface{}, error)

func DoPost

func DoPost(
	url string,
	param string,
	connectTimeOut int,
	readTimeOut int) ([]byte, error)

func GetSignKey

func GetSignKey(
	params map[string]interface{},
	sigurl string,
	secretKey string) string

func GetSignSrc

func GetSignSrc(
	params map[string]interface{},
	sigurl string) string

func GetUUID32

func GetUUID32() string

func HmacSHA1Sign

func HmacSHA1Sign(secretKey string, src string) string

func Map2Str

func Map2Str(params map[string]interface{}) string

for tree map (key sorted by string) tans to string

func Sig

func Sig(
	apiIp string,
	secretId string,
	action string,
	signStr string,
	signSrc string,
	connectTimeout int,
	readTimeout int) map[string]interface{}

func SigAndAuth

func SigAndAuth(
	apiIp string,
	secretId string,
	action string,
	signStr string,
	signSrc string,
	resource string,
	connectTimeOut int,
	readTimeOut int) (map[string]interface{}, error)

Types

type AuthenticationCloud

type AuthenticationCloud interface {
	GetAuthMethodName() string

	Initialize(authParams map[string]string) error

	CreateAuthMetadata(action string, metadata map[string]string)

	io.Closer
}

func NewDefaultAuthenticationCloudCam

func NewDefaultAuthenticationCloudCam() AuthenticationCloud

type AuthenticationCloudCam

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

func (*AuthenticationCloudCam) Close

func (authCam *AuthenticationCloudCam) Close() error

func (*AuthenticationCloudCam) CreateAuthMetadata

func (authCam *AuthenticationCloudCam) CreateAuthMetadata(action string, metadata map[string]string)

func (*AuthenticationCloudCam) GetAuthMethodName

func (authCam *AuthenticationCloudCam) GetAuthMethodName() string

func (*AuthenticationCloudCam) Initialize

func (authCam *AuthenticationCloudCam) Initialize(authParams map[string]string) error

Jump to

Keyboard shortcuts

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