v2

package
v0.0.0-...-a8b8e24 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package v2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package v2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package v2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package v2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package v2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package v2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_external_iam_v2_introspect_proto protoreflect.FileDescriptor
View Source
var File_external_iam_v2_policy_proto protoreflect.FileDescriptor
View Source
var File_external_iam_v2_rules_proto protoreflect.FileDescriptor
View Source
var File_external_iam_v2_teams_proto protoreflect.FileDescriptor
View Source
var File_external_iam_v2_tokens_proto protoreflect.FileDescriptor
View Source
var File_external_iam_v2_users_proto protoreflect.FileDescriptor

Functions

func RegisterAuthorizationHandler

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

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

func RegisterAuthorizationHandlerClient

func RegisterAuthorizationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthorizationClient) error

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

func RegisterAuthorizationHandlerFromEndpoint

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

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

func RegisterAuthorizationHandlerServer

func RegisterAuthorizationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthorizationServer) error

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

func RegisterAuthorizationServer

func RegisterAuthorizationServer(s *grpc.Server, srv AuthorizationServer)

func RegisterPoliciesHandler

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

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

func RegisterPoliciesHandlerClient

func RegisterPoliciesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PoliciesClient) error

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

func RegisterPoliciesHandlerFromEndpoint

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

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

func RegisterPoliciesHandlerServer

func RegisterPoliciesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PoliciesServer) error

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

func RegisterPoliciesServer

func RegisterPoliciesServer(s *grpc.Server, srv PoliciesServer)

func RegisterRulesHandler

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

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

func RegisterRulesHandlerClient

func RegisterRulesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RulesClient) error

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

func RegisterRulesHandlerFromEndpoint

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

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

func RegisterRulesHandlerServer

func RegisterRulesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RulesServer) error

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

func RegisterRulesServer

func RegisterRulesServer(s *grpc.Server, srv RulesServer)

func RegisterTeamsHandler

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

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

func RegisterTeamsHandlerClient

func RegisterTeamsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TeamsClient) error

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

func RegisterTeamsHandlerFromEndpoint

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

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

func RegisterTeamsHandlerServer

func RegisterTeamsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TeamsServer) error

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

func RegisterTeamsServer

func RegisterTeamsServer(s *grpc.Server, srv TeamsServer)

func RegisterTokensHandler

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

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

func RegisterTokensHandlerClient

func RegisterTokensHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TokensClient) error

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

func RegisterTokensHandlerFromEndpoint

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

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

func RegisterTokensHandlerServer

func RegisterTokensHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TokensServer) error

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

func RegisterTokensServer

func RegisterTokensServer(s *grpc.Server, srv TokensServer)

func RegisterUsersHandler

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

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

func RegisterUsersHandlerClient

func RegisterUsersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersClient) error

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

func RegisterUsersHandlerFromEndpoint

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

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

func RegisterUsersHandlerServer

func RegisterUsersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServer) error

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

func RegisterUsersServer

func RegisterUsersServer(s *grpc.Server, srv UsersServer)

Types

type AuthorizationClient

type AuthorizationClient interface {
	IntrospectAll(ctx context.Context, in *request.IntrospectAllReq, opts ...grpc.CallOption) (*response.IntrospectResp, error)
	IntrospectSome(ctx context.Context, in *request.IntrospectSomeReq, opts ...grpc.CallOption) (*response.IntrospectResp, error)
	Introspect(ctx context.Context, in *request.IntrospectReq, opts ...grpc.CallOption) (*response.IntrospectResp, error)
}

AuthorizationClient is the client API for Authorization service.

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

type AuthorizationServer

AuthorizationServer is the server API for Authorization service.

type AuthorizationServerMock

type AuthorizationServerMock struct {
	IntrospectAllFunc  func(context.Context, *request.IntrospectAllReq) (*response.IntrospectResp, error)
	IntrospectSomeFunc func(context.Context, *request.IntrospectSomeReq) (*response.IntrospectResp, error)
	IntrospectFunc     func(context.Context, *request.IntrospectReq) (*response.IntrospectResp, error)
	// contains filtered or unexported fields
}

AuthorizationServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewAuthorizationServerMock

func NewAuthorizationServerMock() *AuthorizationServerMock

NewAuthorizationServerMock gives you a fresh instance of AuthorizationServerMock.

func NewAuthorizationServerMockWithoutValidation

func NewAuthorizationServerMockWithoutValidation() *AuthorizationServerMock

NewAuthorizationServerMockWithoutValidation gives you a fresh instance of AuthorizationServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*AuthorizationServerMock) Introspect

func (*AuthorizationServerMock) IntrospectAll

func (*AuthorizationServerMock) IntrospectSome

func (*AuthorizationServerMock) Reset

func (m *AuthorizationServerMock) Reset()

Reset resets all overridden functions

type PoliciesClient

