ark::rest

Enums

  • WhereOperation (int32_t)
    Defines the type of operation for the where statement.

Classes

  • ark::rest::RestService
    This is a generic rest service. It instantiates an HTTP server, and you can add handlers to it (either serializable strong types, or just consuming generic HTTP responses).

    It is generally a pass-through for the HTTP server, but it does provide some additional support around metrics & serialization.

  • ark::rest::Authorization
    A structure that is used to handle reporting basic authorization information to REST callbacks.

  • ark::rest::BearerToken
    A structure that is used to handle reporting bearer token information back to REST callbacks.

  • ark::rest::RestServiceConfiguration
    This is configuration for the REST service. It allows you to specify the address it listens on, along with configuration for things like token validation.

Functions

Declared in “ark/rest/authorization.hh”:

  • Authorization retrieve_authorization(const aws::IdentityProviderClientPtr & provider, const aws::JwksClientPtr & jwks_client, const comms::HttpRequest & request)
    Takes in the given HTTP request and returns an authorization block, indicating if the user is authorized or not. The authorization block will both be checked for existence and for validity against the provided jwks_client.

Declared in “ark/rest/bearer_token.hh”:

  • BearerToken retrieve_bearer_token(const comms::HttpRequest & request)
    Extracts the bearer token from the given HTTP request, returning it. No validity or parsing checks are done.

Declared in “ark/rest/response.hh”:

  • comms::HttpResponse write_success_response(std::string payload, std::string content_type)
    Fills in and returns an appropriate HTTP response with the given string payload. Sets the appropriate headers based on the content type that is provided.

  • comms::HttpResponse write_success_response(const Type & type)
    Automatically serializes the given type as JSON and writes out a HTTP response appropriate for sending to a client.

Declared in “ark/rest/testing/helpers.hh”:

  • std::string form_jwks_from_jwts(const std::initializer_list< crypt::JwtPair > & jwts)
    Forms a JWKS JSON file from a single JWT token. This file allows you to validate the JWT that you passed in.

Declared in “ark/rest/where_clause.hh”:

  • void append_where(std::stringstream & where_statement, const char * where_prefix, const std::string & format, Args… args)
    Appends a WHERE clause onto the given stringstream, prefixing it with the necessary logic.

  • void append_where(std::stringstream & where_statement, const char * where_prefix, WhereOperation operation, const std::string & format, Args… args)
    Appends a WHERE clause onto the given stringstream, prefixing it with the necessary logic.