auth

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: Apache-2.0 Imports: 5 Imported by: 6

README

Authentication Plugin for Go-Chassis

Build Status This plugin provides the authentication mechanism for Huawei Public Cloud. The authentication mechanism can be either AK/SK based or token based. Based on the type this plugin appends the signed auth token or AK/SK in the header of each request. The api's of Service-Center, Config-Center and Monitoring Server of Huawei Public Cloud needs authentication so this plugins adds the auth header for these api's.

how to use in go chassis

1.You can specify the AK/SK in the auth.yaml of Go-Chassis

cse.credentials.accessKey
cse.credentials.secretKey

2.Import in your main.go before other imports

import _ "github.com/huaweicse/auth/adaptor/gochassis"

After signing the header with authourization the Header looks like this

Authorization: Credential=XXX, SignedHeaders=XXX, Signature=XXX

==========================================

For third_party/forked/datastream/aws(github.com/datastream/aws)

Copyright (c) 2014, Xianjie All rights reserved.

========================================================================

For vendor/github.com/huaweicse/auth/third_party/forked/datastream/aws:

========================================================================

See third_party/forked/datastream/aws/LICENSE

Documentation

Index

Constants

View Source
const (
	HeaderServiceAk      = "X-Service-AK"
	HeaderServiceShaAKSK = "X-Service-ShaAKSK"
	HeaderServiceProject = "X-Service-Project"
)

Headers for ak/sk auth

Variables

This section is empty.

Functions

This section is empty.

Types

type SignRequest

type SignRequest func(*http.Request) error

SignRequest inject auth related header and sign this request so that this request can access to huawei cloud

func GetShaAKSKSignFunc

func GetShaAKSKSignFunc(ak, sk, project string) (SignRequest, error)

GetShaAKSKSignFunc sets and initializes the ak/sk auth func

func GetSignFunc

func GetSignFunc(ak, sk, project string) (SignRequest, error)

GetSignFunc sets and initializes the ak/sk auth func

Directories

Path Synopsis
adaptor
third_party

Jump to

Keyboard shortcuts

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