1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
7 #include "rgw_oidc_provider.h"
9 class RGWRestOIDCProvider
: public RGWRESTOp
{
11 std::vector
<std::string
> client_ids
;
12 std::vector
<std::string
> thumbprints
;
13 std::string provider_url
; //'iss' field in JWT
14 std::string provider_arn
;
16 int verify_permission(optional_yield y
) override
;
17 void send_response() override
;
18 virtual uint64_t get_op() = 0;
21 class RGWRestOIDCProviderRead
: public RGWRestOIDCProvider
{
23 RGWRestOIDCProviderRead() = default;
24 int check_caps(const RGWUserCaps
& caps
) override
;
27 class RGWRestOIDCProviderWrite
: public RGWRestOIDCProvider
{
29 RGWRestOIDCProviderWrite() = default;
30 int check_caps(const RGWUserCaps
& caps
) override
;
33 class RGWCreateOIDCProvider
: public RGWRestOIDCProviderWrite
{
35 RGWCreateOIDCProvider() = default;
36 int verify_permission(optional_yield y
) override
;
37 void execute(optional_yield y
) override
;
39 const char* name() const override
{ return "create_oidc_provider"; }
40 RGWOpType
get_type() override
{ return RGW_OP_CREATE_OIDC_PROVIDER
; }
41 uint64_t get_op() override
{ return rgw::IAM::iamCreateOIDCProvider
; }
44 class RGWDeleteOIDCProvider
: public RGWRestOIDCProviderWrite
{
46 RGWDeleteOIDCProvider() = default;
47 void execute(optional_yield y
) override
;
48 const char* name() const override
{ return "delete_oidc_provider"; }
49 RGWOpType
get_type() override
{ return RGW_OP_DELETE_OIDC_PROVIDER
; }
50 uint64_t get_op() override
{ return rgw::IAM::iamDeleteOIDCProvider
; }
53 class RGWGetOIDCProvider
: public RGWRestOIDCProviderRead
{
55 RGWGetOIDCProvider() = default;
56 void execute(optional_yield y
) override
;
57 const char* name() const override
{ return "get_oidc_provider"; }
58 RGWOpType
get_type() override
{ return RGW_OP_GET_OIDC_PROVIDER
; }
59 uint64_t get_op() override
{ return rgw::IAM::iamGetOIDCProvider
; }
62 class RGWListOIDCProviders
: public RGWRestOIDCProviderRead
{
64 RGWListOIDCProviders() = default;
65 int verify_permission(optional_yield y
) override
;
66 void execute(optional_yield y
) override
;
68 const char* name() const override
{ return "list_oidc_providers"; }
69 RGWOpType
get_type() override
{ return RGW_OP_LIST_OIDC_PROVIDERS
; }
70 uint64_t get_op() override
{ return rgw::IAM::iamListOIDCProviders
; }