Skip to content

Commit cd16275

Browse files
author
Shraddha Agrawal
committed
Merge branch 'main' into add-email-contact
2 parents 1e08846 + 03a688f commit cd16275

File tree

13 files changed

+298
-24
lines changed

13 files changed

+298
-24
lines changed

doc/radosgw/account.rst

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ An existing user can be adopted into an account with ``user modify``::
177177
.. warning:: Ownership of the user's notification topics will not be
178178
transferred to the account. Notifications will continue to work, but
179179
the topics will no longer be visible to SNS Topic APIs. Topics and
180-
their associated bucket notifications should be removed before migration
181-
and recreated within the account.
180+
their associated bucket notifications can be migrated as described below
181+
in `Migrating Notification Topics`_.
182182

183183
Because account users have no permissions by default, some identity policy must
184184
be added to restore the user's original permissions.
@@ -187,6 +187,44 @@ Alternatively, you may want to create a new account for each existing user. In
187187
that case, you may want to add the ``--account-root`` option to make each user
188188
the root user of their account.
189189

190+
Migrating Notification Topics
191+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
192+
193+
Account topics are supported only when the ``notification_v2`` feature is enabled,
194+
as described in `Bucket Notifications`_ and `Supported Zone Features`_.
195+
196+
1. ``Migration Impact``: When a non-account user is migrated to an account, the
197+
the existing notification topics remain accessible through the RadosGW admin API,
198+
but the user loses access to them via the SNS Topic API. Despite this, the topics
199+
remain functional, and bucket notifications will continue to be delivered as expected.
200+
201+
2. ``Re-creation of Topics``: The account user should re-create the topics using
202+
the same names. The old topics (now inaccessible) and the new account-owned topics
203+
will coexist without interference.
204+
205+
3. ``Updating Bucket Notification Configurations``: Buckets that are subscribed to
206+
the old user-owned topics should be updated to use the new account-owned topics.
207+
To prevent duplicate notifications, maintain the same notification IDs.
208+
For example, if a bucket's existing notification configuration is:
209+
210+
.. code-block:: json
211+
212+
{"TopicConfigurations": [{ "Id": "ID1", "TopicArn": "arn:aws:sns:default::topic1", "Events": ["s3:ObjectCreated:*"]}]}
213+
214+
The updated configuration would be:
215+
216+
.. code-block:: json
217+
218+
{"TopicConfigurations": [{ "Id": "ID1", "TopicArn": "arn:aws:sns:default:RGW00000000000000001:topic1", "Events": ["s3:ObjectCreated:*"]}]}
219+
220+
In this example, `RGW00000000000000001` is the account ID, `topic1` is the
221+
topic name and `ID1` is the notification ID.
222+
223+
4. ``Removing Old Topics``: Once no buckets are subscribed to the old user-owned topics,
224+
they can be removed by an admin::
225+
226+
$ radosgw-admin topic rm --topic topic1
227+
190228
Account Root example
191229
--------------------
192230

@@ -252,3 +290,5 @@ This example uses `awscli`_ to create an IAM user for S3 operations.
252290
.. _Evaluating policies within a single account: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-basics
253291
.. _Cross-account policy evaluation logic: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic-cross-account.html
254292
.. _awscli: https://docs.aws.amazon.com/cli/latest/
293+
.. _Bucket Notifications: ../notifications/
294+
.. _Supported Zone Features: ../zone-features/#supported-features

doc/radosgw/oidc.rst

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Example::
4545
POST "<hostname>?Action=Action=CreateOpenIDConnectProvider
4646
&ThumbprintList.list.1=F7D7B3515DD0D319DD219A43A9EA727AD6065287
4747
&ClientIDList.list.1=app-profile-jsp
48-
&Url=http://localhost:8080/auth/realms/quickstart
48+
&Url=http://localhost:8080/auth/realms/quickstart"
4949

5050

5151
DeleteOpenIDConnectProvider
@@ -63,7 +63,7 @@ Request Parameters
6363

6464
Example::
6565
POST "<hostname>?Action=Action=DeleteOpenIDConnectProvider
66-
&OpenIDConnectProviderArn=arn:aws:iam:::oidc-provider/localhost:8080/auth/realms/quickstart
66+
&OpenIDConnectProviderArn=arn:aws:iam:::oidc-provider/localhost:8080/auth/realms/quickstart"
6767

