From 463c5603bd3e836fd504b9be212ee1e0e640948e Mon Sep 17 00:00:00 2001 From: Pritha Srivastava Date: Mon, 31 Dec 2018 11:42:49 +0530 Subject: [PATCH] rgw: Initial commit for AssumeRoleWithWebIdentity. Signed-off-by: Pritha Srivastava --- src/common/legacy_config_opts.h | 3 + src/common/options.cc | 15 +++ src/rgw/rgw_auth.cc | 48 +++++++ src/rgw/rgw_auth.h | 62 +++++++++ src/rgw/rgw_auth_registry.h | 10 +- src/rgw/rgw_auth_s3.cc | 1 + src/rgw/rgw_auth_s3.h | 2 +- src/rgw/rgw_basic_types.h | 18 ++- src/rgw/rgw_common.cc | 1 + src/rgw/rgw_common.h | 5 +- src/rgw/rgw_iam_policy.cc | 47 ++++++- src/rgw/rgw_iam_policy.h | 11 +- src/rgw/rgw_op.cc | 24 ++-- src/rgw/rgw_op.h | 4 +- src/rgw/rgw_rest.cc | 2 +- src/rgw/rgw_rest_s3.cc | 8 ++ src/rgw/rgw_rest_s3.h | 6 +- src/rgw/rgw_rest_sts.cc | 194 ++++++++++++++++++++++++++-- src/rgw/rgw_rest_sts.h | 120 ++++++++++++++++- src/rgw/rgw_sts.cc | 166 +++++++++++++++++------- src/rgw/rgw_sts.h | 94 +++++++++++--- src/rgw/rgw_web_idp.h | 29 +++++ src/test/rgw/test_rgw_iam_policy.cc | 34 ++--- 23 files changed, 778 insertions(+), 126 deletions(-) create mode 100644 src/rgw/rgw_web_idp.h diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index a8fd2ac4eaf4..e16fc0a23c33 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1548,3 +1548,6 @@ OPTION(rgw_sts_key, OPT_STR) OPTION(rgw_s3_auth_use_sts, OPT_BOOL) // should we try to use sts for s3? OPTION(rgw_sts_max_session_duration, OPT_U64) // Max duration in seconds for which the session token is valid. OPTION(fake_statfs_for_testing, OPT_INT) // Set a value for kb and compute kb_used from total of num_bytes +OPTION(rgw_sts_token_introspection_url, OPT_STR) // url for introspecting web tokens +OPTION(rgw_sts_client_id, OPT_STR) // Client Id +OPTION(rgw_sts_client_secret, OPT_STR) // Client Secret diff --git a/src/common/options.cc b/src/common/options.cc index 71bb8ff1c6b7..7f16aa5dbae0 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -6692,6 +6692,21 @@ std::vector