secrets

package
v0.0.0-...-f54f16c Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package secrets is a generated GoMock package.

Package secrets is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Query_OrderType_name = map[int32]string{
		0: "ASC",
		1: "DESC",
	}
	Query_OrderType_value = map[string]int32{
		"ASC":  0,
		"DESC": 1,
	}
)

Enum value maps for Query_OrderType.

View Source
var File_external_secrets_secrets_proto protoreflect.FileDescriptor

Functions

func RegisterSecretsServiceHandler

func RegisterSecretsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSecretsServiceHandler registers the http handlers for service SecretsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSecretsServiceHandlerClient

func RegisterSecretsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SecretsServiceClient) error

RegisterSecretsServiceHandlerClient registers the http handlers for service SecretsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SecretsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SecretsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SecretsServiceClient" to call the correct interceptors.

func RegisterSecretsServiceHandlerFromEndpoint

func RegisterSecretsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSecretsServiceHandlerFromEndpoint is same as RegisterSecretsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSecretsServiceHandlerServer

func RegisterSecretsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SecretsServiceServer) error

RegisterSecretsServiceHandlerServer registers the http handlers for service SecretsService to "mux". UnaryRPC :call SecretsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterSecretsServiceServer

func RegisterSecretsServiceServer(s *grpc.Server, srv SecretsServiceServer)

Types

type DeleteResponse

type DeleteResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type GcpCredential

type GcpCredential struct {
	Type                    string `json:"type"`
	ProjectID               string `json:"project_id"`
	ClientID                string `json:"client_id"`
	PrivateKeyID            string `json:"private_key_id"`
	PrivateKey              string `json:"private_key"`
	ClientEmail             string `json:"client_email"`
	AuthUri                 string `json:"auth_uri"`
	TokenUri                string `json:"token_uri"`
	AuthProviderX509CertUrl string `json:"auth_provider_x509_cert_url"`
	ClientX509CertUrl       string `json:"client_x509_cert_url"`
}

func UnmarshalGcpServiceAcc

func UnmarshalGcpServiceAcc(gcpJSONCred string) (gcpCred *GcpCredential, err error)

UnmarshalGcpServiceAcc receives the GCP credential as a json string, unmarshals it and verifies that it's a service account, recommended by Google for API integrations

type Id

type Id struct {

	// Unique node ID (UUID).
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*Id) Descriptor deprecated

func (*Id) Descriptor() ([]byte, []int)

Deprecated: Use Id.ProtoReflect.Descriptor instead.

func (*Id) GetId

func (x *Id) GetId() string

func (*Id) ProtoMessage

func (*Id) ProtoMessage()

func (*Id) ProtoReflect

func (x *Id) ProtoReflect() protoreflect.Message

func (*Id) Reset

func (x *Id) Reset()

func (*Id) String

func (x *Id) String() string

type MockSecretsServiceClient

type MockSecretsServiceClient struct {
	// contains filtered or unexported fields
}

MockSecretsServiceClient is a mock of SecretsServiceClient interface

func NewMockSecretsServiceClient

func NewMockSecretsServiceClient(ctrl *gomock.Controller) *MockSecretsServiceClient

NewMockSecretsServiceClient creates a new mock instance

func (*MockSecretsServiceClient) Create

func (m *MockSecretsServiceClient) Create(ctx context.Context, in *Secret, opts ...grpc.CallOption) (*Id, error)

Create mocks base method

func (*MockSecretsServiceClient) Delete

func (m *MockSecretsServiceClient) Delete(ctx context.Context, in *Id, opts ...grpc.CallOption) (*DeleteResponse, error)

Delete mocks base method

func (*MockSecretsServiceClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockSecretsServiceClient) List

func (m *MockSecretsServiceClient) List(ctx context.Context, in *Query, opts ...grpc.CallOption) (*Secrets, error)

List mocks base method

func (*MockSecretsServiceClient) Read

func (m *MockSecretsServiceClient) Read(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Secret, error)

Read mocks base method

func (*MockSecretsServiceClient) Update

Update mocks base method

type MockSecretsServiceClientMockRecorder

type MockSecretsServiceClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockSecretsServiceClientMockRecorder is the mock recorder for MockSecretsServiceClient

func (*MockSecretsServiceClientMockRecorder) Create

func (mr *MockSecretsServiceClientMockRecorder) Create(ctx, in interface{}, opts ...interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockSecretsServiceClientMockRecorder) Delete

func (mr *MockSecretsServiceClientMockRecorder) Delete(ctx, in interface{}, opts ...interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockSecretsServiceClientMockRecorder) List

