s3api_bucket_skip_handlers.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package s3api
  2. import (
  3. "github.com/seaweedfs/seaweedfs/weed/glog"
  4. "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
  5. "net/http"
  6. "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
  7. )
  8. // GetBucketCorsHandler Get bucket CORS
  9. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html
  10. func (s3a *S3ApiServer) GetBucketCorsHandler(w http.ResponseWriter, r *http.Request) {
  11. s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchCORSConfiguration)
  12. }
  13. // PutBucketCorsHandler Put bucket CORS
  14. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html
  15. func (s3a *S3ApiServer) PutBucketCorsHandler(w http.ResponseWriter, r *http.Request) {
  16. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  17. }
  18. // DeleteBucketCorsHandler Delete bucket CORS
  19. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html
  20. func (s3a *S3ApiServer) DeleteBucketCorsHandler(w http.ResponseWriter, r *http.Request) {
  21. s3err.WriteErrorResponse(w, r, http.StatusNoContent)
  22. }
  23. // GetBucketPolicyHandler Get bucket Policy
  24. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html
  25. func (s3a *S3ApiServer) GetBucketPolicyHandler(w http.ResponseWriter, r *http.Request) {
  26. s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchBucketPolicy)
  27. }
  28. // PutBucketPolicyHandler Put bucket Policy
  29. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html
  30. func (s3a *S3ApiServer) PutBucketPolicyHandler(w http.ResponseWriter, r *http.Request) {
  31. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  32. }
  33. // DeleteBucketPolicyHandler Delete bucket Policy
  34. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html
  35. func (s3a *S3ApiServer) DeleteBucketPolicyHandler(w http.ResponseWriter, r *http.Request) {
  36. s3err.WriteErrorResponse(w, r, http.StatusNoContent)
  37. }
  38. // PutBucketVersioningHandler Put bucket Versionin
  39. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html
  40. func (s3a *S3ApiServer) PutBucketVersioningHandler(w http.ResponseWriter, r *http.Request) {
  41. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  42. }
  43. // GetBucketTaggingHandler Returns the tag set associated with the bucket
  44. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html
  45. func (s3a *S3ApiServer) GetBucketTaggingHandler(w http.ResponseWriter, r *http.Request) {
  46. bucket, _ := s3_constants.GetBucketAndObject(r)
  47. glog.V(3).Infof("GetBucketTagging %s", bucket)
  48. if err := s3a.checkBucket(r, bucket); err != s3err.ErrNone {
  49. s3err.WriteErrorResponse(w, r, err)
  50. return
  51. }
  52. s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchTagSet)
  53. }
  54. func (s3a *S3ApiServer) PutBucketTaggingHandler(w http.ResponseWriter, r *http.Request) {
  55. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  56. }
  57. func (s3a *S3ApiServer) DeleteBucketTaggingHandler(w http.ResponseWriter, r *http.Request) {
  58. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  59. }
  60. // GetBucketEncryptionHandler Returns the default encryption configuration
  61. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html
  62. func (s3a *S3ApiServer) GetBucketEncryptionHandler(w http.ResponseWriter, r *http.Request) {
  63. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  64. }
  65. func (s3a *S3ApiServer) PutBucketEncryptionHandler(w http.ResponseWriter, r *http.Request) {
  66. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  67. }
  68. func (s3a *S3ApiServer) DeleteBucketEncryptionHandler(w http.ResponseWriter, r *http.Request) {
  69. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  70. }
  71. // GetPublicAccessBlockHandler Retrieves the PublicAccessBlock configuration for an S3 bucket
  72. // https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html
  73. func (s3a *S3ApiServer) GetPublicAccessBlockHandler(w http.ResponseWriter, r *http.Request) {
  74. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  75. }
  76. func (s3a *S3ApiServer) PutPublicAccessBlockHandler(w http.ResponseWriter, r *http.Request) {
  77. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  78. }
  79. func (s3a *S3ApiServer) DeletePublicAccessBlockHandler(w http.ResponseWriter, r *http.Request) {
  80. s3err.WriteErrorResponse(w, r, s3err.ErrNotImplemented)
  81. }