28 lines
552 B
Go
28 lines
552 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type AuthCredential struct {
|
|
Payload map[string]string
|
|
}
|
|
|
|
func NewAuthCredential(username, password string) *AuthCredential {
|
|
payload := make(map[string]string)
|
|
payload["username"] = username
|
|
payload["password"] = password
|
|
return &AuthCredential{
|
|
Payload: payload,
|
|
}
|
|
}
|
|
|
|
func (cred *AuthCredential) GetRequestMetadata(ctx context.Context, data ...string) (map[string]string, error) {
|
|
var err error
|
|
return cred.Payload, err
|
|
}
|
|
|
|
func (cred *AuthCredential) RequireTransportSecurity() bool {
|
|
return false
|
|
}
|