6868

6969
GetOpenIDConnectProvider
@@ -81,7 +81,7 @@ Request Parameters
8181

8282
Example::
8383
POST "<hostname>?Action=Action=GetOpenIDConnectProvider
84-
&OpenIDConnectProviderArn=arn:aws:iam:::oidc-provider/localhost:8080/auth/realms/quickstart
84+
&OpenIDConnectProviderArn=arn:aws:iam:::oidc-provider/localhost:8080/auth/realms/quickstart"
8585

8686
ListOpenIDConnectProviders
8787
--------------------------
@@ -95,3 +95,50 @@ None
9595

9696
Example::
9797
POST "<hostname>?Action=Action=ListOpenIDConnectProviders
98+
99+
AddClientIDToOpenIDConnectProvider
100+
----------------------------------
101+
102+
Add a client id to the list of existing client ids registered while creating an OpenIDConnectProvider.
103+
104+
Request Parameters
105+
~~~~~~~~~~~~~~~~~~
106+
107+
``OpenIDConnectProviderArn``
108+
109+
:Description: ARN of the IDP which is returned by the Create API.
110+
:Type: String
111+
112+
``ClientID``
113+
114+
:Description: Client Id to add to the existing OpenIDConnectProvider.
115+
:Type: String
116+
117+
Example::
118+
POST "<hostname>?Action=Action=AddClientIDToOpenIDConnectProvider
119+
&OpenIDConnectProviderArn=arn:aws:iam:::oidc-provider/localhost:8080/auth/realms/quickstart
120+
&ClientID=app-jee-jsp"
121+
122+
UpdateOpenIDConnectProviderThumbprint
123+
-------------------------------------
124+
125+
Update the existing thumbprint list of an OpenIDConnectProvider with the given list.
126+
This API removes the existing thumbprint list and replaces that with the input thumbprint list.
127+
128+
Request Parameters
129+
~~~~~~~~~~~~~~~~~~
130+
131+
``OpenIDConnectProviderArn``
132+
133+
:Description: ARN of the IDP which is returned by the Create API.
134+
:Type: String
135+
136+
``ThumbprintList.member.N``
137+
138+
:Description: List of OpenID Connect IDP's server certificates' thumbprints. A maximum of 5 thumbprints are allowed.
139+
:Type: Array of Strings
140+
141+
Example::
142+
POST "<hostname>?Action=Action=UpdateOpenIDConnectProviderThumbprint
143+
&OpenIDConnectProviderArn=arn:aws:iam:::oidc-provider/localhost:8080/auth/realms/quickstart
144+
&&ThumbprintList.list.1=ABCDB3515DD0D319DD219A43A9EA727AD6061234"

src/client/Client.cc

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15836,6 +15836,10 @@ int Client::ll_read(Fh *fh, loff_t off, loff_t len, bufferlist *bl)
1583615836
return -CEPHFS_ENOTCONN;
1583715837
}
1583815838

15839+
/* We can't return bytes written larger than INT_MAX, clamp len to that */
15840+
len = std::min(len, (loff_t)INT_MAX);
15841+
15842+
std::scoped_lock lock(client_lock);
1583915843
if (fh == NULL || !_ll_fh_exists(fh)) {
1584015844
ldout(cct, 3) << "(fh)" << fh << " is invalid" << dendl;
1584115845
return -CEPHFS_EBADF;
@@ -15847,10 +15851,6 @@ int Client::ll_read(Fh *fh, loff_t off, loff_t len, bufferlist *bl)
1584715851
tout(cct) << off << std::endl;
1584815852
tout(cct) << len << std::endl;
1584915853

15850-
/* We can't return bytes written larger than INT_MAX, clamp len to that */
15851-
len = std::min(len, (loff_t)INT_MAX);
15852-
std::scoped_lock lock(client_lock);
15853-
1585415854
int r = _read(fh, off, len, bl);
1585515855
ldout(cct, 3) << "ll_read " << fh << " " << off << "~" << len << " = " << r
1585615856
<< dendl;
@@ -15981,6 +15981,10 @@ int Client::ll_write(Fh *fh, loff_t off, loff_t len, const char *data)
1598115981
return -CEPHFS_ENOTCONN;
1598215982
}
1598315983