type PoliciesClient interface {
	// Creates a custom policy
	//
	// Creates a custom IAM policy used to control permissions in Automate.
	// A policy is composed of one or more statements that grant permissions to a set of members.
	// Each statement contains a role as well as a list of projects.
	//
	// The role defines a set of actions that the statement is scoped to.
	// The project list defines the set of resources that the statement is scoped to.
	// Pass `"projects": ["*"]` to scope a statement to every project.
	//
	// A policy's *top-level* projects list defines which projects the policy belongs to (for filtering policies by their projects),
	// whereas the *statement-level* projects list defines which projects the statement applies to.
	//
	// The example creates a new policy not associated with any project (because the top-level `projects` property is empty) that grants the `viewer` role
	// on a few projects for all LDAP teams and a custom role `qa` on a specific project.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:create
	CreatePolicy(ctx context.Context, in *request.CreatePolicyReq, opts ...grpc.CallOption) (*response.CreatePolicyResp, error)
	// Gets a policy
	//
	// Returns the details for a policy.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:get
	GetPolicy(ctx context.Context, in *request.GetPolicyReq, opts ...grpc.CallOption) (*response.GetPolicyResp, error)
	// Lists all policies
	//
	// Lists all policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:list
	ListPolicies(ctx context.Context, in *request.ListPoliciesReq, opts ...grpc.CallOption) (*response.ListPoliciesResp, error)
	// Deletes a custom policy
	//
	// Deletes a specified custom policy. You cannot delete Chef-managed policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:delete
	DeletePolicy(ctx context.Context, in *request.DeletePolicyReq, opts ...grpc.CallOption) (*response.DeletePolicyResp, error)
	// Updates a custom policy
	//
	// This operation overwrites all fields excepting ID,
	// including those omitted from the request, so be sure to specify all properties.
	// Properties that you do not include are reset to empty values.
	// The only exception is the policy ID, which is immutable; it can only be set at creation time.
	//
	// While you can use this endpoint to update members on a policy, if that is the only
	// property you wish to modify you might find it more convenient to use one of these endpoints instead:
	// Add policy members, Remove policy members, or Replace policy members.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:update
	UpdatePolicy(ctx context.Context, in *request.UpdatePolicyReq, opts ...grpc.CallOption) (*response.UpdatePolicyResp, error)
	// Gets IAM version
	//
	// Returns the major and minor version of IAM that your automate installation is running.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:get
	GetPolicyVersion(ctx context.Context, in *request.GetPolicyVersionReq, opts ...grpc.CallOption) (*response.GetPolicyVersionResp, error)
	// Lists policy members
	//
	// Lists all members of a specific policy.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policyMembers:get
	ListPolicyMembers(ctx context.Context, in *request.ListPolicyMembersReq, opts ...grpc.CallOption) (*response.ListPolicyMembersResp, error)
	// Replaces policy members
	//
	// Replaces the entire member list of a specific policy with a new list.
	// You may use this endpoint to update members of either Custom or Chef-managed policies.
	//
	// Ensure each element of the members array is in the correct
	// [Member Expression](https://automate.chef.io/docs/iam-v2-guide/#member-expressions) format.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policyMembers:update
	ReplacePolicyMembers(ctx context.Context, in *request.ReplacePolicyMembersReq, opts ...grpc.CallOption) (*response.ReplacePolicyMembersResp, error)
	// Removes policy members
	//
	// Removes members from the member list of a specific policy. Silently ignores
	// members that are not already part of the member list.
	// You may use this endpoint to update members of either Custom or Chef-managed policies.
	//
	// Ensure each element of the members array is in the correct
	// [Member Expression](https://automate.chef.io/docs/iam-v2-guide/#member-expressions) format.
	//
	// The removed members will still exist within Chef Automate, but are no longer associated with this policy.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policyMembers:delete
	RemovePolicyMembers(ctx context.Context, in *request.RemovePolicyMembersReq, opts ...grpc.CallOption) (*response.RemovePolicyMembersResp, error)
	// Adds policy members
	//
	// Adds members to the member list of a specific policy.
	// You may use this endpoint to update members of either Custom or Chef-managed policies.
	//
	// Ensure each element of the members array is in the correct
	// [Member Expression](https://automate.chef.io/docs/iam-v2-guide/#member-expressions) format.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policyMembers:create
	AddPolicyMembers(ctx context.Context, in *request.AddPolicyMembersReq, opts ...grpc.CallOption) (*response.AddPolicyMembersResp, error)
	// Creates a custom role
	//
	// Creates a new role to be used in the policies that control permissions in Automate.
	//
	// A role defines the scope of actions in a policy statement.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:create
	CreateRole(ctx context.Context, in *request.CreateRoleReq, opts ...grpc.CallOption) (*response.CreateRoleResp, error)
	// Lists all roles
	//
	// Lists all *Chef-managed* and *Custom* roles.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:list
	ListRoles(ctx context.Context, in *request.ListRolesReq, opts ...grpc.CallOption) (*response.ListRolesResp, error)
	// Gets a role
	//
	// Returns the details for a role.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:get
	GetRole(ctx context.Context, in *request.GetRoleReq, opts ...grpc.CallOption) (*response.GetRoleResp, error)
	// Deletes a custom role
	//
	// Deletes a specified custom role (you cannot delete Chef-managed roles) and remove it from any statements that may have been using it.
	// If such a statement has no other associated actions, the statement is deleted as well.
	// Similarly, if that statement removal results in a policy with no other statements,
	// that policy is removed as well.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:delete
	DeleteRole(ctx context.Context, in *request.DeleteRoleReq, opts ...grpc.CallOption) (*response.DeleteRoleResp, error)
	// Updates a custom role
	//
	// This operation overwrites all fields excepting ID,
	// including those omitted from the request, so be sure to specify all properties.
	// Properties that you do not include are reset to empty values.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:update
	UpdateRole(ctx context.Context, in *request.UpdateRoleReq, opts ...grpc.CallOption) (*response.UpdateRoleResp, error)
	// Creates a project
	//
	// Creates a new project to be used in the policies that control permissions in Automate.
	//
	// A project defines the scope of resources in a policy statement. Resources can be in more than one project.
	//
	// When a project is created, the system also creates three policies associated with the new project,
	// one for each of the following roles: editor, viewer, and project owner.
	// You can optionally pass the `skip_policies` flag set to `true` to skip the creation of these policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:create
	CreateProject(ctx context.Context, in *request.CreateProjectReq, opts ...grpc.CallOption) (*response.CreateProjectResp, error)
	// Updates a project
	//
	// Updates the name of an existing project.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:update
	UpdateProject(ctx context.Context, in *request.UpdateProjectReq, opts ...grpc.CallOption) (*response.UpdateProjectResp, error)
	// Gets a project
	//
	// Returns the details for a project.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:get
	GetProject(ctx context.Context, in *request.GetProjectReq, opts ...grpc.CallOption) (*response.GetProjectResp, error)
	// Lists all projects
	//
	// Lists all projects.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:list
	ListProjects(ctx context.Context, in *request.ListProjectsReq, opts ...grpc.CallOption) (*response.ListProjectsResp, error)
	// Deletes a project
	//
	// Deletes a project from any resources tagged with it.
	//
	// Also deletes this project from any project list in any policy statements.
	// If the resulting project list for a given statement is empty, it is deleted.
	// If the resulting policy has no statements, it is also deleted.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:delete
	DeleteProject(ctx context.Context, in *request.DeleteProjectReq, opts ...grpc.CallOption) (*response.DeleteProjectResp, error)
	IntrospectAllProjects(ctx context.Context, in *request.ListProjectsReq, opts ...grpc.CallOption) (*response.ListProjectsResp, error)
}

PoliciesClient is the client API for Policies service.

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

func NewPoliciesClient

func NewPoliciesClient(cc grpc.ClientConnInterface) PoliciesClient

type PoliciesServer

