google.cloud.forseti.services.explain.service module

Explain gRPC service.

class GrpcExplainer(explainer_api)[source]

Bases: google.cloud.forseti.services.explain.explain_pb2_grpc.ExplainServicer

Explain gRPC implementation.

CheckIamPolicy(request, context)[source]

Checks access according to policy to a specified resource.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of whether access granted

Return type:

object

ExplainDenied(request, context)[source]

Provides information on how to grant access.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of explain denied result

Return type:

object

ExplainGranted(request, context)[source]

Provides information on why a member has access to a resource.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of explain granted result

Return type:

object

GetAccessByMembers(request, context)[source]

Returns resources which can be accessed by the specified members.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of access tuples by members

Return type:

object

GetAccessByPermissions()

Wrapper function, checks context state to close stream.

Parameters:*args (list) – All arguments provided to the wrapped function.
Yields:object – Whatever the wrapped function yields to the stream.
GetAccessByResources(request, context)[source]

Returns members having access to the specified resource.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of access tuples by resource

Return type:

object

GetIamPolicy(request, context)[source]

Gets the policy for a resource.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of IAM policy

Return type:

object

GetPermissionsByRoles(request, context)[source]

Returns permissions for the specified roles.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of access tuples by permission

Return type:

object

HANDLE_KEY = 'handle'
ListGroupMembers(request, context)[source]

Lists members in the model.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of list of members

Return type:

object

ListResources(request, context)[source]

Lists resources in the model.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of list of resources

Return type:

object

ListRoles(request, context)[source]

List roles from the model.

Parameters:
  • request (object) – gRPC request.
  • context (object) – gRPC context.
Returns:

proto message of list of roles

Return type:

object

Ping(request, _)[source]

Provides the capability to check for service availability.

Parameters:
  • request (object) – gRPC request.
  • _ (object) – Not used
Returns:

proto message of ping

Return type:

object

_get_handle(context)[source]

Return the handle associated with the gRPC call.

Parameters:context (object) – gRPC context
Returns:handle of the GRPC call
Return type:str
class GrpcExplainerFactory(config)[source]

Bases: object

Factory class for Explain service gRPC interface

create_and_register_service(server)[source]

Create and register the Explain service.

Parameters:server (object) – Server to register service to.
Returns:The instantiated gRPC service for Explainer.
Return type:object