testing

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizeTokenRequest = `
{
    "roles": [
        {
            "id": "a3b29b"
        },
        {
            "id": "49993e"
        }
    ]
}
`
View Source
const AuthorizeTokenResponse = `
{
    "token": {
        "oauth_verifier": "8171"
    }
}
`
View Source
const CreateConsumerRequest = `
{
    "consumer": {
        "description": "My consumer"
    }
}
`
View Source
const CreateConsumerResponse = `` /* 234-byte string literal not displayed */
View Source
const GetConsumerResponse = `` /* 200-byte string literal not displayed */

GetConsumerOutput provides a Get result.

View Source
const GetUserAccessTokenResponse = `` /* 447-byte string literal not displayed */
View Source
const ListConsumersResponse = `` /* 550-byte string literal not displayed */

ListConsumersResponse provides a single page of Consumers results.

View Source
const ListUserAccessTokenRoleResponse = `` /* 200-byte string literal not displayed */
View Source
const ListUserAccessTokenRolesResponse = `` /* 635-byte string literal not displayed */
View Source
const ListUserAccessTokensResponse = `` /* 660-byte string literal not displayed */
View Source
const UpdateConsumerRequest = `
{
    "consumer": {
        "description": "My new consumer"
    }
}
`
View Source
const UpdateConsumerResponse = `` /* 204-byte string literal not displayed */

Variables

View Source
var AccessToken = oauth1.Token{
	OAuthToken:       "accd36",
	OAuthTokenSecret: "aa47da",
	OAuthExpiresAt:   &tokenExpiresAt,
}
View Source
var Consumer = oauth1.Consumer{
	ID:          "7fea2d",
	Description: "My consumer",
	Secret:      "secretsecret",
}
View Source
var ExpectedConsumersSlice = []oauth1.Consumer{FirstConsumer, SecondConsumer}

ExpectedConsumersSlice is the slice of consumers expected to be returned from ListOutput.

View Source
var ExpectedUserAccessTokensSlice = []oauth1.AccessToken{UserAccessToken}
View Source
var FirstConsumer = oauth1.Consumer{
	ID:          "7fea2d",
	Description: "My consumer",
}
View Source
var SecondConsumer = oauth1.Consumer{
	ID: "0c2a74",
}
View Source
var Token = oauth1.Token{
	OAuthToken:       "29971f",
	OAuthTokenSecret: "238eb8",
	OAuthExpiresAt:   &tokenExpiresAt,
}
View Source
var UpdatedConsumer = oauth1.Consumer{
	ID:          "7fea2d",
	Description: "My new consumer",
}
View Source
var UserAccessToken = oauth1.AccessToken{
	ID:                "6be26a",
	ConsumerID:        "7fea2d",
	ProjectID:         "b9fca3",
	AuthorizingUserID: "ce9e07",
	ExpiresAt:         &tokenExpiresAt,
}
View Source
var UserAccessTokenRole = oauth1.AccessTokenRole{
	ID:       "5ad150",
	DomainID: "7cf37b",
	Name:     "admin",
}
View Source
var UserAccessTokenRoleSecond = oauth1.AccessTokenRole{
	ID:       "a62eb6",
	DomainID: "7cf37b",
	Name:     "member",
}

Functions

func HandleAuthenticate

func HandleAuthenticate(t *testing.T)

HandleAuthenticate creates an HTTP handler at `/auth/tokens` on the test handler mux that responds with an OpenStack token.

func HandleAuthorizeToken

func HandleAuthorizeToken(t *testing.T)

HandleAuthorizeToken creates an HTTP handler at `/OS-OAUTH1/authorize/29971f` on the test handler mux that tests unauthorized token authorization.

func HandleCreateAccessToken

func HandleCreateAccessToken(t *testing.T)

HandleCreateAccessToken creates an HTTP handler at `/OS-OAUTH1/access_token` on the test handler mux that responds with a OAuth1 access token.

func HandleCreateConsumer

func HandleCreateConsumer(t *testing.T)

HandleCreateConsumer creates an HTTP handler at `/OS-OAUTH1/consumers` on the test handler mux that tests consumer creation.

func HandleDeleteConsumer

func HandleDeleteConsumer(t *testing.T)

HandleDeleteConsumer creates an HTTP handler at `/OS-OAUTH1/consumers/7fea2d` on the test handler mux that tests consumer deletion.

func HandleGetAccessToken

func HandleGetAccessToken(t *testing.T)

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

func HandleGetAccessTokenRole(t *testing.T)

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

func HandleGetConsumer(t *testing.T)

HandleGetConsumer creates an HTTP handler at `/OS-OAUTH1/consumers/7fea2d` on the test handler mux that responds with a single consumer.

func HandleListAccessTokenRoles

func HandleListAccessTokenRoles(t *testing.T)

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

func HandleListAccessTokens(t *testing.T)

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

func HandleListConsumers(t *testing.T)

HandleListConsumers creates an HTTP handler at `/OS-OAUTH1/consumers` on the test handler mux that responds with a list of two consumers.

func HandleRequestToken

func HandleRequestToken(t *testing.T)

HandleRequestToken creates an HTTP handler at `/OS-OAUTH1/request_token` on the test handler mux that responds with a OAuth1 unauthorized token.

func HandleRevokeAccessToken

func HandleRevokeAccessToken(t *testing.T)

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

func HandleUpdateConsumer(t *testing.T)

HandleUpdateConsumer creates an HTTP handler at `/OS-OAUTH1/consumers/7fea2d` on the test handler mux that tests consumer update.

Types

This section is empty.

Jump to

Keyboard shortcuts

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