type PoliciesServer interface {
	// Creates a custom policy
	//
	// Creates a custom IAM policy used to control permissions in Automate.
	// A policy is composed of one or more statements that grant permissions to a set of members.
	// Each statement contains a role as well as a list of projects.
	//
	// The role defines a set of actions that the statement is scoped to.
	// The project list defines the set of resources that the statement is scoped to.
	// Pass `"projects": ["*"]` to scope a statement to every project.
	//
	// A policy's *top-level* projects list defines which projects the policy belongs to (for filtering policies by their projects),
	// whereas the *statement-level* projects list defines which projects the statement applies to.
	//
	// The example creates a new policy not associated with any project (because the top-level `projects` property is empty) that grants the `viewer` role
	// on a few projects for all LDAP teams and a custom role `qa` on a specific project.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:create
	CreatePolicy(context.Context, *request.CreatePolicyReq) (*response.CreatePolicyResp, error)
	// Gets a policy
	//
	// Returns the details for a policy.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:get
	GetPolicy(context.Context, *request.GetPolicyReq) (*response.GetPolicyResp, error)
	// Lists all policies
	//
	// Lists all policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:list
	ListPolicies(context.Context, *request.ListPoliciesReq) (*response.ListPoliciesResp, error)
	// Deletes a custom policy
	//
	// Deletes a specified custom policy. You cannot delete Chef-managed policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:delete
	DeletePolicy(context.Context, *request.DeletePolicyReq) (*response.DeletePolicyResp, error)
	// Updates a custom policy
	//
	// This operation overwrites all fields excepting ID,
	// including those omitted from the request, so be sure to specify all properties.
	// Properties that you do not include are reset to empty values.
	// The only exception is the policy ID, which is immutable; it can only be set at creation time.
	//
	// While you can use this endpoint to update members on a policy, if that is the only
	// property you wish to modify you might find it more convenient to use one of these endpoints instead:
	// Add policy members, Remove policy members, or Replace policy members.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:update
	UpdatePolicy(context.Context, *request.UpdatePolicyReq) (*response.UpdatePolicyResp, error)
	// Gets IAM version
	//
	// Returns the major and minor version of IAM that your automate installation is running.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policies:get
	GetPolicyVersion(context.Context, *request.GetPolicyVersionReq) (*response.GetPolicyVersionResp, error)
	// Lists policy members
	//
	// Lists all members of a specific policy.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policyMembers:get
	ListPolicyMembers(context.Context, *request.ListPolicyMembersReq) (*response.ListPolicyMembersResp, error)
	// Replaces policy members
	//
	// Replaces the entire member list of a specific policy with a new list.
	// You may use this endpoint to update members of either Custom or Chef-managed policies.
	//
	// Ensure each element of the members array is in the correct
	// [Member Expression](https://automate.chef.io/docs/iam-v2-guide/#member-expressions) format.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policyMembers:update
	ReplacePolicyMembers(context.Context, *request.ReplacePolicyMembersReq) (*response.ReplacePolicyMembersResp, error)
	// Removes policy members
	//
	// Removes members from the member list of a specific policy. Silently ignores
	// members that are not already part of the member list.
	// You may use this endpoint to update members of either Custom or Chef-managed policies.
	//
	// Ensure each element of the members array is in the correct
	// [Member Expression](https://automate.chef.io/docs/iam-v2-guide/#member-expressions) format.
	//
	// The removed members will still exist within Chef Automate, but are no longer associated with this policy.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policyMembers:delete
	RemovePolicyMembers(context.Context, *request.RemovePolicyMembersReq) (*response.RemovePolicyMembersResp, error)
	// Adds policy members
	//
	// Adds members to the member list of a specific policy.
	// You may use this endpoint to update members of either Custom or Chef-managed policies.
	//
	// Ensure each element of the members array is in the correct
	// [Member Expression](https://automate.chef.io/docs/iam-v2-guide/#member-expressions) format.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:policyMembers:create
	AddPolicyMembers(context.Context, *request.AddPolicyMembersReq) (*response.AddPolicyMembersResp, error)
	// Creates a custom role
	//
	// Creates a new role to be used in the policies that control permissions in Automate.
	//
	// A role defines the scope of actions in a policy statement.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:create
	CreateRole(context.Context, *request.CreateRoleReq) (*response.CreateRoleResp, error)
	// Lists all roles
	//
	// Lists all *Chef-managed* and *Custom* roles.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:list
	ListRoles(context.Context, *request.ListRolesReq) (*response.ListRolesResp, error)
	// Gets a role
	//
	// Returns the details for a role.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:get
	GetRole(context.Context, *request.GetRoleReq) (*response.GetRoleResp, error)
	// Deletes a custom role
	//
	// Deletes a specified custom role (you cannot delete Chef-managed roles) and remove it from any statements that may have been using it.
	// If such a statement has no other associated actions, the statement is deleted as well.
	// Similarly, if that statement removal results in a policy with no other statements,
	// that policy is removed as well.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:delete
	DeleteRole(context.Context, *request.DeleteRoleReq) (*response.DeleteRoleResp, error)
	// Updates a custom role
	//
	// This operation overwrites all fields excepting ID,
	// including those omitted from the request, so be sure to specify all properties.
	// Properties that you do not include are reset to empty values.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:roles:update
	UpdateRole(context.Context, *request.UpdateRoleReq) (*response.UpdateRoleResp, error)
	// Creates a project
	//
	// Creates a new project to be used in the policies that control permissions in Automate.
	//
	// A project defines the scope of resources in a policy statement. Resources can be in more than one project.
	//
	// When a project is created, the system also creates three policies associated with the new project,
	// one for each of the following roles: editor, viewer, and project owner.
	// You can optionally pass the `skip_policies` flag set to `true` to skip the creation of these policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:create
	CreateProject(context.Context, *request.CreateProjectReq) (*response.CreateProjectResp, error)
	// Updates a project
	//
	// Updates the name of an existing project.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:update
	UpdateProject(context.Context, *request.UpdateProjectReq) (*response.UpdateProjectResp, error)
	// Gets a project
	//
	// Returns the details for a project.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:get
	GetProject(context.Context, *request.GetProjectReq) (*response.GetProjectResp, error)
	// Lists all projects
	//
	// Lists all projects.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:list
	ListProjects(context.Context, *request.ListProjectsReq) (*response.ListProjectsResp, error)
	// Deletes a project
	//
	// Deletes a project from any resources tagged with it.
	//
	// Also deletes this project from any project list in any policy statements.
	// If the resulting project list for a given statement is empty, it is deleted.
	// If the resulting policy has no statements, it is also deleted.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:delete
	DeleteProject(context.Context, *request.DeleteProjectReq) (*response.DeleteProjectResp, error)
	IntrospectAllProjects(context.Context, *request.ListProjectsReq) (*response.ListProjectsResp, error)
}

PoliciesServer is the server API for Policies service.

type PoliciesServerMock