func (mr *MockSecretsServiceClientMockRecorder) List(ctx, in interface{}, opts ...interface{}) *gomock.Call

List indicates an expected call of List

func (*MockSecretsServiceClientMockRecorder) Read

func (mr *MockSecretsServiceClientMockRecorder) Read(ctx, in interface{}, opts ...interface{}) *gomock.Call

Read indicates an expected call of Read

func (*MockSecretsServiceClientMockRecorder) Update

func (mr *MockSecretsServiceClientMockRecorder) Update(ctx, in interface{}, opts ...interface{}) *gomock.Call

Update indicates an expected call of Update

type MockSecretsServiceServer

type MockSecretsServiceServer struct {
	// contains filtered or unexported fields
}

MockSecretsServiceServer is a mock of SecretsServiceServer interface

func NewMockSecretsServiceServer

func NewMockSecretsServiceServer(ctrl *gomock.Controller) *MockSecretsServiceServer

NewMockSecretsServiceServer creates a new mock instance

func (*MockSecretsServiceServer) Create

func (m *MockSecretsServiceServer) Create(arg0 context.Context, arg1 *Secret) (*Id, error)

Create mocks base method

func (*MockSecretsServiceServer) Delete

func (m *MockSecretsServiceServer) Delete(arg0 context.Context, arg1 *Id) (*DeleteResponse, error)

Delete mocks base method

func (*MockSecretsServiceServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockSecretsServiceServer) List

func (m *MockSecretsServiceServer) List(arg0 context.Context, arg1 *Query) (*Secrets, error)

List mocks base method

func (*MockSecretsServiceServer) Read

func (m *MockSecretsServiceServer) Read(arg0 context.Context, arg1 *Id) (*Secret, error)

Read mocks base method

func (*MockSecretsServiceServer) Update

Update mocks base method

type MockSecretsServiceServerMockRecorder

type MockSecretsServiceServerMockRecorder struct {
	// contains filtered or unexported fields
}

MockSecretsServiceServerMockRecorder is the mock recorder for MockSecretsServiceServer

func (*MockSecretsServiceServerMockRecorder) Create

func (mr *MockSecretsServiceServerMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockSecretsServiceServerMockRecorder) Delete

func (mr *MockSecretsServiceServerMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockSecretsServiceServerMockRecorder) List

func (mr *MockSecretsServiceServerMockRecorder) List(arg0, arg1 interface{}) *gomock.Call

List indicates an expected call of List

func (*MockSecretsServiceServerMockRecorder) Read

func (mr *MockSecretsServiceServerMockRecorder) Read(arg0, arg1 interface{}) *gomock.Call

Read indicates an expected call of Read

func (*MockSecretsServiceServerMockRecorder) Update

func (mr *MockSecretsServiceServerMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call

Update indicates an expected call of Update

type Query

type Query struct {

	// Use filters to limit the set of secrets.
	Filters []*query.Filter `protobuf:"bytes,20,rep,name=filters,proto3" json:"filters,omitempty"`
	Order   Query_OrderType `protobuf:"varint,21,opt,name=order,proto3,enum=chef.automate.api.secrets.Query_OrderType" json:"order,omitempty"`
	// Sort the results on a specific field.
	Sort string `protobuf:"bytes,22,opt,name=sort,proto3" json:"sort,omitempty"`
	// Starting page for the results.
	Page int32 `protobuf:"varint,23,opt,name=page,proto3" json:"page,omitempty"`
	// The number of results on each page.
	PerPage int32 `protobuf:"varint,24,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"`
	// contains filtered or unexported fields
}

func (*Query) Descriptor deprecated

func (*Query) Descriptor() ([]byte, []int)

Deprecated: Use Query.ProtoReflect.Descriptor instead.

func (*Query) GetFilters

func (x *Query) GetFilters() []*query.Filter

func (*Query) GetOrder

func (x *Query) GetOrder() Query_OrderType

func (*Query) GetPage

func (x *Query) GetPage() int32

func (*Query) GetPerPage

func (x *Query) GetPerPage() int32

func (*Query) GetSort

func (x *Query) GetSort() string

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) ProtoReflect

func (x *Query) ProtoReflect() protoreflect.Message

func (*Query) Reset

func (x *Query) Reset()

func (*Query) String

func (x *Query) String() string

type Query_OrderType

type Query_OrderType int32

Return the results in ascending or descending order.

const (
	Query_ASC  Query_OrderType = 0
	Query_DESC Query_OrderType = 1
)

func (Query_OrderType) Descriptor

func (Query_OrderType) Enum

func (x Query_OrderType) Enum() *Query_OrderType

func (Query_OrderType) EnumDescriptor deprecated

