minio / minio-cpp

MinIO C++ Client SDK for Amazon S3 Compatible Cloud Storage
https://minio-cpp.min.io/
Apache License 2.0
135 stars 56 forks source link

Confuse. why "parasolid" or "para_dm" doesn't meet the s3 standards strictly #151

Closed skydream-xu closed 4 months ago

skydream-xu commented 4 months ago

code: minio::s3::BucketExistsArgs args; args.bucket = "para_dm";

// Call bucket exists.
minio::s3::BucketExistsResponse resp = client.BucketExists(args);

// Handle response.

// if (resp) { if (!resp.exist) { minio::s3::MakeBucketArgs args2; args2.bucket = "para_dm"; minio::s3::MakeBucketResponse resp = client.MakeBucket(args2); std::cout << std::endl; } // } // else { // std::cout << "unable to do bucket existence check; " // << resp.Error().String() << std::endl; // } }

run env: windows

error: bucket name does not follow S3 standards strictly

the utils.cc code: static const std::regex BUCKET_NAME_REGEX( "^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$"); static const std::regex OLD_BUCKET_NAMEREGEX( "^[a-z0-9][a-z0-9\.\-\:]{1,61}[a-z0-9]$", std::regex_constants::icase); if (strict) { if (!std::regex_match(bucket_name.data(), BUCKET_NAME_REGEX)) { return error::Error("bucket name does not follow S3 standards strictly"); } } else if (!std::regex_match(bucket_name.data(), OLD_BUCKET_NAME_REGEX)) { return error::Error("bucket name does not follow S3 standards"); }

why here need "!" ?

balamurugana commented 4 months ago

_ is not permitted

skydream-xu commented 4 months ago

”Parasolid“ doesn't contain "_" which has the same error

”Parasolid“ doesn't contain "_" which has the same error