type PoliciesServerMock struct {
	CreatePolicyFunc          func(context.Context, *request.CreatePolicyReq) (*response.CreatePolicyResp, error)
	GetPolicyFunc             func(context.Context, *request.GetPolicyReq) (*response.GetPolicyResp, error)
	ListPoliciesFunc          func(context.Context, *request.ListPoliciesReq) (*response.ListPoliciesResp, error)
	DeletePolicyFunc          func(context.Context, *request.DeletePolicyReq) (*response.DeletePolicyResp, error)
	UpdatePolicyFunc          func(context.Context, *request.UpdatePolicyReq) (*response.UpdatePolicyResp, error)
	GetPolicyVersionFunc      func(context.Context, *request.GetPolicyVersionReq) (*response.GetPolicyVersionResp, error)
	ListPolicyMembersFunc     func(context.Context, *request.ListPolicyMembersReq) (*response.ListPolicyMembersResp, error)
	ReplacePolicyMembersFunc  func(context.Context, *request.ReplacePolicyMembersReq) (*response.ReplacePolicyMembersResp, error)
	RemovePolicyMembersFunc   func(context.Context, *request.RemovePolicyMembersReq) (*response.RemovePolicyMembersResp, error)
	AddPolicyMembersFunc      func(context.Context, *request.AddPolicyMembersReq) (*response.AddPolicyMembersResp, error)
	CreateRoleFunc            func(context.Context, *request.CreateRoleReq) (*response.CreateRoleResp, error)
	ListRolesFunc             func(context.Context, *request.ListRolesReq) (*response.ListRolesResp, error)
	GetRoleFunc               func(context.Context, *request.GetRoleReq) (*response.GetRoleResp, error)
	DeleteRoleFunc            func(context.Context, *request.DeleteRoleReq) (*response.DeleteRoleResp, error)
	UpdateRoleFunc            func(context.Context, *request.UpdateRoleReq) (*response.UpdateRoleResp, error)
	CreateProjectFunc         func(context.Context, *request.CreateProjectReq) (*response.CreateProjectResp, error)
	UpdateProjectFunc         func(context.Context, *request.UpdateProjectReq) (*response.UpdateProjectResp, error)
	GetProjectFunc            func(context.Context, *request.GetProjectReq) (*response.GetProjectResp, error)
	ListProjectsFunc          func(context.Context, *request.ListProjectsReq) (*response.ListProjectsResp, error)
	DeleteProjectFunc         func(context.Context, *request.DeleteProjectReq) (*response.DeleteProjectResp, error)
	IntrospectAllProjectsFunc func(context.Context, *request.ListProjectsReq) (*response.ListProjectsResp, error)
	// contains filtered or unexported fields
}

PoliciesServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewPoliciesServerMock

func NewPoliciesServerMock() *PoliciesServerMock

NewPoliciesServerMock gives you a fresh instance of PoliciesServerMock.

func NewPoliciesServerMockWithoutValidation

func NewPoliciesServerMockWithoutValidation() *PoliciesServerMock

NewPoliciesServerMockWithoutValidation gives you a fresh instance of PoliciesServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*PoliciesServerMock) AddPolicyMembers

func (*PoliciesServerMock) CreatePolicy

func (*PoliciesServerMock) CreateProject

func (*PoliciesServerMock) CreateRole

func (*PoliciesServerMock) DeletePolicy

func (*PoliciesServerMock) DeleteProject

func (*PoliciesServerMock) DeleteRole

func (*PoliciesServerMock) GetPolicy

func (*PoliciesServerMock) GetPolicyVersion

func (*PoliciesServerMock) GetProject

func (*PoliciesServerMock) GetRole

func (*PoliciesServerMock) IntrospectAllProjects

func (m *PoliciesServerMock) IntrospectAllProjects(ctx context.Context, req *request.ListProjectsReq) (*response.ListProjectsResp, error)

func (*PoliciesServerMock) ListPolicies

func (*PoliciesServerMock) ListPolicyMembers

func (*PoliciesServerMock) ListProjects

func (*PoliciesServerMock) ListRoles

func (*PoliciesServerMock) RemovePolicyMembers

func (*PoliciesServerMock) ReplacePolicyMembers

func (*PoliciesServerMock) Reset

func (m *PoliciesServerMock) Reset()

Reset resets all overridden functions

func (*PoliciesServerMock) UpdatePolicy

func (*PoliciesServerMock) UpdateProject

func (*PoliciesServerMock) UpdateRole

type RulesClient

type RulesClient interface {
	// Create a project rule
	//
	// Creates a new project rule to move ingested resources into projects.
	//
	// A project rule contains conditions that determine if an ingested resource should be moved into the rule’s project.
	//
	// Each condition specifies one or more values to match for a particular attribute on an ingested resource.
	//
	// The choice of attributes depends on the rule type.
	// For NODE type, specify any of the available attributes.
	// For EVENT type, specify either CHEF_ORGANIZATION or CHEF_SERVER.
	//
	// The choice of operator depends on how many values you provide.
	// If you wish to match one among a group of values, set the operator to MEMBER_OF.
	// For a single value, use EQUALS.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:update
	CreateRule(ctx context.Context, in *request.CreateRuleReq, opts ...grpc.CallOption) (*response.CreateRuleResp, error)
	// Update a project rule
	//
	// Updates the name and conditions of an existing project rule.
	// New conditions can be added. Existing conditions can be updated or removed.
	//
	// This operation overwrites all fields excluding ID and Type,
	// including those omitted from the request, so be sure to specify all properties.
	// Properties that you do not include are reset to empty values.
	//
	// The resulting change to the project's resources does not take effect immediately.
	// Updates to project rules must be applied to ingested resources by a project update.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:update
	UpdateRule(ctx context.Context, in *request.UpdateRuleReq, opts ...grpc.CallOption) (*response.UpdateRuleResp, error)
	// Get a project rule
	//
	// Returns the details for a project rule.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:get
	GetRule(ctx context.Context, in *request.GetRuleReq, opts ...grpc.CallOption) (*response.GetRuleResp, error)
	// List a project's rules
	//
	// Lists all of the project rules of a specific project.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:get
	ListRulesForProject(ctx context.Context, in *request.ListRulesForProjectReq, opts ...grpc.CallOption) (*response.ListRulesForProjectResp, error)
	// Delete a project rule
	//
	// The resulting change to the project's resources does not take effect immediately.
	// Updates to project rules must be applied to ingested resources by a project update.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:update
	DeleteRule(ctx context.Context, in *request.DeleteRuleReq, opts ...grpc.CallOption) (*response.DeleteRuleResp, error)
	// Start project update
	//
	// Any changes to a project's rules are staged first. They do not take effect until
	// all projects are updated.
	//
	// Updating all projects begins an operation that applies all pending rule edits
	// and then moves ingested resources into the correct projects according to those latest changes.
	//
	// With a large amount of historical compliance data, rule application can take a considerable amount of time.
	// It’s best to batch up rule changes and apply them all at once.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:rules:apply
	ApplyRulesStart(ctx context.Context, in *request.ApplyRulesStartReq, opts ...grpc.CallOption) (*response.ApplyRulesStartResp, error)
	// Cancel project update
	//
	// Cancels an ongoing project update.
	//
	// Warning! This action leaves the system in an unknown state that only another
	// successful project update can rectify.
	//
	// This command exists really just for one scenario: you started a project update
	// but shortly thereafter discovered that you had one more change to include in the
	// batch of updates to be done.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:rules:cancel
	ApplyRulesCancel(ctx context.Context, in *request.ApplyRulesCancelReq, opts ...grpc.CallOption) (*response.ApplyRulesCancelResp, error)
	// Get the status of a project update
	//
	// Returns details about a project update operation.
	//
	// You can poll this endpoint during a project update to monitor progress.
	// Querying this endpoint when there is no update in progress will return details
	// about the completion status of the most recent update.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:rules:status
	ApplyRulesStatus(ctx context.Context, in *request.ApplyRulesStatusReq, opts ...grpc.CallOption) (*response.ApplyRulesStatusResp, error)
}

