| Guard | R Documentation |
All guards inherit from this base class and adapts it for the particular scheme it implements. Additional schemes can be implemented as subclasses of this and will work transparently with fireproof.
is_guard(x)
x |
An object |
nameThe name of the instance
open_apiAn OpenID compliant security scheme description
new()Constructor for the class
Guard$new(name = NULL)
nameThe name of the scheme instance
check_request()A function that validates an incoming request, returning
TRUE if it is valid and FALSE if not. The base class simply returns
TRUE for all requests
Guard$check_request(request, response, keys, ..., .datastore)
requestThe request to validate as a Request object
responseThe corresponding response to the request as a Response object
keysA named list of path parameters from the path matching
...Ignored
.datastoreThe data storage from firesale
reject_response()Action to perform on the response in case the request fails to get validated by any instance in the flow. All failing instances will have this method called one by one so be mindful if you are overwriting information set by another instance
Guard$reject_response(response, scope, ..., .datastore)
responseThe response object
scopeThe scope of the endpoint
...Ignored
.datastoreThe data storage from firesale
forbid_user()Action to perform on the response in case the request does not have the necessary permissions for the endpoint. All succeeding instances will have this method called one by one if permissions are insufficient so be mindful if you are overwriting information set by another instance
Guard$forbid_user(response, scope, ..., .datastore)
responseThe response object
scopeThe scope of the endpoint
...Ignored
.datastoreThe data storage from firesale
register_handler()Hook for registering endpoint handlers needed for this auth method
Guard$register_handler(add_handler)
add_handlerThe add_handler method from Fireproof to be called
for adding additional handlers
clone()The objects of this class are cloneable with this method.
Guard$clone(deep = FALSE)
deepWhether to make a deep clone.
# You'd never actually do this, rather you'd use the subclasses
guard <- Guard$new(name = "base_auth")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.