A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
authorization.cc File Reference
#include "a11/actions/authorization.h"
#include <algorithm>
#include <cctype>
#include <cstdint>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <absl/container/flat_hash_map.h>
#include <absl/log/check.h>
#include <absl/status/status.h>
#include <absl/status/status_macros.h>
#include <absl/status/statusor.h>
#include <absl/strings/escaping.h>
#include <absl/strings/str_cat.h>
#include <absl/time/clock.h>
#include <absl/time/time.h>
#include <nlohmann/json.hpp>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include "a11/actions/action.h"
#include "a11/actions/registry.h"
#include "a11/actions/schema.h"
#include "a11/data/msgpack.h"
#include "a11/data/serialization.h"
#include "a11/json_codec.h"
#include "a11/net/wire_stream.h"
#include "a11/nodes/async_node.h"
#include "a11/service/session.h"
#include "thread/boost_primitives.h"

Classes

struct  a11::actions::AuthorizationContextStore::State
 
struct  a11::actions::AuthorizationContextStore::State::Held
 
struct  a11::actions::AuthorizationContextStore::State::Stream
 
struct  a11::actions::AuthorizationContextStore::State::Session
 

Namespaces

namespace  a11
 
namespace  a11::actions
 

Functions

absl::StatusOr< std::string > a11::actions::EncodeAuthorization (const AuthorizationEnvelope &envelope)
 Validate and canonically encode an authorization envelope as MessagePack.
 
absl::StatusOr< AuthorizationEnvelope > a11::actions::DecodeAuthorization (std::string_view value)
 Decode a canonical, bounded native authorization value.
 
absl::StatusOr< std::string > a11::actions::AuthorizationToText (const AuthorizationEnvelope &envelope)
 Convert a native value to an ASCII physical HTTP header.
 
absl::StatusOr< std::string > a11::actions::AuthorizationFingerprint (const AuthorizationEnvelope &envelope)
 Return an unpadded base64url SHA-256 identifier for the exact envelope.
 
absl::StatusOr< AuthorizationEnvelope > a11::actions::AuthorizationFromText (std::string_view value)
 Convert an ASCII physical HTTP header to the native envelope.
 
absl::StatusOr< std::optional< AuthorizationEnvelope > > a11::actions::GetAuthorization (const Action &action)
 Decode the complete authorization on an action, when present.
 
absl::Status a11::actions::SetAuthorization (const std::shared_ptr< Action > &action, const std::optional< AuthorizationEnvelope > &envelope)
 Set or remove a complete authorization and clear any context reference.
 
absl::StatusOr< std::optional< std::string > > a11::actions::GetAuthorizationReference (const Action &action)
 Read the receiver-issued raw 128-bit context reference, when present.
 
absl::Status a11::actions::SetAuthorizationReference (const std::shared_ptr< Action > &action, const std::optional< std::string > &context_id)
 Set or remove a raw 128-bit context reference and clear any full proof.
 
ActionSchema a11::actions::AuthorizationActionSchema ()
 Schema of the transport-independent connection authorizing action.
 
absl::StatusOr< std::shared_ptr< AuthorizationContextStore > > a11::actions::InstallAuthorizer (const std::shared_ptr< ActionRegistry > &registry, AuthorizationVerifier verifier, std::shared_ptr< AuthorizationContextStore > contexts=nullptr)
 Register __authorize__ for a native verifier and context store.
 

Variable Documentation

◆ session

std::shared_ptr<service::Session> session

◆ session_id

std::string session_id

◆ stream_id

std::string stream_id