RulesClient is the client API for Rules service.

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

func NewRulesClient

func NewRulesClient(cc grpc.ClientConnInterface) RulesClient

type RulesServer

type RulesServer interface {
	// Create a project rule
	//
	// Creates a new project rule to move ingested resources into projects.
	//
	// A project rule contains conditions that determine if an ingested resource should be moved into the rule’s project.
	//
	// Each condition specifies one or more values to match for a particular attribute on an ingested resource.
	//
	// The choice of attributes depends on the rule type.
	// For NODE type, specify any of the available attributes.
	// For EVENT type, specify either CHEF_ORGANIZATION or CHEF_SERVER.
	//
	// The choice of operator depends on how many values you provide.
	// If you wish to match one among a group of values, set the operator to MEMBER_OF.
	// For a single value, use EQUALS.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:update
	CreateRule(context.Context, *request.CreateRuleReq) (*response.CreateRuleResp, error)
	// Update a project rule
	//
	// Updates the name and conditions of an existing project rule.
	// New conditions can be added. Existing conditions can be updated or removed.
	//
	// This operation overwrites all fields excluding ID and Type,
	// including those omitted from the request, so be sure to specify all properties.
	// Properties that you do not include are reset to empty values.
	//
	// The resulting change to the project's resources does not take effect immediately.
	// Updates to project rules must be applied to ingested resources by a project update.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:update
	UpdateRule(context.Context, *request.UpdateRuleReq) (*response.UpdateRuleResp, error)
	// Get a project rule
	//
	// Returns the details for a project rule.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:get
	GetRule(context.Context, *request.GetRuleReq) (*response.GetRuleResp, error)
	// List a project's rules
	//
	// Lists all of the project rules of a specific project.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:get
	ListRulesForProject(context.Context, *request.ListRulesForProjectReq) (*response.ListRulesForProjectResp, error)
	// Delete a project rule
	//
	// The resulting change to the project's resources does not take effect immediately.
	// Updates to project rules must be applied to ingested resources by a project update.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:projects:update
	DeleteRule(context.Context, *request.DeleteRuleReq) (*response.DeleteRuleResp, error)
	// Start project update
	//
	// Any changes to a project's rules are staged first. They do not take effect until
	// all projects are updated.
	//
	// Updating all projects begins an operation that applies all pending rule edits
	// and then moves ingested resources into the correct projects according to those latest changes.
	//
	// With a large amount of historical compliance data, rule application can take a considerable amount of time.
	// It’s best to batch up rule changes and apply them all at once.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:rules:apply
	ApplyRulesStart(context.Context, *request.ApplyRulesStartReq) (*response.ApplyRulesStartResp, error)
	// Cancel project update
	//
	// Cancels an ongoing project update.
	//
	// Warning! This action leaves the system in an unknown state that only another
	// successful project update can rectify.
	//
	// This command exists really just for one scenario: you started a project update
	// but shortly thereafter discovered that you had one more change to include in the
	// batch of updates to be done.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:rules:cancel
	ApplyRulesCancel(context.Context, *request.ApplyRulesCancelReq) (*response.ApplyRulesCancelResp, error)
	// Get the status of a project update
	//
	// Returns details about a project update operation.
	//
	// You can poll this endpoint during a project update to monitor progress.
	// Querying this endpoint when there is no update in progress will return details
	// about the completion status of the most recent update.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:rules:status
	ApplyRulesStatus(context.Context, *request.ApplyRulesStatusReq) (*response.ApplyRulesStatusResp, error)
}

RulesServer is the server API for Rules service.

type RulesServerMock

type RulesServerMock struct {
	CreateRuleFunc          func(context.Context, *request.CreateRuleReq) (*response.CreateRuleResp, error)
	UpdateRuleFunc          func(context.Context, *request.UpdateRuleReq) (*response.UpdateRuleResp, error)
	GetRuleFunc             func(context.Context, *request.GetRuleReq) (*response.GetRuleResp, error)
	ListRulesForProjectFunc func(context.Context, *request.ListRulesForProjectReq) (*response.ListRulesForProjectResp, error)
	DeleteRuleFunc          func(context.Context, *request.DeleteRuleReq) (*response.DeleteRuleResp, error)
	ApplyRulesStartFunc     func(context.Context, *request.ApplyRulesStartReq) (*response.ApplyRulesStartResp, error)
	ApplyRulesCancelFunc    func(context.Context, *request.ApplyRulesCancelReq) (*response.ApplyRulesCancelResp, error)
	ApplyRulesStatusFunc    func(context.Context, *request.ApplyRulesStatusReq) (*response.ApplyRulesStatusResp, error)
	// contains filtered or unexported fields
}

RulesServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewRulesServerMock

func NewRulesServerMock() *RulesServerMock

NewRulesServerMock gives you a fresh instance of RulesServerMock.

func NewRulesServerMockWithoutValidation

func NewRulesServerMockWithoutValidation() *RulesServerMock

NewRulesServerMockWithoutValidation gives you a fresh instance of RulesServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*RulesServerMock) ApplyRulesCancel

func (*RulesServerMock) ApplyRulesStart

func (*RulesServerMock) ApplyRulesStatus

func (*RulesServerMock) CreateRule

func (*RulesServerMock) DeleteRule

func (*RulesServerMock) GetRule

func (*RulesServerMock) ListRulesForProject

