GRPC C++  1.62.0
Public Types | Public Member Functions
grpc::AuthMetadataProcessor Class Referenceabstract

Interface allowing custom server-side authorization based on credentials encoded in metadata. More...

#include <auth_metadata_processor.h>

Public Types

typedef std::multimap< grpc::string_ref, grpc::string_refInputMetadata
 
typedef std::multimap< std::string, std::string > OutputMetadata
 

Public Member Functions

virtual ~AuthMetadataProcessor ()
 
virtual bool IsBlocking () const
 If this method returns true, the Process function will be scheduled in a different thread from the one processing the call. More...
 
virtual grpc::Status Process (const InputMetadata &auth_metadata, grpc::AuthContext *context, OutputMetadata *consumed_auth_metadata, OutputMetadata *response_metadata)=0
 Processes a Call associated with a connection. More...
 

Detailed Description

Interface allowing custom server-side authorization based on credentials encoded in metadata.

Objects of this type can be passed to ServerCredentials::SetAuthMetadataProcessor(). Please also check out grpc::experimental::Interceptor for another way to do customized operations on the information provided by a specific call.

Member Typedef Documentation

◆ InputMetadata

◆ OutputMetadata

typedef std::multimap<std::string, std::string> grpc::AuthMetadataProcessor::OutputMetadata

Constructor & Destructor Documentation

◆ ~AuthMetadataProcessor()

virtual grpc::AuthMetadataProcessor::~AuthMetadataProcessor ( )
inlinevirtual

Member Function Documentation

◆ IsBlocking()

virtual bool grpc::AuthMetadataProcessor::IsBlocking ( ) const
inlinevirtual

If this method returns true, the Process function will be scheduled in a different thread from the one processing the call.

◆ Process()

virtual grpc::Status grpc::AuthMetadataProcessor::Process ( const InputMetadata auth_metadata,
grpc::AuthContext context,
OutputMetadata consumed_auth_metadata,
OutputMetadata response_metadata 
)
pure virtual

Processes a Call associated with a connection.

auth_metadata: the authentication metadata associated with the particular call context: contains the connection-level info, e.g. the peer identity. This parameter is readable and writable. Note that since the information is shared for all calls associated with the connection, if the implementation updates the info in a specific call, all the subsequent calls will see the updates. A typical usage of context is to use |auth_metadata| to infer the peer identity, and augment it with properties. consumed_auth_metadata: contains the metadata that the implementation wants to remove from the current call, so that the server application is no longer able to see it anymore. A typical usage would be to do token authentication in the first call, and then remove the token information for all subsequent calls. response_metadata(CURRENTLY NOT SUPPORTED): the metadata that will be sent as part of the response. return: if the return value is not Status::OK, the rpc call will be aborted with the error code and error message sent back to the client.


The documentation for this class was generated from the following file: