CCF
Loading...
Searching...
No Matches
empty_auth.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
6
7namespace ccf
8{
9 // To make authentication _optional_, no-auth can be listed as one of several
10 // specified policies
12 {};
13
15 {
16 public:
17 static constexpr auto SECURITY_SCHEME_NAME = "no_auth";
18
19 std::unique_ptr<AuthnIdentity> authenticate(
20 [[maybe_unused]] ccf::kv::ReadOnlyTx& tx,
21 [[maybe_unused]] const std::shared_ptr<ccf::RpcContext>& ctx,
22 [[maybe_unused]] std::string& error_reason) override;
23
25 [[maybe_unused]] std::shared_ptr<ccf::RpcContext> ctx,
26 [[maybe_unused]] std::string&& error_reason) override;
27
28 [[nodiscard]] std::optional<OpenAPISecuritySchema>
30 {
31 return unauthenticated_schema;
32 }
33
34 std::string get_security_scheme_name() override
35 {
37 }
38 };
39}
Definition authentication_types.h:28
Definition empty_auth.h:15
std::unique_ptr< AuthnIdentity > authenticate(ccf::kv::ReadOnlyTx &tx, const std::shared_ptr< ccf::RpcContext > &ctx, std::string &error_reason) override
Definition empty_auth.cpp:8
std::optional< OpenAPISecuritySchema > get_openapi_security_schema() const override
Definition empty_auth.h:29
static constexpr auto SECURITY_SCHEME_NAME
Definition empty_auth.h:17
std::string get_security_scheme_name() override
Definition empty_auth.h:34
void set_unauthenticated_error(std::shared_ptr< ccf::RpcContext > ctx, std::string &&error_reason) override
Definition empty_auth.cpp:19
Definition tx.h:159
Definition app_interface.h:14
Definition authentication_types.h:19
Definition empty_auth.h:12