func (*RulesServerMock) Reset

func (m *RulesServerMock) Reset()

Reset resets all overridden functions

func (*RulesServerMock) UpdateRule

type TeamsClient

type TeamsClient interface {
	// Creates a local team
	//
	// Creates a local team that is used to group local users as members of IAM policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:create
	CreateTeam(ctx context.Context, in *request.CreateTeamReq, opts ...grpc.CallOption) (*response.CreateTeamResp, error)
	// Lists all local teams
	//
	// Lists all local teams.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:list
	ListTeams(ctx context.Context, in *request.ListTeamsReq, opts ...grpc.CallOption) (*response.ListTeamsResp, error)
	// Get a team
	//
	// Returns the details for a team.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:get
	GetTeam(ctx context.Context, in *request.GetTeamReq, opts ...grpc.CallOption) (*response.GetTeamResp, error)
	// Updates a local team
	//
	// Updates a local team.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:update
	UpdateTeam(ctx context.Context, in *request.UpdateTeamReq, opts ...grpc.CallOption) (*response.UpdateTeamResp, error)
	// Deletes a local team
	//
	// Deletes a local team and removes it from any policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:delete
	DeleteTeam(ctx context.Context, in *request.DeleteTeamReq, opts ...grpc.CallOption) (*response.DeleteTeamResp, error)
	// Gets local team membership
	//
	// Lists all users of a local team. Users are listed by their membership_id.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teamUsers:list
	GetTeamMembership(ctx context.Context, in *request.GetTeamMembershipReq, opts ...grpc.CallOption) (*response.GetTeamMembershipResp, error)
	// Adds local team membership
	//
	// Adds a list of users to a local team. Users are added by their membership_id.
	// The request currently does not validate that membership_id maps to a real user.
	//
	// The membership_id for users can be found via GET /apis/apis/iam/v2/users/<user_id>.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teamUsers:create
	AddTeamMembers(ctx context.Context, in *request.AddTeamMembersReq, opts ...grpc.CallOption) (*response.AddTeamMembersResp, error)
	// Removes local team membership
	//
	// Removes a list of users from a local team. Users are removed by their membership_id.
	// The request currently does not validate that membership_id maps to a real user.
	//
	// The membership_id for users can be found via GET /apis/apis/iam/v2/users/<user_id>.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teamUsers:delete
	RemoveTeamMembers(ctx context.Context, in *request.RemoveTeamMembersReq, opts ...grpc.CallOption) (*response.RemoveTeamMembersResp, error)
	// Gets team membership for a user
	//
	// Lists all local teams for a specific user. You must use their membership_id in the request URL.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:userTeams:get
	GetTeamsForMember(ctx context.Context, in *request.GetTeamsForMemberReq, opts ...grpc.CallOption) (*response.GetTeamsForMemberResp, error)
}

TeamsClient is the client API for Teams service.

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

func NewTeamsClient

func NewTeamsClient(cc grpc.ClientConnInterface) TeamsClient

type TeamsServer

type TeamsServer interface {
	// Creates a local team
	//
	// Creates a local team that is used to group local users as members of IAM policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:create
	CreateTeam(context.Context, *request.CreateTeamReq) (*response.CreateTeamResp, error)
	// Lists all local teams
	//
	// Lists all local teams.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:list
	ListTeams(context.Context, *request.ListTeamsReq) (*response.ListTeamsResp, error)
	// Get a team
	//
	// Returns the details for a team.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:get
	GetTeam(context.Context, *request.GetTeamReq) (*response.GetTeamResp, error)
	// Updates a local team
	//
	// Updates a local team.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:update
	UpdateTeam(context.Context, *request.UpdateTeamReq) (*response.UpdateTeamResp, error)
	// Deletes a local team
	//
	// Deletes a local team and removes it from any policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teams:delete
	DeleteTeam(context.Context, *request.DeleteTeamReq) (*response.DeleteTeamResp, error)
	// Gets local team membership
	//
	// Lists all users of a local team. Users are listed by their membership_id.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teamUsers:list
	GetTeamMembership(context.Context, *request.GetTeamMembershipReq) (*response.GetTeamMembershipResp, error)
	// Adds local team membership
	//
	// Adds a list of users to a local team. Users are added by their membership_id.
	// The request currently does not validate that membership_id maps to a real user.
	//
	// The membership_id for users can be found via GET /apis/apis/iam/v2/users/<user_id>.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teamUsers:create
	AddTeamMembers(context.Context, *request.AddTeamMembersReq) (*response.AddTeamMembersResp, error)
	// Removes local team membership
	//
	// Removes a list of users from a local team. Users are removed by their membership_id.
	// The request currently does not validate that membership_id maps to a real user.
	//
	// The membership_id for users can be found via GET /apis/apis/iam/v2/users/<user_id>.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:teamUsers:delete
	RemoveTeamMembers(context.Context, *request.RemoveTeamMembersReq) (*response.RemoveTeamMembersResp, error)
	// Gets team membership for a user
	//
	// Lists all local teams for a specific user. You must use their membership_id in the request URL.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:userTeams:get
	GetTeamsForMember(context.Context, *request.GetTeamsForMemberReq) (*response.GetTeamsForMemberResp, error)
}

TeamsServer is the server API for Teams service.

type TeamsServerMock

type TeamsServerMock struct {
	CreateTeamFunc        func(context.Context, *request.CreateTeamReq) (*response.CreateTeamResp, error)
	ListTeamsFunc         func(context.Context, *request.ListTeamsReq) (*response.ListTeamsResp, error)
	GetTeamFunc           func(context.Context, *request.GetTeamReq) (*response.GetTeamResp, error)
	UpdateTeamFunc        func(context.Context, *request.UpdateTeamReq) (*response.UpdateTeamResp, error)
	DeleteTeamFunc        func(context.Context, *request.DeleteTeamReq) (*response.DeleteTeamResp, error)
	GetTeamMembershipFunc func(context.Context, *request.GetTeamMembershipReq) (*response.GetTeamMembershipResp, error)
	AddTeamMembersFunc    func(context.Context, *request.AddTeamMembersReq) (*response.AddTeamMembersResp, error)
	RemoveTeamMembersFunc func(context.Context, *request.RemoveTeamMembersReq) (*response.RemoveTeamMembersResp, error)
	GetTeamsForMemberFunc func(context.Context, *request.GetTeamsForMemberReq) (*response.GetTeamsForMemberResp, error)
	// contains filtered or unexported fields
}

TeamsServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewTeamsServerMock

func NewTeamsServerMock() *TeamsServerMock

NewTeamsServerMock gives you a fresh instance of TeamsServerMock.

