Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace proxy_connection with client_connection #296

Closed
2 tasks done
alanking opened this issue Jan 14, 2025 · 2 comments
Closed
2 tasks done

Replace proxy_connection with client_connection #296

alanking opened this issue Jan 14, 2025 · 2 comments
Assignees
Labels
Milestone

Comments

@alanking
Copy link
Contributor

alanking commented Jan 14, 2025

  • main
  • 4-3-stable

At least 3 things can go wrong in this function and none of them are being handled:

auto make(const std::string clientUser = "", const std::string clientZone = "") -> rcComm_t*
{
rodsEnv env{};
_getRodsEnv(env);
conn = _rcConnect(
env.rodsHost,
env.rodsPort,
env.rodsUserName,
env.rodsZone,
!clientUser.empty() ?
clientUser.c_str() :
env.rodsUserName,
!clientZone.empty() ?
clientZone.c_str() :
env.rodsZone,
&err_msg,
0, 0);
clientLogin(conn);
return conn;
} // make

Make sure error cases are being checked and handled appropriately.

@alanking
Copy link
Contributor Author

Alternatively, as we move toward admin-only for all operations, we can probably just replace this entirely with client_connection and assume that the connection is privileged (i.e. use ADMIN_KW without checking authFlag in RcComm).

@korydraughn
Copy link
Collaborator

Agreed.

@alanking alanking changed the title Add error handling to proxy_connection Replace proxy_connection with client_connection Jan 17, 2025
@alanking alanking self-assigned this Jan 17, 2025
alanking added a commit to alanking/irods_capability_storage_tiering that referenced this issue Jan 23, 2025
The proxy_connections used by this plugin are equivalent to
using the irods::experimental::client_connection provided by
the iRODS client library except for modifying the authFlag.
Seeing as everything is done by client connections as admins
in the plugin now, the authFlag doesn't matter as much anymore.
As such, all instances of proxy_connection can be replaced and
the whole header file has been removed.

Also removes the unused exec_as_user header file.
alanking added a commit to alanking/irods_capability_storage_tiering that referenced this issue Jan 23, 2025
All operations are done using the local server's service account
rodsadmin client environment and as such do not need to know which
user needs to execute policies.
alanking added a commit that referenced this issue Jan 23, 2025
The proxy_connections used by this plugin are equivalent to
using the irods::experimental::client_connection provided by
the iRODS client library except for modifying the authFlag.
Seeing as everything is done by client connections as admins
in the plugin now, the authFlag doesn't matter as much anymore.
As such, all instances of proxy_connection can be replaced and
the whole header file has been removed.

Also removes the unused exec_as_user header file.
alanking added a commit that referenced this issue Jan 23, 2025
All operations are done using the local server's service account
rodsadmin client environment and as such do not need to know which
user needs to execute policies.
alanking added a commit to alanking/irods_capability_storage_tiering that referenced this issue Jan 23, 2025
The proxy_connections used by this plugin are equivalent to
using the irods::experimental::client_connection provided by
the iRODS client library except for modifying the authFlag.
Seeing as everything is done by client connections as admins
in the plugin now, the authFlag doesn't matter as much anymore.
As such, all instances of proxy_connection can be replaced and
the whole header file has been removed.

Also removes the unused exec_as_user header file.
alanking added a commit to alanking/irods_capability_storage_tiering that referenced this issue Jan 23, 2025
All operations are done using the local server's service account
rodsadmin client environment and as such do not need to know which
user needs to execute policies.
alanking added a commit that referenced this issue Jan 23, 2025
The proxy_connections used by this plugin are equivalent to
using the irods::experimental::client_connection provided by
the iRODS client library except for modifying the authFlag.
Seeing as everything is done by client connections as admins
in the plugin now, the authFlag doesn't matter as much anymore.
As such, all instances of proxy_connection can be replaced and
the whole header file has been removed.

Also removes the unused exec_as_user header file.
alanking added a commit that referenced this issue Jan 23, 2025
All operations are done using the local server's service account
rodsadmin client environment and as such do not need to know which
user needs to execute policies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants