diff --git a/doc/man/s3fs.1 b/doc/man/s3fs.1 index 3e2d91e..4e60e5f 100644 --- a/doc/man/s3fs.1 +++ b/doc/man/s3fs.1 @@ -225,6 +225,9 @@ This option requires the IAM role name or "auto". If you specify "auto", s3fs wi \fB\-o\fR ibm_iam_auth ( default is not using IBM IAM authentication ) This option instructs s3fs to use IBM IAM authentication. In this mode, the AWSAccessKey and AWSSecretKey will be used as IBM's Service-Instance-ID and APIKey, respectively. .TP +\fB\-o\fR ibm_iam_endpoint ( default is https://iam.bluemix.net ) +Set the URL to use for IBM IAM authentication. +.TP \fB\-o\fR use_xattr ( default is not handling the extended attribute ) Enable to handle the extended attribute(xattrs). If you set this option, you can use the extended attribute. diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 098f1a1..98bf578 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -4523,6 +4523,17 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar is_ibm_iam_auth = true; return 0; } + if(0 == STR2NCMP(arg, "ibm_iam_endpoint=")){ + std::string endpoint_url = ""; + std::string iam_endpoint = strchr(arg, '=') + sizeof(char); + // Check url for http / https protocol string + if((iam_endpoint.compare(0, 8, "https://") != 0) && (iam_endpoint.compare(0, 7, "http://") != 0)) { + S3FS_PRN_EXIT("option ibm_iam_endpoint has invalid format, missing http / https protocol"); + return -1; + } + endpoint_url = iam_endpoint + "/oidc/token"; + S3fsCurl::SetIAMCredentialsURL(endpoint_url.c_str()); + } if(0 == strcmp(arg, "ecs")){ if (is_ibm_iam_auth) { S3FS_PRN_EXIT("option ecs cannot be used in conjunction with ibm"); diff --git a/src/s3fs_util.cpp b/src/s3fs_util.cpp index dacd5e8..69cfc37 100644 --- a/src/s3fs_util.cpp +++ b/src/s3fs_util.cpp @@ -1209,6 +1209,9 @@ void show_help (void) " In this mode, the AWSAccessKey and AWSSecretKey will be used as\n" " IBM's Service-Instance-ID and APIKey, respectively.\n" "\n" + " ibm_iam_endpoint (default is https://iam.bluemix.net)\n" + " - sets the url to use for IBM IAM authentication.\n" + "\n" " use_xattr (default is not handling the extended attribute)\n" " Enable to handle the extended attribute(xattrs).\n" " If you set this option, you can use the extended attribute.\n"