func NewTeamsServerMockWithoutValidation

func NewTeamsServerMockWithoutValidation() *TeamsServerMock

NewTeamsServerMockWithoutValidation gives you a fresh instance of TeamsServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*TeamsServerMock) AddTeamMembers

func (*TeamsServerMock) CreateTeam

func (*TeamsServerMock) DeleteTeam

func (*TeamsServerMock) GetTeam

func (*TeamsServerMock) GetTeamMembership

func (*TeamsServerMock) GetTeamsForMember

func (*TeamsServerMock) ListTeams

func (*TeamsServerMock) RemoveTeamMembers

func (*TeamsServerMock) Reset

func (m *TeamsServerMock) Reset()

Reset resets all overridden functions

func (*TeamsServerMock) UpdateTeam

type TokensClient

type TokensClient interface {
	// Creates a token
	//
	// Creates a token.
	// Active defaults to true when not specified.
	// Value is auto-generated when not specified.
	//
	// Note that this creates *non-admin* tokens that may then be assigned permissions via policies just like users or teams (unless you have already created policies that encompass all tokens using `tokens:*“).
	//
	// You cannot create admin tokens via the REST API.
	// Admin tokens can only be created by specifying the `--admin` flag to this chef-automate sub-command:
	// “`
	// chef-automate iam token create <your-token-name> --admin`
	// “`
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:create
	CreateToken(ctx context.Context, in *request.CreateTokenReq, opts ...grpc.CallOption) (*response.CreateTokenResp, error)
	// Gets a token
	//
	// Returns the details for a token.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:get
	GetToken(ctx context.Context, in *request.GetTokenReq, opts ...grpc.CallOption) (*response.GetTokenResp, error)
	// Updates a token
	//
	// This operation overwrites all fields excepting ID, timestamps, and value,
	// including those omitted from the request, so be sure to specify all properties.
	// Properties that you do not include are reset to empty values.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:update
	UpdateToken(ctx context.Context, in *request.UpdateTokenReq, opts ...grpc.CallOption) (*response.UpdateTokenResp, error)
	// Deletes a token
	//
	// Deletes a token and remove it from any policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:delete
	DeleteToken(ctx context.Context, in *request.DeleteTokenReq, opts ...grpc.CallOption) (*response.DeleteTokenResp, error)
	// Lists all tokens
	//
	// Lists all tokens, both admin and non-admin.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:list
	ListTokens(ctx context.Context, in *request.ListTokensReq, opts ...grpc.CallOption) (*response.ListTokensResp, error)
}

TokensClient is the client API for Tokens service.

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

func NewTokensClient

func NewTokensClient(cc grpc.ClientConnInterface) TokensClient

type TokensServer

type TokensServer interface {
	// Creates a token
	//
	// Creates a token.
	// Active defaults to true when not specified.
	// Value is auto-generated when not specified.
	//
	// Note that this creates *non-admin* tokens that may then be assigned permissions via policies just like users or teams (unless you have already created policies that encompass all tokens using `tokens:*“).
	//
	// You cannot create admin tokens via the REST API.
	// Admin tokens can only be created by specifying the `--admin` flag to this chef-automate sub-command:
	// “`
	// chef-automate iam token create <your-token-name> --admin`
	// “`
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:create
	CreateToken(context.Context, *request.CreateTokenReq) (*response.CreateTokenResp, error)
	// Gets a token
	//
	// Returns the details for a token.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:get
	GetToken(context.Context, *request.GetTokenReq) (*response.GetTokenResp, error)
	// Updates a token
	//
	// This operation overwrites all fields excepting ID, timestamps, and value,
	// including those omitted from the request, so be sure to specify all properties.
	// Properties that you do not include are reset to empty values.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:update
	UpdateToken(context.Context, *request.UpdateTokenReq) (*response.UpdateTokenResp, error)
	// Deletes a token
	//
	// Deletes a token and remove it from any policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:delete
	DeleteToken(context.Context, *request.DeleteTokenReq) (*response.DeleteTokenResp, error)
	// Lists all tokens
	//
	// Lists all tokens, both admin and non-admin.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:tokens:list
	ListTokens(context.Context, *request.ListTokensReq) (*response.ListTokensResp, error)
}

TokensServer is the server API for Tokens service.

type TokensServerMock

type TokensServerMock struct {
	CreateTokenFunc func(context.Context, *request.CreateTokenReq) (*response.CreateTokenResp, error)
	GetTokenFunc    func(context.Context, *request.GetTokenReq) (*response.GetTokenResp, error)
	UpdateTokenFunc func(context.Context, *request.UpdateTokenReq) (*response.UpdateTokenResp, error)
	DeleteTokenFunc func(context.Context, *request.DeleteTokenReq) (*response.DeleteTokenResp, error)
	ListTokensFunc  func(context.Context, *request.ListTokensReq) (*response.ListTokensResp, error)
	// contains filtered or unexported fields
}

TokensServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewTokensServerMock

func NewTokensServerMock() *TokensServerMock

NewTokensServerMock gives you a fresh instance of TokensServerMock.

func NewTokensServerMockWithoutValidation

func NewTokensServerMockWithoutValidation() *TokensServerMock

NewTokensServerMockWithoutValidation gives you a fresh instance of TokensServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*TokensServerMock) CreateToken

func (*TokensServerMock) DeleteToken

func (*TokensServerMock) GetToken

func (*TokensServerMock) ListTokens

func (*TokensServerMock) Reset

func (m *TokensServerMock) Reset()

Reset resets all overridden functions

func (*TokensServerMock) UpdateToken

type UnimplementedAuthorizationServer

type UnimplementedAuthorizationServer struct {
}

UnimplementedAuthorizationServer can be embedded to have forward compatible implementations.

func (*UnimplementedAuthorizationServer) Introspect

func (*UnimplementedAuthorizationServer) IntrospectAll

func (*UnimplementedAuthorizationServer) IntrospectSome

type UnimplementedPoliciesServer

type UnimplementedPoliciesServer struct {
}

UnimplementedPoliciesServer can be embedded to have forward compatible implementations.

func (*UnimplementedPoliciesServer) AddPolicyMembers

func (*UnimplementedPoliciesServer) CreatePolicy

func (*UnimplementedPoliciesServer) CreateProject

func (*UnimplementedPoliciesServer) CreateRole

func (*UnimplementedPoliciesServer) DeletePolicy

func (*UnimplementedPoliciesServer) DeleteProject

func (*UnimplementedPoliciesServer) DeleteRole

func (*UnimplementedPoliciesServer) GetPolicy

func (*UnimplementedPoliciesServer) GetPolicyVersion

