mi::rswservices::IAuthorization_context Class Reference
[Request Authorization]
Description
Context class used by authorization modules to authorize HTTP requests. This class is passed to authorization modules to allow access to the connection information. A module uses the information provided by this context to decide whether to authorize an http request or not.
See also:
Public Member Functions
- virtual bool check_error() =0
- Checks whether an error occurred on the connection. More...
- virtual const char* get_attachment( const char* key) const =0
- Gets a string attachment from the context. More...
- virtual const char* get_peer_address() =0
- Gets the address of the peer of the connection as a string.
- virtual http::IRequest* get_request() =0
- Gets the request of the connection. More...
- virtual http::IResponse* get_response() =0
- Gets the response associated with the connection. More...
- virtual void remove_attachment( const char* key) =0
- Removes a string attachment from the context. More...
- virtual void set_attachment( const char* key, const char* value) =0
- Attaches a string attachment to the context. More...
- virtual bool set_failure_body( const Uint8* content, const Uint32 size) =0
- sets the body to be returned to the client on authentication failure. More...
Member Functions
- virtual bool mi::rswservices::IAuthorization_context::check_error() [pure virtual]
-
Checks whether an error occurred on the connection.
Returns
true , if there was an error, false otherwise
- virtual const char* mi::rswservices::IAuthorization_context::get_attachment( const char* key) const [pure virtual]
-
Gets a string attachment from the context.
Parameters
- key
- The key of the attachment
Returns
The value of the attachment or NULL if there is no such attachment
- virtual const char* mi::rswservices::IAuthorization_context::get_peer_address() [pure virtual]
-
Gets the address of the peer of the connection as a string.
- virtual http::IRequest* mi::rswservices::IAuthorization_context::get_request() [pure virtual]
-
Gets the request of the connection.
Returns
The associated request
- virtual http::IResponse* mi::rswservices::IAuthorization_context::get_response() [pure virtual]
-
Gets the response associated with the connection.
Returns
The associated response
- virtual void mi::rswservices::IAuthorization_context::remove_attachment( const char* key) [pure virtual]
-
Removes a string attachment from the context.
Parameters
- key
- The key of the attachment
- virtual void mi::rswservices::IAuthorization_context::set_attachment( const char* key, const char* value) [pure virtual]
-
Attaches a string attachment to the context. This attachment will be made available to all subsequent process triggered by this connection
Parameters
- key
- Key of the attachment
- value
- Value of the attachment
- virtual bool mi::rswservices::IAuthorization_context::set_failure_body( const Uint8* content, const Uint32 size) [pure virtual]
-
sets the body to be returned to the client on authentication failure. if authentication succeeds this body is ignored.
Parameters
- content
- The content to be returned
- size
- The size in bytes of content
Returns
true on success