Documentation
¶
Index ¶
- Constants
- Variables
- type AppUserAuthProvider
- type AuthService
- type AuthServiceClient
- type AuthServiceProcessor
- type CreateCredentialArgs
- func (p *CreateCredentialArgs) GetOauthInfo() *OAuthInfo
- func (p *CreateCredentialArgs) IsSetOauthInfo() bool
- func (p *CreateCredentialArgs) Read(iprot thrift.TProtocol) error
- func (p *CreateCredentialArgs) ReadField1(iprot thrift.TProtocol) error
- func (p *CreateCredentialArgs) String() string
- func (p *CreateCredentialArgs) Write(oprot thrift.TProtocol) error
- type CreateCredentialResult
- func (p *CreateCredentialResult) GetSe() *errors.ServiceException
- func (p *CreateCredentialResult) GetSuccess() *Credential
- func (p *CreateCredentialResult) IsSetSe() bool
- func (p *CreateCredentialResult) IsSetSuccess() bool
- func (p *CreateCredentialResult) Read(iprot thrift.TProtocol) error
- func (p *CreateCredentialResult) ReadField0(iprot thrift.TProtocol) error
- func (p *CreateCredentialResult) ReadField1(iprot thrift.TProtocol) error
- func (p *CreateCredentialResult) String() string
- func (p *CreateCredentialResult) Write(oprot thrift.TProtocol) error
- type Credential
- func (p *Credential) GetSecretKey() string
- func (p *Credential) GetSecretKeyId() string
- func (p *Credential) GetTypeA1() UserType
- func (p *Credential) IsSetSecretKey() bool
- func (p *Credential) IsSetSecretKeyId() bool
- func (p *Credential) IsSetTypeA1() bool
- func (p *Credential) Read(iprot thrift.TProtocol) error
- func (p *Credential) ReadField1(iprot thrift.TProtocol) error
- func (p *Credential) ReadField2(iprot thrift.TProtocol) error
- func (p *Credential) ReadField3(iprot thrift.TProtocol) error
- func (p *Credential) String() string
- func (p *Credential) Write(oprot thrift.TProtocol) error
- type HttpAuthorizationHeader
- func (p *HttpAuthorizationHeader) GetAlgorithm() MacAlgorithm
- func (p *HttpAuthorizationHeader) GetSecretKey() string
- func (p *HttpAuthorizationHeader) GetSecretKeyId() string
- func (p *HttpAuthorizationHeader) GetSignature() string
- func (p *HttpAuthorizationHeader) GetSignedHeaders() []string
- func (p *HttpAuthorizationHeader) GetSupportAccountKey() bool
- func (p *HttpAuthorizationHeader) GetUserType() UserType
- func (p *HttpAuthorizationHeader) GetVersion() string
- func (p *HttpAuthorizationHeader) IsSetAlgorithm() bool
- func (p *HttpAuthorizationHeader) IsSetSecretKey() bool
- func (p *HttpAuthorizationHeader) IsSetSecretKeyId() bool
- func (p *HttpAuthorizationHeader) IsSetSignature() bool
- func (p *HttpAuthorizationHeader) IsSetSignedHeaders() bool
- func (p *HttpAuthorizationHeader) IsSetSupportAccountKey() bool
- func (p *HttpAuthorizationHeader) IsSetUserType() bool
- func (p *HttpAuthorizationHeader) IsSetVersion() bool
- func (p *HttpAuthorizationHeader) Read(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) ReadField1(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) ReadField2(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) ReadField3(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) ReadField4(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) ReadField5(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) ReadField6(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) ReadField7(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) ReadField8(iprot thrift.TProtocol) error
- func (p *HttpAuthorizationHeader) String() string
- func (p *HttpAuthorizationHeader) Write(oprot thrift.TProtocol) error
- type MacAlgorithm
- type OAuthInfo
- func (p *OAuthInfo) GetAccessToken() string
- func (p *OAuthInfo) GetAppUserAuthProvider() AppUserAuthProvider
- func (p *OAuthInfo) GetMacAlgorithm() string
- func (p *OAuthInfo) GetMacKey() string
- func (p *OAuthInfo) GetOpenId() string
- func (p *OAuthInfo) GetXiaomiAppId() string
- func (p *OAuthInfo) IsSetAccessToken() bool
- func (p *OAuthInfo) IsSetMacAlgorithm() bool
- func (p *OAuthInfo) IsSetMacKey() bool
- func (p *OAuthInfo) IsSetOpenId() bool
- func (p *OAuthInfo) Read(iprot thrift.TProtocol) error
- func (p *OAuthInfo) ReadField1(iprot thrift.TProtocol) error
- func (p *OAuthInfo) ReadField2(iprot thrift.TProtocol) error
- func (p *OAuthInfo) ReadField3(iprot thrift.TProtocol) error
- func (p *OAuthInfo) ReadField4(iprot thrift.TProtocol) error
- func (p *OAuthInfo) ReadField5(iprot thrift.TProtocol) error
- func (p *OAuthInfo) ReadField6(iprot thrift.TProtocol) error
- func (p *OAuthInfo) String() string
- func (p *OAuthInfo) Write(oprot thrift.TProtocol) error
- type UserType
Constants ¶
View Source
const HK_AUTHORIZATION = "Authorization"
View Source
const HK_CONTENT_MD5 = "X-Xiaomi-Content-MD5"
View Source
const HK_HOST = "Host"
View Source
const HK_MAC_ALGORITHM = "X-Xiaomi-Mac-Algorithm"
View Source
const HK_SECRET_KEY = "X-Xiaomi-Secret-Key"
View Source
const HK_SECRET_KEY_ID = "X-Xiaomi-Secret-Key-Id"
View Source
const HK_SIGNATURE = "X-Xiaomi-Signature"
View Source
const HK_SUPPORT_ACCOUNT_KEY = "X-Xiaomi-Support-Account-Key"
View Source
const HK_TIMESTAMP = "X-Xiaomi-Timestamp"
View Source
const HK_USER_TYPE = "X-Xiaomi-User-Type"
View Source
const HK_VERSION = "X-Xiaomi-Version"
View Source
const MI_DATE = "x-xiaomi-date"
View Source
const XIAOMI_HEADER_PREFIX = "x-xiaomi-"
Variables ¶
View Source
var CreateCredentialResult_Se_DEFAULT *errors.ServiceException
View Source
var Credential_SecretKeyId_DEFAULT string
View Source
var Credential_SecretKey_DEFAULT string
View Source
var GoUnusedProtection__ int
View Source
var HttpAuthorizationHeader_SecretKeyId_DEFAULT string
View Source
var HttpAuthorizationHeader_SecretKey_DEFAULT string
View Source
var HttpAuthorizationHeader_Signature_DEFAULT string
View Source
var HttpAuthorizationHeader_SignedHeaders_DEFAULT []string = []string{}
View Source
var HttpAuthorizationHeader_SupportAccountKey_DEFAULT bool = false
View Source
var HttpAuthorizationHeader_Version_DEFAULT string = "SDS-V1"
View Source
var OAuthInfo_AccessToken_DEFAULT string
View Source
var OAuthInfo_MacAlgorithm_DEFAULT string
View Source
var OAuthInfo_MacKey_DEFAULT string
View Source
var OAuthInfo_OpenId_DEFAULT string
View Source
var SIGNATURE_SUPPORT map[UserType]bool
View Source
var SUGGESTED_SIGNATURE_HEADERS []string
Functions ¶
This section is empty.
Types ¶
type AppUserAuthProvider ¶
type AppUserAuthProvider int64
第三方身份认证提供方,用于认证应用用户(非开发者)。 目前提供小米SSO和几种常见OAuth系统
const ( AppUserAuthProvider_XIAOMI_SSO AppUserAuthProvider = 1 AppUserAuthProvider_XIAOMI_OAUTH AppUserAuthProvider = 2 AppUserAuthProvider_QQ_OAUTH AppUserAuthProvider = 3 AppUserAuthProvider_SINA_OAUTH AppUserAuthProvider = 4 AppUserAuthProvider_RENREN_OAUTH AppUserAuthProvider = 5 AppUserAuthProvider_WEIXIN_OAUTH AppUserAuthProvider = 6 )
func AppUserAuthProviderFromString ¶
func AppUserAuthProviderFromString(s string) (AppUserAuthProvider, error)
func AppUserAuthProviderPtr ¶
func AppUserAuthProviderPtr(v AppUserAuthProvider) *AppUserAuthProvider
func (AppUserAuthProvider) String ¶
func (p AppUserAuthProvider) String() string
type AuthService ¶
type AuthService interface { common.BaseService // 通过第三方认证系统换发Storage Access Token,采用App Secret登录无需此过程 // // Parameters: // - OauthInfo CreateCredential(oauthInfo *OAuthInfo) (r *Credential, err error) }
type AuthServiceClient ¶
type AuthServiceClient struct {
*common.BaseServiceClient
}
结构化存储授权相关接口(目前尚未开放)
func NewAuthServiceClientFactory ¶
func NewAuthServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AuthServiceClient
func NewAuthServiceClientProtocol ¶
func NewAuthServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AuthServiceClient
func (*AuthServiceClient) CreateCredential ¶
func (p *AuthServiceClient) CreateCredential(oauthInfo *OAuthInfo) (r *Credential, err error)
通过第三方认证系统换发Storage Access Token,采用App Secret登录无需此过程
Parameters:
- OauthInfo
type AuthServiceProcessor ¶
type AuthServiceProcessor struct {
*common.BaseServiceProcessor
}
func NewAuthServiceProcessor ¶
func NewAuthServiceProcessor(handler AuthService) *AuthServiceProcessor
type CreateCredentialArgs ¶
type CreateCredentialArgs struct {
OauthInfo *OAuthInfo `thrift:"oauthInfo,1" json:"oauthInfo"`
}
func NewCreateCredentialArgs ¶
func NewCreateCredentialArgs() *CreateCredentialArgs
func (*CreateCredentialArgs) GetOauthInfo ¶
func (p *CreateCredentialArgs) GetOauthInfo() *OAuthInfo
func (*CreateCredentialArgs) IsSetOauthInfo ¶
func (p *CreateCredentialArgs) IsSetOauthInfo() bool
func (*CreateCredentialArgs) Read ¶
func (p *CreateCredentialArgs) Read(iprot thrift.TProtocol) error
func (*CreateCredentialArgs) ReadField1 ¶
func (p *CreateCredentialArgs) ReadField1(iprot thrift.TProtocol) error
func (*CreateCredentialArgs) String ¶
func (p *CreateCredentialArgs) String() string
type CreateCredentialResult ¶
type CreateCredentialResult struct { Success *Credential `thrift:"success,0" json:"success"` Se *errors.ServiceException `thrift:"se,1" json:"se"` }
func NewCreateCredentialResult ¶
func NewCreateCredentialResult() *CreateCredentialResult
func (*CreateCredentialResult) GetSe ¶
func (p *CreateCredentialResult) GetSe() *errors.ServiceException
func (*CreateCredentialResult) GetSuccess ¶
func (p *CreateCredentialResult) GetSuccess() *Credential
func (*CreateCredentialResult) IsSetSe ¶
func (p *CreateCredentialResult) IsSetSe() bool
func (*CreateCredentialResult) IsSetSuccess ¶
func (p *CreateCredentialResult) IsSetSuccess() bool
func (*CreateCredentialResult) Read ¶
func (p *CreateCredentialResult) Read(iprot thrift.TProtocol) error
func (*CreateCredentialResult) ReadField0 ¶
func (p *CreateCredentialResult) ReadField0(iprot thrift.TProtocol) error
func (*CreateCredentialResult) ReadField1 ¶
func (p *CreateCredentialResult) ReadField1(iprot thrift.TProtocol) error
func (*CreateCredentialResult) String ¶
func (p *CreateCredentialResult) String() string
type Credential ¶
type Credential struct { TypeA1 *UserType `thrift:"type,1" json:"type"` SecretKeyId *string `thrift:"secretKeyId,2" json:"secretKeyId"` SecretKey *string `thrift:"secretKey,3" json:"secretKey"` }
var CreateCredentialResult_Success_DEFAULT *Credential
func NewCredential ¶
func NewCredential() *Credential
func (*Credential) GetSecretKey ¶
func (p *Credential) GetSecretKey() string
func (*Credential) GetSecretKeyId ¶
func (p *Credential) GetSecretKeyId() string
func (*Credential) GetTypeA1 ¶
func (p *Credential) GetTypeA1() UserType
func (*Credential) IsSetSecretKey ¶
func (p *Credential) IsSetSecretKey() bool
func (*Credential) IsSetSecretKeyId ¶
func (p *Credential) IsSetSecretKeyId() bool
func (*Credential) IsSetTypeA1 ¶
func (p *Credential) IsSetTypeA1() bool
func (*Credential) ReadField1 ¶
func (p *Credential) ReadField1(iprot thrift.TProtocol) error
func (*Credential) ReadField2 ¶
func (p *Credential) ReadField2(iprot thrift.TProtocol) error
func (*Credential) ReadField3 ¶
func (p *Credential) ReadField3(iprot thrift.TProtocol) error
func (*Credential) String ¶
func (p *Credential) String() string
type HttpAuthorizationHeader ¶
type HttpAuthorizationHeader struct { Version string `thrift:"version,1" json:"version"` UserType UserType `thrift:"userType,2" json:"userType"` SecretKeyId *string `thrift:"secretKeyId,3" json:"secretKeyId"` SecretKey *string `thrift:"secretKey,4" json:"secretKey"` Signature *string `thrift:"signature,5" json:"signature"` Algorithm *MacAlgorithm `thrift:"algorithm,6" json:"algorithm"` SignedHeaders *[]string `thrift:"signedHeaders,7" json:"signedHeaders"` SupportAccountKey bool `thrift:"supportAccountKey,8" json:"supportAccountKey"` }
func NewHttpAuthorizationHeader ¶
func NewHttpAuthorizationHeader() *HttpAuthorizationHeader
func (*HttpAuthorizationHeader) GetAlgorithm ¶
func (p *HttpAuthorizationHeader) GetAlgorithm() MacAlgorithm
func (*HttpAuthorizationHeader) GetSecretKey ¶
func (p *HttpAuthorizationHeader) GetSecretKey() string
func (*HttpAuthorizationHeader) GetSecretKeyId ¶
func (p *HttpAuthorizationHeader) GetSecretKeyId() string
func (*HttpAuthorizationHeader) GetSignature ¶
func (p *HttpAuthorizationHeader) GetSignature() string
func (*HttpAuthorizationHeader) GetSignedHeaders ¶
func (p *HttpAuthorizationHeader) GetSignedHeaders() []string
func (*HttpAuthorizationHeader) GetSupportAccountKey ¶
func (p *HttpAuthorizationHeader) GetSupportAccountKey() bool
func (*HttpAuthorizationHeader) GetUserType ¶
func (p *HttpAuthorizationHeader) GetUserType() UserType
func (*HttpAuthorizationHeader) GetVersion ¶
func (p *HttpAuthorizationHeader) GetVersion() string
func (*HttpAuthorizationHeader) IsSetAlgorithm ¶
func (p *HttpAuthorizationHeader) IsSetAlgorithm() bool
func (*HttpAuthorizationHeader) IsSetSecretKey ¶
func (p *HttpAuthorizationHeader) IsSetSecretKey() bool
func (*HttpAuthorizationHeader) IsSetSecretKeyId ¶
func (p *HttpAuthorizationHeader) IsSetSecretKeyId() bool
func (*HttpAuthorizationHeader) IsSetSignature ¶
func (p *HttpAuthorizationHeader) IsSetSignature() bool
func (*HttpAuthorizationHeader) IsSetSignedHeaders ¶
func (p *HttpAuthorizationHeader) IsSetSignedHeaders() bool
func (*HttpAuthorizationHeader) IsSetSupportAccountKey ¶
func (p *HttpAuthorizationHeader) IsSetSupportAccountKey() bool
func (*HttpAuthorizationHeader) IsSetUserType ¶
func (p *HttpAuthorizationHeader) IsSetUserType() bool
func (*HttpAuthorizationHeader) IsSetVersion ¶
func (p *HttpAuthorizationHeader) IsSetVersion() bool
func (*HttpAuthorizationHeader) Read ¶
func (p *HttpAuthorizationHeader) Read(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) ReadField1 ¶
func (p *HttpAuthorizationHeader) ReadField1(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) ReadField2 ¶
func (p *HttpAuthorizationHeader) ReadField2(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) ReadField3 ¶
func (p *HttpAuthorizationHeader) ReadField3(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) ReadField4 ¶
func (p *HttpAuthorizationHeader) ReadField4(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) ReadField5 ¶
func (p *HttpAuthorizationHeader) ReadField5(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) ReadField6 ¶
func (p *HttpAuthorizationHeader) ReadField6(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) ReadField7 ¶
func (p *HttpAuthorizationHeader) ReadField7(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) ReadField8 ¶
func (p *HttpAuthorizationHeader) ReadField8(iprot thrift.TProtocol) error
func (*HttpAuthorizationHeader) String ¶
func (p *HttpAuthorizationHeader) String() string
type MacAlgorithm ¶
type MacAlgorithm int64
签名使用的HMMAC算法
const ( MacAlgorithm_HmacMD5 MacAlgorithm = 1 MacAlgorithm_HmacSHA1 MacAlgorithm = 2 MacAlgorithm_HmacSHA256 MacAlgorithm = 3 )
var HttpAuthorizationHeader_Algorithm_DEFAULT MacAlgorithm
func MacAlgorithmFromString ¶
func MacAlgorithmFromString(s string) (MacAlgorithm, error)
func MacAlgorithmPtr ¶
func MacAlgorithmPtr(v MacAlgorithm) *MacAlgorithm
func (MacAlgorithm) String ¶
func (p MacAlgorithm) String() string
type OAuthInfo ¶
type OAuthInfo struct { XiaomiAppId string `thrift:"xiaomiAppId,1" json:"xiaomiAppId"` AppUserAuthProvider AppUserAuthProvider `thrift:"appUserAuthProvider,2" json:"appUserAuthProvider"` AccessToken *string `thrift:"accessToken,3" json:"accessToken"` OpenId *string `thrift:"openId,4" json:"openId"` MacKey *string `thrift:"macKey,5" json:"macKey"` MacAlgorithm *string `thrift:"macAlgorithm,6" json:"macAlgorithm"` }
var CreateCredentialArgs_OauthInfo_DEFAULT *OAuthInfo
func NewOAuthInfo ¶
func NewOAuthInfo() *OAuthInfo
func (*OAuthInfo) GetAccessToken ¶
func (*OAuthInfo) GetAppUserAuthProvider ¶
func (p *OAuthInfo) GetAppUserAuthProvider() AppUserAuthProvider
func (*OAuthInfo) GetMacAlgorithm ¶
func (*OAuthInfo) GetXiaomiAppId ¶
func (*OAuthInfo) IsSetAccessToken ¶
func (*OAuthInfo) IsSetMacAlgorithm ¶
func (*OAuthInfo) IsSetMacKey ¶
func (*OAuthInfo) IsSetOpenId ¶
type UserType ¶
type UserType int64
小米存储系统认证信息类型
var Credential_TypeA1_DEFAULT UserType
var HttpAuthorizationHeader_UserType_DEFAULT UserType = 13
func UserTypeFromString ¶
func UserTypePtr ¶
Click to show internal directories.
Click to hide internal directories.