func (*UnimplementedPoliciesServer) GetProject

func (*UnimplementedPoliciesServer) GetRole

func (*UnimplementedPoliciesServer) IntrospectAllProjects

func (*UnimplementedPoliciesServer) ListPolicies

func (*UnimplementedPoliciesServer) ListProjects

func (*UnimplementedPoliciesServer) ListRoles

func (*UnimplementedPoliciesServer) UpdatePolicy

func (*UnimplementedPoliciesServer) UpdateProject

func (*UnimplementedPoliciesServer) UpdateRole

type UnimplementedRulesServer

type UnimplementedRulesServer struct {
}

UnimplementedRulesServer can be embedded to have forward compatible implementations.

func (*UnimplementedRulesServer) ApplyRulesStart

func (*UnimplementedRulesServer) CreateRule

func (*UnimplementedRulesServer) DeleteRule

func (*UnimplementedRulesServer) GetRule

func (*UnimplementedRulesServer) UpdateRule

type UnimplementedTeamsServer

type UnimplementedTeamsServer struct {
}

UnimplementedTeamsServer can be embedded to have forward compatible implementations.

func (*UnimplementedTeamsServer) AddTeamMembers

func (*UnimplementedTeamsServer) CreateTeam

func (*UnimplementedTeamsServer) DeleteTeam

func (*UnimplementedTeamsServer) GetTeam

func (*UnimplementedTeamsServer) ListTeams

func (*UnimplementedTeamsServer) UpdateTeam

type UnimplementedTokensServer

type UnimplementedTokensServer struct {
}

UnimplementedTokensServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokensServer) CreateToken

func (*UnimplementedTokensServer) DeleteToken

func (*UnimplementedTokensServer) GetToken

func (*UnimplementedTokensServer) ListTokens

func (*UnimplementedTokensServer) UpdateToken

type UnimplementedUsersServer

type UnimplementedUsersServer struct {
}

UnimplementedUsersServer can be embedded to have forward compatible implementations.

func (*UnimplementedUsersServer) CreateUser

func (*UnimplementedUsersServer) DeleteUser

func (*UnimplementedUsersServer) GetUser

func (*UnimplementedUsersServer) ListUsers

func (*UnimplementedUsersServer) UpdateSelf

func (*UnimplementedUsersServer) UpdateUser

type UsersClient

type UsersClient interface {
	// Create a user
	//
	// Creates a local user that can sign in to Automate and be a member of IAM teams
	// and IAM policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:create
	CreateUser(ctx context.Context, in *request.CreateUserReq, opts ...grpc.CallOption) (*response.CreateUserResp, error)
	// List all users
	//
	// Lists all local users.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:list
	ListUsers(ctx context.Context, in *request.ListUsersReq, opts ...grpc.CallOption) (*response.ListUsersResp, error)
	// Get a user
	//
	// Returns the details for a local user.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:get
	GetUser(ctx context.Context, in *request.GetUserReq, opts ...grpc.CallOption) (*response.GetUserResp, error)
	// Delete a user
	//
	// Deletes a local user.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:delete
	DeleteUser(ctx context.Context, in *request.DeleteUserReq, opts ...grpc.CallOption) (*response.DeleteUserResp, error)
	// Update a user
	//
	// Updates a local user's name or password.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:update
	UpdateUser(ctx context.Context, in *request.UpdateUserReq, opts ...grpc.CallOption) (*response.UpdateUserResp, error)
	// Update self (as user)
	//
	// Updates a local user's own name or password.
	// If changing the password, both "password" and "previous_password" are required.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:usersSelf:update
	UpdateSelf(ctx context.Context, in *request.UpdateSelfReq, opts ...grpc.CallOption) (*response.UpdateSelfResp, error)
}

UsersClient is the client API for Users service.

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

func NewUsersClient

func NewUsersClient(cc grpc.ClientConnInterface) UsersClient

type UsersServer

type UsersServer interface {
	// Create a user
	//
	// Creates a local user that can sign in to Automate and be a member of IAM teams
	// and IAM policies.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:create
	CreateUser(context.Context, *request.CreateUserReq) (*response.CreateUserResp, error)
	// List all users
	//
	// Lists all local users.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:list
	ListUsers(context.Context, *request.ListUsersReq) (*response.ListUsersResp, error)
	// Get a user
	//
	// Returns the details for a local user.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:get
	GetUser(context.Context, *request.GetUserReq) (*response.GetUserResp, error)
	// Delete a user
	//
	// Deletes a local user.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:delete
	DeleteUser(context.Context, *request.DeleteUserReq) (*response.DeleteUserResp, error)
	// Update a user
	//
	// Updates a local user's name or password.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:users:update
	UpdateUser(context.Context, *request.UpdateUserReq) (*response.UpdateUserResp, error)
	// Update self (as user)
	//
	// Updates a local user's own name or password.
	// If changing the password, both "password" and "previous_password" are required.
	//
	// Authorization Action:
	// “`
	// “`
	//
	//iam:usersSelf:update
	UpdateSelf(context.Context, *request.UpdateSelfReq) (*response.UpdateSelfResp, error)
}

UsersServer is the server API for Users service.

type UsersServerMock

type UsersServerMock struct {
	CreateUserFunc func(context.Context, *request.CreateUserReq) (*response.CreateUserResp, error)
	ListUsersFunc  func(context.Context, *request.ListUsersReq) (*response.ListUsersResp, error)
	GetUserFunc    func(context.Context, *request.GetUserReq) (*response.GetUserResp, error)
	DeleteUserFunc func(context.Context, *request.DeleteUserReq) (*response.DeleteUserResp, error)
	UpdateUserFunc func(context.Context, *request.UpdateUserReq) (*response.UpdateUserResp, error)
	UpdateSelfFunc func(context.Context, *request.UpdateSelfReq) (*response.UpdateSelfResp, error)
	// contains filtered or unexported fields
}

UsersServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewUsersServerMock

func NewUsersServerMock() *UsersServerMock

NewUsersServerMock gives you a fresh instance of UsersServerMock.

func NewUsersServerMockWithoutValidation

func NewUsersServerMockWithoutValidation() *UsersServerMock

NewUsersServerMockWithoutValidation gives you a fresh instance of UsersServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*UsersServerMock) CreateUser

func (*UsersServerMock) DeleteUser

func (*UsersServerMock) GetUser

func (*UsersServerMock) ListUsers

func (*UsersServerMock) Reset

func (m *UsersServerMock) Reset()

Reset resets all overridden functions

func (*UsersServerMock) UpdateSelf

func (*UsersServerMock) UpdateUser

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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