Skip to content

Commit

Permalink
ROS3: (feature+fix) Temporary security credentials - comments 4
Browse files Browse the repository at this point in the history
- Implemented additional error check to ensure that the variable
  token_src is properly allocated.
- Removed the unused static token variable in h5dump.c
- Improved the description in the release_docs/RELEASE.txt document
  about the newly implemented functionality of supporting temporary
  security credentials for ROS3 file driver.
  • Loading branch information
jwsblokland committed Jun 20, 2023
1 parent f8bd2b0 commit 36c4ab9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
13 changes: 9 additions & 4 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ New Features

Library:
--------
- Implemented support for temporary security credentials for the Read-Only
S3 (ROS3) file driver.

When using temporary security credentials, one also needs to specify a
sesssion/security token next to the access key id and secret access key.

Check failure on line 155 in release_docs/RELEASE.txt

View workflow job for this annotation

GitHub Actions / Check for spelling errors

sesssion ==> session
This token can be specified by the new API function H5Pset_fapl_ros3_token().
The API function H5Pget_fapl_ros3_token() can be used to retrieve
the currently set token.

- Added a Subfiling VFD configuration file prefix environment variable

The Subfiling VFD now checks for values set in a new environment
Expand All @@ -168,10 +177,6 @@ New Features
order to avoid malloc/memcpy. Currently only used for type conversion
with selection I/O.

- Added H5Pset_fapl_ros3_token() and H5Pget_fapl_ros3_token() API functions
to set or get the session/security token. This token is needed when
making use of AWS temporary security credentials.


Parallel Library:
-----------------
Expand Down
4 changes: 3 additions & 1 deletion src/H5FDros3.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,9 @@ H5Pset_fapl_ros3_token(hid_t fapl_id, const char *token)
HDmemcpy(token_src, token, HDstrlen(token) + 1);
}
else {
token_src = HDmalloc(sizeof(char) * (H5FD_ROS3_MAX_SECRET_TOK_LEN + 1));
token_src = (char *)HDmalloc(sizeof(char) * (H5FD_ROS3_MAX_SECRET_TOK_LEN + 1));
if (token_src == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for token_src variable.");
HDmemcpy(token_src, token, HDstrlen(token) + 1);
if (H5P_insert(plist, ROS3_TOKEN_PROP_NAME, sizeof(char *), &token_src, NULL, NULL, NULL, NULL,
H5FD__ros3_str_token_delete, H5FD__ros3_str_token_copy, H5FD__ros3_str_token_cmp,
Expand Down
3 changes: 1 addition & 2 deletions tools/src/h5dump/h5dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ static H5FD_ros3_fapl_ext_t ros3_fa_g = {
},
"", /* Session/security token */
};
static char token[H5FD_ROS3_MAX_SECRET_TOK_LEN]; /* Session/security token */
#endif /* H5_HAVE_ROS3_VFD */
#endif /* H5_HAVE_ROS3_VFD */

#ifdef H5_HAVE_LIBHDFS
/* "Default" HDFS configuration */
Expand Down

0 comments on commit 36c4ab9

Please sign in to comment.