func (Query_OrderType) EnumDescriptor() ([]byte, []int)

Deprecated: Use Query_OrderType.Descriptor instead.

func (Query_OrderType) Number

func (Query_OrderType) String

func (x Query_OrderType) String() string

func (Query_OrderType) Type

type Secret

type Secret struct {

	// Unique node ID (UUID).
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// User-specified name for the secret.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Type of credential: ssh, winrm, sudo, aws, azure, gcp, service_now
	Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// Timestamp denoting when the secret was last modified.
	LastModified *timestamppb.Timestamp `protobuf:"bytes,20,opt,name=last_modified,json=lastModified,proto3" json:"last_modified,omitempty"`
	// Tags to associate with the secret.
	Tags []*query.Kv `protobuf:"bytes,21,rep,name=tags,proto3" json:"tags,omitempty"`
	// Secret data, where the kv structs for the credential data live.
	Data []*query.Kv `protobuf:"bytes,22,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Secret) Descriptor deprecated

func (*Secret) Descriptor() ([]byte, []int)

Deprecated: Use Secret.ProtoReflect.Descriptor instead.

func (*Secret) GetData

func (x *Secret) GetData() []*query.Kv

func (*Secret) GetId

func (x *Secret) GetId() string

func (*Secret) GetLastModified

func (x *Secret) GetLastModified() *timestamppb.Timestamp

func (*Secret) GetName

func (x *Secret) GetName() string

func (*Secret) GetTags

func (x *Secret) GetTags() []*query.Kv

func (*Secret) GetType

func (x *Secret) GetType() string

func (*Secret) Merge

func (s *Secret) Merge(newSecret *Secret)

Merge combines the existing secret with fields from the new secret. Fields they have in common will replaced with the fields from new. Fields found in the Data attribute will not be removed from old if they are not found in new.

func (*Secret) ProtoMessage

func (*Secret) ProtoMessage()

func (*Secret) ProtoReflect

func (x *Secret) ProtoReflect() protoreflect.Message

func (*Secret) Reset

func (x *Secret) Reset()

func (*Secret) String

func (x *Secret) String() string

func (*Secret) Validate

func (s *Secret) Validate() error

Validate validates a Secret and returns the first validation error encountered.

type Secrets

type Secrets struct {

	// List of secrets.
	Secrets []*Secret `protobuf:"bytes,1,rep,name=secrets,proto3" json:"secrets,omitempty"`
	// Total count of secrets
	Total int32 `protobuf:"varint,20,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

func (*Secrets) Descriptor deprecated

func (*Secrets) Descriptor() ([]byte, []int)

Deprecated: Use Secrets.ProtoReflect.Descriptor instead.

func (*Secrets) GetSecrets

func (x *Secrets) GetSecrets() []*Secret

func (*Secrets) GetTotal

func (x *Secrets) GetTotal() int32

func (*Secrets) ProtoMessage

func (*Secrets) ProtoMessage()

func (*Secrets) ProtoReflect

func (x *Secrets) ProtoReflect() protoreflect.Message

func (*Secrets) Reset

func (x *Secrets) Reset()

func (*Secrets) String

func (x *Secrets) String() string

type SecretsServiceClient

type SecretsServiceClient interface {
	// Create a secret
	//
	// Creates a secret. Requires values for name, type, and data.
	//
	// Supported types: ssh, winrm, sudo, aws, azure, gcp, service_now
	// Supported keys by type:
	// ssh: username, password, key
	// winrm: username, password
	// sudo: username, password
	// service_now: username, password
	// aws: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN
	// azure: AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID
	// azure: AZURE_SUBSCRIPTION_ID is optional
	// gcp: GOOGLE_CREDENTIALS_JSON
	//
	// Example:
	// “`
	// {
	// "name": "my ssh secret",
	// "type": "ssh",
	// "data": [
	// { "key": "username", "value": "vagrant" },
	// { "key": "password", "value": "vagrant"}
	// ]
	// }
	// “`
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:create
	Create(ctx context.Context, in *Secret, opts ...grpc.CallOption) (*Id, error)
	// Read a secret
	//
	// Reads a secret given the ID of the secret.
	// Note that the secret information (password and key values) will not be returned by the API, as a safety measure.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:get
	Read(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Secret, error)
	// Update a secret
	//
	// Updates a secret.
	// This is a PATCH operation, meaning the details sent in will override/replace those stored in the DB.
	// Secret information that is not in the body of the request will persist.
	//
	// Example:
	// “`
	// given a credential with a username and password, a user could update the password by passing in the following body,
	// and the name of the secret as well as the username for the secret be unchanged:
	//
	// {
	// "id": "525c013a-2ab3-4e6f-9005-51bc620e9157",
	// "data": [
	// { "key": "password", "value": "new-value"}
	// ]
	// }
	// “`
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:update
	Update(ctx context.Context, in *Secret, opts ...grpc.CallOption) (*UpdateResponse, error)
	// Delete a secret
	//
	// Deletes a secret given the ID of the secret.
	// Note that any nodes that were using the secret will no longer be associated with the deleted secret.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:delete
	Delete(ctx context.Context, in *Id, opts ...grpc.CallOption) (*DeleteResponse, error)
	// List and filter secrets
	//
	// Makes a list of secrets.
	// Supports filtering, pagination, and sorting.
	// Adding a filter narrows the list of secrets to only those that match the filter or filters.
	// Supported filters: type, name
	// Supported sort types: name, type, last modified
	//
	// Example:
	// “`
	// {
	// "sort": "type",
	// "order": "ASC",
	// "filters": [
	// { "key": "type", "values": ["ssh","winrm","sudo"] }
	// ],
	// "page":1,
	// "per_page":100
	// }
	// “`
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:list
	List(ctx context.Context, in *Query, opts ...grpc.CallOption) (*Secrets, error)
}

SecretsServiceClient is the client API for SecretsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type SecretsServiceServer

type SecretsServiceServer interface {
	// Create a secret
	//
	// Creates a secret. Requires values for name, type, and data.
	//
	// Supported types: ssh, winrm, sudo, aws, azure, gcp, service_now
	// Supported keys by type:
	// ssh: username, password, key
	// winrm: username, password
	// sudo: username, password
	// service_now: username, password
	// aws: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN
	// azure: AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID
	// azure: AZURE_SUBSCRIPTION_ID is optional
	// gcp: GOOGLE_CREDENTIALS_JSON
	//
	// Example:
	// “`
	// {
	// "name": "my ssh secret",
	// "type": "ssh",
	// "data": [
	// { "key": "username", "value": "vagrant" },
	// { "key": "password", "value": "vagrant"}
	// ]
	// }
	// “`
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:create
	Create(context.Context, *Secret) (*Id, error)
	// Read a secret
	//
	// Reads a secret given the ID of the secret.
	// Note that the secret information (password and key values) will not be returned by the API, as a safety measure.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:get
	Read(context.Context, *Id) (*Secret, error)
	// Update a secret
	//
	// Updates a secret.
	// This is a PATCH operation, meaning the details sent in will override/replace those stored in the DB.
	// Secret information that is not in the body of the request will persist.
	//
	// Example:
	// “`
	// given a credential with a username and password, a user could update the password by passing in the following body,
	// and the name of the secret as well as the username for the secret be unchanged:
	//
	// {
	// "id": "525c013a-2ab3-4e6f-9005-51bc620e9157",
	// "data": [
	// { "key": "password", "value": "new-value"}
	// ]
	// }
	// “`
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:update
	Update(context.Context, *Secret) (*UpdateResponse, error)
	// Delete a secret
	//
	// Deletes a secret given the ID of the secret.
	// Note that any nodes that were using the secret will no longer be associated with the deleted secret.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:delete
	Delete(context.Context, *Id) (*DeleteResponse, error)
	// List and filter secrets
	//
	// Makes a list of secrets.
	// Supports filtering, pagination, and sorting.
	// Adding a filter narrows the list of secrets to only those that match the filter or filters.
	// Supported filters: type, name
	// Supported sort types: name, type, last modified
	//
	// Example:
	// “`
	// {
	// "sort": "type",
	// "order": "ASC",
	// "filters": [
	// { "key": "type", "values": ["ssh","winrm","sudo"] }
	// ],
	// "page":1,
	// "per_page":100
	// }
	// “`
	//
	// Authorization Action:
	// “`
	// “`
	//
	//secrets:secrets:list
	List(context.Context, *Query) (*Secrets, error)
}

SecretsServiceServer is the server API for SecretsService service.

type UnimplementedSecretsServiceServer

type UnimplementedSecretsServiceServer struct {
}

UnimplementedSecretsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedSecretsServiceServer) Create

func (*UnimplementedSecretsServiceServer) Delete

func (*UnimplementedSecretsServiceServer) List

func (*UnimplementedSecretsServiceServer) Read

func (*UnimplementedSecretsServiceServer) Update

type UpdateResponse

type UpdateResponse struct {
	// contains filtered or unexported fields
}

func (*UpdateResponse) Descriptor deprecated

func (*UpdateResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

func (x *UpdateResponse) ProtoReflect() protoreflect.Message

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

Jump to

Keyboard shortcuts

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