Class: Aws::S3::Plugins::AccessGrants::Handler Private

Inherits:
Seahorse::Client::Handler
  • Object
show all
Defined in:
lib/aws-sdk-s3/plugins/access_grants.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

PERMISSION_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  head_object: 'READ',
  get_object: 'READ',
  get_object_acl: 'READ',
  list_multipart_uploads: 'READ',
  list_objects_v2: 'READ',
  list_object_versions: 'READ',
  list_parts: 'READ',
  put_object: 'WRITE',
  put_object_acl: 'WRITE',
  delete_object: 'WRITE',
  abort_multipart_upload: 'WRITE',
  create_multipart_upload: 'WRITE',
  upload_part: 'WRITE',
  complete_multipart_upload: 'WRITE'
}.freeze

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/aws-sdk-s3/plugins/access_grants.rb', line 56

def call(context)
  if access_grants_operation?(context) &&
     !s3_express_endpoint?(context)
    params = context[:endpoint_params]
    permission = PERMISSION_MAP[context.operation_name]

    provider = context.config.access_grants_credentials_provider
    credentials = provider.access_grants_credentials_for(
      bucket: params[:bucket],
      key: params[:key],
      prefix: params[:prefix],
      permission: permission
    )
    context[:sigv4_credentials] = credentials # Sign will use this
  end

  with_metric(credentials) { @handler.call(context) }
end