15984+
/* We can't return bytes written larger than INT_MAX, clamp len to that */
15985+
len = std::min(len, (loff_t)INT_MAX);
15986+
15987+
std::scoped_lock lock(client_lock);
1598415988
if (fh == NULL || !_ll_fh_exists(fh)) {
1598515989
ldout(cct, 3) << "(fh)" << fh << " is invalid" << dendl;
1598615990
return -CEPHFS_EBADF;
@@ -15993,10 +15997,6 @@ int Client::ll_write(Fh *fh, loff_t off, loff_t len, const char *data)
1599315997
tout(cct) << off << std::endl;
1599415998
tout(cct) << len << std::endl;
1599515999

15996-
/* We can't return bytes written larger than INT_MAX, clamp len to that */
15997-
len = std::min(len, (loff_t)INT_MAX);
15998-
std::scoped_lock lock(client_lock);
15999-
1600016000
int r = _write(fh, off, len, data, NULL, 0);
1600116001
ldout(cct, 3) << "ll_write " << fh << " " << off << "~" << len << " = " << r
1600216002
<< dendl;
@@ -16010,12 +16010,11 @@ int64_t Client::ll_writev(struct Fh *fh, const struct iovec *iov, int iovcnt, in
1601016010
return -CEPHFS_ENOTCONN;
1601116011
}
1601216012

16013+
std::scoped_lock cl(client_lock);
1601316014
if (fh == NULL || !_ll_fh_exists(fh)) {
1601416015
ldout(cct, 3) << "(fh)" << fh << " is invalid" << dendl;
1601516016
return -CEPHFS_EBADF;
1601616017
}
16017-
16018-
std::scoped_lock cl(client_lock);
1601916018
return _preadv_pwritev_locked(fh, iov, iovcnt, off, true, false);
1602016019
}
1602116020

@@ -16026,12 +16025,11 @@ int64_t Client::ll_readv(struct Fh *fh, const struct iovec *iov, int iovcnt, int
1602616025
return -CEPHFS_ENOTCONN;
1602716026
}
1602816027

16028+
std::scoped_lock cl(client_lock);
1602916029
if (fh == NULL || !_ll_fh_exists(fh)) {
1603016030
ldout(cct, 3) << "(fh)" << fh << " is invalid" << dendl;
1603116031
return -CEPHFS_EBADF;
1603216032
}
16033-
16034-
std::scoped_lock cl(client_lock);
1603516033
return _preadv_pwritev_locked(fh, iov, iovcnt, off, false, false);
1603616034
}
1603716035

@@ -16054,18 +16052,24 @@ int64_t Client::ll_preadv_pwritev(struct Fh *fh, const struct iovec *iov,
1605416052
return retval;
1605516053
}
1605616054

16055+
retval = 0;
16056+
std::unique_lock cl(client_lock);
16057+
1605716058
if(fh == NULL || !_ll_fh_exists(fh)) {
1605816059
ldout(cct, 3) << "(fh)" << fh << " is invalid" << dendl;
1605916060
retval = -CEPHFS_EBADF;
16061+
}
16062+
16063+
if (retval != 0) {
1606016064
if (onfinish != nullptr) {
16065+
cl.unlock();
1606116066
onfinish->complete(retval);
16067+
cl.lock();
1606216068
retval = 0;
1606316069
}
1606416070
return retval;
1606516071
}
1606616072

16067-
std::scoped_lock cl(client_lock);
16068-
1606916073
retval = _preadv_pwritev_locked(fh, iov, iovcnt, offset, write, true,
1607016074
onfinish, bl, do_fsync, syncdataonly);
1607116075
/* There are two scenarios with each having two cases to handle here
@@ -16086,9 +16090,9 @@ int64_t Client::ll_preadv_pwritev(struct Fh *fh, const struct iovec *iov,
1608616090
if (retval < 0) {
1608716091
if (onfinish != nullptr) {
1608816092
//async io failed
16089-
client_lock.unlock();
16093+
cl.unlock();
1609016094
onfinish->complete(retval);
16091-
client_lock.lock();
16095+
cl.lock();
1609216096
/* async call should always return zero to caller and allow the
1609316097
caller to wait on callback for the actual errno/retval. */
1609416098
retval = 0;

