Skip to content

[#112] Use rodsadmin connection for all quota operations (main)#146

Draft
korydraughn wants to merge 1 commit into
irods:mainfrom
korydraughn:112.m
Draft

[#112] Use rodsadmin connection for all quota operations (main)#146
korydraughn wants to merge 1 commit into
irods:mainfrom
korydraughn:112.m

Conversation

@korydraughn
Copy link
Copy Markdown
Collaborator

Existing tests pass.

Putting in draft until I can determine if a test can be added.

This commit resolves a problem involving the metadata guard rule engine
plugin and server redirects. The problem occurs under the following
conditions:

  - The provider has the metadata guard plugin enabled
  - The metadata guard is configured to only allow rodsadmin users to
    modify metadata
  - The consumer has the logical quotas plugin enabled
  - User connects to consumer and places data into a collection
    monitored by the logical quotas plugin, triggering a server redirect
  - Quota values fail to be updated

The quota values are not updated because the logical quotas plugin
attempted to use the non-rodsadmin connection to update metadata
protected by the metadata guard plugin.

This commit resolves the problem by making the logical quotas plugin
connect to the server using the local rodsadmin account. This also
avoids permission issues related to checking quotas on parent
collections.
Copy link
Copy Markdown
Member

@trel trel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty surgical.

Comment thread src/handler.cpp
addInxVal(&input.sqlCondInp, COL_COLL_NAME, fmt::format("= '{}'", _coll_path).c_str());
addInxVal(&input.sqlCondInp, COL_META_COLL_ATTR_NAME, fmt::format("= '{}'", _quota_name).c_str());
addInxVal(
&input.sqlCondInp, COL_COLL_NAME, fmt::format("= '{}'", irods::single_quotes_to_hex(_coll_path)).c_str());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the call to single_quotes_to_hex is new. that's unrelated to the new conn being used... right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can pull that out into a separate commit if desired. Probably a good idea to do that so it's more visible. Also, it's unrelated to the target issue.

I'll pull it into its own commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants