Documentation ¶
Index ¶
- Constants
- Variables
- func HandleAuthenticate(t *testing.T)
- func HandleAuthorizeToken(t *testing.T)
- func HandleCreateAccessToken(t *testing.T)
- func HandleCreateConsumer(t *testing.T)
- func HandleDeleteConsumer(t *testing.T)
- func HandleGetAccessToken(t *testing.T)
- func HandleGetAccessTokenRole(t *testing.T)
- func HandleGetConsumer(t *testing.T)
- func HandleListAccessTokenRoles(t *testing.T)
- func HandleListAccessTokens(t *testing.T)
- func HandleListConsumers(t *testing.T)
- func HandleRequestToken(t *testing.T)
- func HandleRevokeAccessToken(t *testing.T)
- func HandleUpdateConsumer(t *testing.T)
Constants ¶
const AuthorizeTokenRequest = `
{
"roles": [
{
"id": "a3b29b"
},
{
"id": "49993e"
}
]
}
`
const AuthorizeTokenResponse = `
{
"token": {
"oauth_verifier": "8171"
}
}
`
const CreateConsumerRequest = `
{
"consumer": {
"description": "My consumer"
}
}
`
const CreateConsumerResponse = `` /* 234-byte string literal not displayed */
const GetConsumerResponse = `` /* 200-byte string literal not displayed */
GetConsumerOutput provides a Get result.
const GetUserAccessTokenResponse = `` /* 447-byte string literal not displayed */
const ListConsumersResponse = `` /* 550-byte string literal not displayed */
ListConsumersResponse provides a single page of Consumers results.
const ListUserAccessTokenRoleResponse = `` /* 200-byte string literal not displayed */
const ListUserAccessTokenRolesResponse = `` /* 635-byte string literal not displayed */
const ListUserAccessTokensResponse = `` /* 660-byte string literal not displayed */
const UpdateConsumerRequest = `
{
"consumer": {
"description": "My new consumer"
}
}
`
const UpdateConsumerResponse = `` /* 204-byte string literal not displayed */
Variables ¶
var AccessToken = oauth1.Token{
OAuthToken: "accd36",
OAuthTokenSecret: "aa47da",
OAuthExpiresAt: &tokenExpiresAt,
}
var Consumer = oauth1.Consumer{
ID: "7fea2d",
Description: "My consumer",
Secret: "secretsecret",
}
var ExpectedConsumersSlice = []oauth1.Consumer{FirstConsumer, SecondConsumer}
ExpectedConsumersSlice is the slice of consumers expected to be returned from ListOutput.
var ExpectedUserAccessTokenRolesSlice = []oauth1.AccessTokenRole{UserAccessTokenRole, UserAccessTokenRoleSecond}
var ExpectedUserAccessTokensSlice = []oauth1.AccessToken{UserAccessToken}
var FirstConsumer = oauth1.Consumer{
ID: "7fea2d",
Description: "My consumer",
}
var SecondConsumer = oauth1.Consumer{
ID: "0c2a74",
}
var Token = oauth1.Token{
OAuthToken: "29971f",
OAuthTokenSecret: "238eb8",
OAuthExpiresAt: &tokenExpiresAt,
}
var UpdatedConsumer = oauth1.Consumer{
ID: "7fea2d",
Description: "My new consumer",
}
var UserAccessToken = oauth1.AccessToken{
ID: "6be26a",
ConsumerID: "7fea2d",
ProjectID: "b9fca3",
AuthorizingUserID: "ce9e07",
ExpiresAt: &tokenExpiresAt,
}
var UserAccessTokenRole = oauth1.AccessTokenRole{
ID: "5ad150",
DomainID: "7cf37b",
Name: "admin",
}
var UserAccessTokenRoleSecond = oauth1.AccessTokenRole{
ID: "a62eb6",
DomainID: "7cf37b",
Name: "member",
}
Functions ¶
func HandleAuthenticate ¶
HandleAuthenticate creates an HTTP handler at `/auth/tokens` on the test handler mux that responds with an OpenStack token.
func HandleAuthorizeToken ¶
HandleAuthorizeToken creates an HTTP handler at `/OS-OAUTH1/authorize/29971f` on the test handler mux that tests unauthorized token authorization.
func HandleCreateAccessToken ¶
HandleCreateAccessToken creates an HTTP handler at `/OS-OAUTH1/access_token` on the test handler mux that responds with a OAuth1 access token.
func HandleCreateConsumer ¶
HandleCreateConsumer creates an HTTP handler at `/OS-OAUTH1/consumers` on the test handler mux that tests consumer creation.
func HandleDeleteConsumer ¶
HandleDeleteConsumer creates an HTTP handler at `/OS-OAUTH1/consumers/7fea2d` on the test handler mux that tests consumer deletion.
func HandleGetAccessToken ¶
HandleGetAccessToken creates an HTTP handler at `/users/ce9e07/OS-OAUTH1/access_tokens/6be26a` on the test handler mux that responds with a single access token.
func HandleGetAccessTokenRole ¶
HandleGetAccessTokenRole creates an HTTP handler at `/users/ce9e07/OS-OAUTH1/access_tokens/6be26a/roles/5ad150` on the test handler mux that responds with an access token role.
func HandleGetConsumer ¶
HandleGetConsumer creates an HTTP handler at `/OS-OAUTH1/consumers/7fea2d` on the test handler mux that responds with a single consumer.
func HandleListAccessTokenRoles ¶
HandleListAccessTokenRoles creates an HTTP handler at `/users/ce9e07/OS-OAUTH1/access_tokens/6be26a/roles` on the test handler mux that responds with a slice of access token roles.
func HandleListAccessTokens ¶
HandleListAccessTokens creates an HTTP handler at `/users/ce9e07/OS-OAUTH1/access_tokens` on the test handler mux that responds with a slice of access tokens.
func HandleListConsumers ¶
HandleListConsumers creates an HTTP handler at `/OS-OAUTH1/consumers` on the test handler mux that responds with a list of two consumers.
func HandleRequestToken ¶
HandleRequestToken creates an HTTP handler at `/OS-OAUTH1/request_token` on the test handler mux that responds with a OAuth1 unauthorized token.
func HandleRevokeAccessToken ¶
HandleRevokeAccessToken creates an HTTP handler at `/users/ce9e07/OS-OAUTH1/access_tokens/6be26a` on the test handler mux that tests access token deletion.
func HandleUpdateConsumer ¶
HandleUpdateConsumer creates an HTTP handler at `/OS-OAUTH1/consumers/7fea2d` on the test handler mux that tests consumer update.
Types ¶
This section is empty.