src/rgw/rgw_auth_s3.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ bool is_non_s3_op(RGWOpType op_type)
495495
case RGW_OP_DELETE_OIDC_PROVIDER:
496496
case RGW_OP_GET_OIDC_PROVIDER:
497497
case RGW_OP_LIST_OIDC_PROVIDERS:
498+
case RGW_OP_ADD_CLIENTID_TO_OIDC_PROVIDER:
499+
case RGW_OP_UPDATE_OIDC_PROVIDER_THUMBPRINT:
498500
case RGW_OP_PUBSUB_TOPIC_CREATE:
499501
case RGW_OP_PUBSUB_TOPICS_LIST:
500502
case RGW_OP_PUBSUB_TOPIC_GET:

src/rgw/rgw_iam_policy.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ static const actpair actpairs[] =
160160
{ "iam:DeleteOIDCProvider", iamDeleteOIDCProvider},
161161
{ "iam:GetOIDCProvider", iamGetOIDCProvider},
162162
{ "iam:ListOIDCProviders", iamListOIDCProviders},
163+
{ "iam:AddClientIdToOIDCProvider", iamAddClientIdToOIDCProvider},
164+
{ "iam:UpdateOIDCProviderThumbprint", iamUpdateOIDCProviderThumbprint},
163165
{ "iam:TagRole", iamTagRole},
164166
{ "iam:ListRoleTags", iamListRoleTags},
165167
{ "iam:UntagRole", iamUntagRole},
@@ -1550,6 +1552,12 @@ const char* action_bit_string(uint64_t action) {
15501552
case iamListOIDCProviders:
15511553
return "iam:ListOIDCProviders";
15521554

1555+
case iamAddClientIdToOIDCProvider:
1556+
return "iam:AddClientIdToOIDCProvider";
1557+
1558+
case iamUpdateOIDCProviderThumbprint:
1559+
return "iam:UpdateOIDCProviderThumbprint";
1560+
15531561
case iamTagRole:
15541562
return "iam:TagRole";
15551563

src/rgw/rgw_iam_policy.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ enum {
143143
iamDeleteOIDCProvider,
144144
iamGetOIDCProvider,
145145
iamListOIDCProviders,
146+
iamAddClientIdToOIDCProvider,
147+
iamUpdateOIDCProviderThumbprint,
146148
iamTagRole,
147149
iamListRoleTags,
148150
iamUntagRole,

src/rgw/rgw_op_type.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,7 @@ enum RGWOpType {
161161
RGW_OP_DELETE_OIDC_PROVIDER,
162162
RGW_OP_GET_OIDC_PROVIDER,
163163
RGW_OP_LIST_OIDC_PROVIDERS,
164+
RGW_OP_ADD_CLIENTID_TO_OIDC_PROVIDER,
165+
RGW_OP_UPDATE_OIDC_PROVIDER_THUMBPRINT,
164166
};
165167

src/rgw/rgw_rest_iam.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ static const std::unordered_map<std::string_view, op_generator> op_generators =
4545
{"ListOpenIDConnectProviders", [](const bufferlist& bl_post_body) -> RGWOp* {return new RGWListOIDCProviders;}},
4646
{"GetOpenIDConnectProvider", [](const bufferlist& bl_post_body) -> RGWOp* {return new RGWGetOIDCProvider;}},
4747
{"DeleteOpenIDConnectProvider", [](const bufferlist& bl_post_body) -> RGWOp* {return new RGWDeleteOIDCProvider;}},
48+
{"AddClientIDToOpenIDConnectProvider", [](const bufferlist& bl_post_body) -> RGWOp* {return new RGWAddClientIdToOIDCProvider;}},
49+
{"UpdateOpenIDConnectProviderThumbprint", [](const bufferlist& bl_post_body) -> RGWOp* {return new RGWUpdateOIDCProviderThumbprint;}},
4850
{"TagRole", [](const bufferlist& bl_post_body) -> RGWOp* {return new RGWTagRole(bl_post_body);}},
4951
{"ListRoleTags", [](const bufferlist& bl_post_body) -> RGWOp* {return new RGWListRoleTags;}},
5052
{"UntagRole", [](const bufferlist& bl_post_body) -> RGWOp* {return new RGWUntagRole(bl_post_body);}},

0 commit comments

Comments
 (0)