Documentation ¶
Index ¶
- Constants
- Variables
- func HandleCreateMetadataSuccessfully(t *testing.T)
- func HandleCreateMetadatumSuccessfully(t *testing.T)
- func HandleCreateSecretSuccessfully(t *testing.T)
- func HandleDeleteMetadatumSuccessfully(t *testing.T)
- func HandleDeleteSecretSuccessfully(t *testing.T)
- func HandleGetMetadataSuccessfully(t *testing.T)
- func HandleGetMetadatumSuccessfully(t *testing.T)
- func HandleGetPayloadSuccessfully(t *testing.T)
- func HandleGetSecretSuccessfully(t *testing.T)
- func HandleListSecretsSuccessfully(t *testing.T)
- func HandleUpdateMetadatumSuccessfully(t *testing.T)
- func HandleUpdateSecretSuccessfully(t *testing.T)
Constants ¶
const CreateMetadataRequest = `
{
"metadata": {
"foo": "bar",
"something": "something else"
}
}`
const CreateMetadataResponse = `
{
"metadata_ref": "http://barbican:9311/v1/secrets/1b12b69a-8822-442e-a303-da24ade648ac/metadata"
}`
const CreateRequest = `` /* 230-byte string literal not displayed */
CreateRequest provides the input to a Create request.
const CreateResponse = `
{
"secret_ref": "http://barbican:9311/v1/secrets/1b8068c4-3bb6-4be6-8f1e-da0d1ea0b67c"
}`
CreateResponse provides a Create result.
const GetMetadataResponse = `
{
"metadata": {
"foo": "bar",
"something": "something else"
}
}`
const GetPayloadResponse = `foobar`
GetPayloadResponse provides a payload result.
const GetResponse = `` /* 452-byte string literal not displayed */
GetResponse provides a Get result.
const ListResponse = `` /* 1209-byte string literal not displayed */
ListResponse provides a single page of RESOURCE results.
const MetadatumRequest = `
{
"key": "foo",
"value": "bar"
}`
const MetadatumResponse = `
{
"key": "foo",
"value": "bar"
}`
const UpdateRequest = `foobar`
UpdateRequest provides the input to as Update request.
Variables ¶
var ExpectedCreateMetadataResult = map[string]string{
"metadata_ref": "http://barbican:9311/v1/secrets/1b12b69a-8822-442e-a303-da24ade648ac/metadata",
}
ExpectedCreateMetadataResult is the result of a Metadata create request.
var ExpectedCreateResult = secrets.Secret{
SecretRef: "http://barbican:9311/v1/secrets/1b8068c4-3bb6-4be6-8f1e-da0d1ea0b67c",
}
ExpectedCreateResult is the result of a create request
var ExpectedMetadata = map[string]string{
"foo": "bar",
"something": "something else",
}
ExpectedMetadata is the result of a Get or Create request.
var ExpectedMetadatum = secrets.Metadatum{
Key: "foo",
Value: "bar",
}
ExpectedMetadatum is the result of a Metadatum Get, Create, or Update request
var ExpectedSecretsSlice = []secrets.Secret{FirstSecret, SecondSecret}
ExpectedSecretsSlice is the slice of secrets expected to be returned from ListResponse.
var FirstSecret = secrets.Secret{ Algorithm: "aes", BitLength: 256, ContentTypes: map[string]string{ "default": "text/plain", }, Created: time.Date(2018, 6, 21, 2, 49, 48, 0, time.UTC), CreatorID: "5c70d99f4a8641c38f8084b32b5e5c0e", Mode: "cbc", Name: "mysecret", SecretRef: "http://barbican:9311/v1/secrets/1b8068c4-3bb6-4be6-8f1e-da0d1ea0b67c", SecretType: "opaque", Status: "ACTIVE", Updated: time.Date(2018, 6, 21, 2, 49, 48, 0, time.UTC), }
FirstSecret is the first secret in the List request.
var SecondSecret = secrets.Secret{ Algorithm: "aes", BitLength: 256, ContentTypes: map[string]string{ "default": "text/plain", }, Created: time.Date(2018, 6, 21, 5, 18, 45, 0, time.UTC), CreatorID: "5c70d99f4a8641c38f8084b32b5e5c0e", Mode: "cbc", Name: "anothersecret", SecretRef: "http://barbican:9311/v1/secrets/1b12b69a-8822-442e-a303-da24ade648ac", SecretType: "opaque", Status: "ACTIVE", Updated: time.Date(2018, 6, 21, 5, 18, 45, 0, time.UTC), }
SecondSecret is the second secret in the List request.
Functions ¶
func HandleCreateMetadataSuccessfully ¶
HandleCreateMetadataSuccessfully creates an HTTP handler at `/secrets/uuid/metadata` on the test handler mux that responds with a metadata reference URL.
func HandleCreateMetadatumSuccessfully ¶
HandleCreateMetadatumSuccessfully creates an HTTP handler at `/secrets/uuid/metadata` on the test handler mux that responds with a single created metadata.
func HandleCreateSecretSuccessfully ¶
HandleCreateSecretSuccessfully creates an HTTP handler at `/secrets` on the test handler mux that tests secret creation.
func HandleDeleteMetadatumSuccessfully ¶
HandleDeleteMetadatumSuccessfully creates an HTTP handler at `/secrets/uuid/metadata/key` on the test handler mux that tests metadata deletion.
func HandleDeleteSecretSuccessfully ¶
HandleDeleteSecretSuccessfully creates an HTTP handler at `/secrets` on the test handler mux that tests secret deletion.
func HandleGetMetadataSuccessfully ¶
HandleGetMetadataSuccessfully creates an HTTP handler at `/secrets/uuid/metadata` on the test handler mux that responds with retrieved metadata.
func HandleGetMetadatumSuccessfully ¶
HandleGetMetadatumSuccessfully creates an HTTP handler at `/secrets/uuid/metadata/foo` on the test handler mux that responds with a single metadatum.
func HandleGetPayloadSuccessfully ¶
HandleGetPayloadSuccessfully creates an HTTP handler at `/secrets` on the test handler mux that responds with a single secret.
func HandleGetSecretSuccessfully ¶
HandleGetSecretSuccessfully creates an HTTP handler at `/secrets` on the test handler mux that responds with a single secret.
func HandleListSecretsSuccessfully ¶
HandleListSecretsSuccessfully creates an HTTP handler at `/secrets` on the test handler mux that responds with a list of two secrets.
func HandleUpdateMetadatumSuccessfully ¶
HandleUpdateMetadatumSuccessfully creates an HTTP handler at `/secrets/uuid/metadata/foo` on the test handler mux that responds with a single updated metadatum.
func HandleUpdateSecretSuccessfully ¶
HandleUpdateSecretSuccessfully creates an HTTP handler at `/secrets` on the test handler mux that tests secret updates.
Types ¶
This section is empty.