PATH:
home
/
thecwrif
/
public_html
/
wp-content
/
plugins
/
w3-total-cache
/
vendor
/
aws
/
aws-sdk-php
/
src
<?php namespace Aws; use Aws\Signature\SignatureV4; use Aws\Endpoint\EndpointProvider; use GuzzleHttp\Psr7\Uri; use Psr\Http\Message\RequestInterface; /** * @internal Adds computed values to service operations that need presigned url. */ class PresignUrlMiddleware { private $client; private $endpointProvider; private $nextHandler; /** @var array names of operations that require presign url */ private $commandPool; /** @var array query params that are not on the operation's model to add before signing */ private $extraQueryParams; /** @var string */ private $serviceName; /** @var string */ private $presignParam; /** @var bool */ private $requireDifferentRegion; public function __construct( array $options, callable $endpointProvider, AwsClientInterface $client, callable $nextHandler ) { $this->endpointProvider = $endpointProvider; $this->client = $client; $this->nextHandler = $nextHandler; $this->commandPool = $options['operations']; $this->serviceName = $options['service']; $this->presignParam = !empty($options['presign_param']) ? $options['presign_param'] : 'PresignedUrl'; $this->extraQueryParams = !empty($options['extra_query_params']) ? $options['extra_query_params'] : []; $this->requireDifferentRegion = !empty($options['require_different_region']); } public static function wrap( AwsClientInterface $client, callable $endpointProvider, array $options = [] ) { return function (callable $handler) use ($endpointProvider, $client, $options) { $f = new PresignUrlMiddleware($options, $endpointProvider, $client, $handler); return $f; }; } public function __invoke(CommandInterface $cmd, RequestInterface $request = null) { if (in_array($cmd->getName(), $this->commandPool) && (!isset($cmd->{'__skip' . $cmd->getName()})) ) { $cmd['DestinationRegion'] = $this->client->getRegion(); if (!empty($cmd['SourceRegion']) && !empty($cmd[$this->presignParam])) { goto nexthandler; } if (!$this->requireDifferentRegion || (!empty($cmd['SourceRegion']) && $cmd['SourceRegion'] !== $cmd['DestinationRegion']) ) { $cmd[$this->presignParam] = $this->createPresignedUrl($this->client, $cmd); } } nexthandler: $nextHandler = $this->nextHandler; return $nextHandler($cmd, $request); } private function createPresignedUrl( AwsClientInterface $client, CommandInterface $cmd ) { $cmdName = $cmd->getName(); $newCmd = $client->getCommand($cmdName, $cmd->toArray()); // Avoid infinite recursion by flagging the new command. $newCmd->{'__skip' . $cmdName} = true; // Serialize a request for the operation. $request = \Aws\serialize($newCmd); // Create the new endpoint for the target endpoint. $endpoint = EndpointProvider::resolve($this->endpointProvider, [ 'region' => $cmd['SourceRegion'], 'service' => $this->serviceName, ])['endpoint']; // Set the request to hit the target endpoint. $uri = $request->getUri()->withHost((new Uri($endpoint))->getHost()); $request = $request->withUri($uri); // Create a presigned URL for our generated request. $signer = new SignatureV4($this->serviceName, $cmd['SourceRegion']); $currentQueryParams = (string) $request->getBody(); $paramsToAdd = false; if (!empty($this->extraQueryParams[$cmdName])) { foreach ($this->extraQueryParams[$cmdName] as $param) { if (!strpos($currentQueryParams, $param)) { $paramsToAdd = "&{$param}={$cmd[$param]}"; } } } return (string) $signer->presign( SignatureV4::convertPostToGet($request, $paramsToAdd ?: ""), $client->getCredentials()->wait(), '+1 hour' )->getUri(); } }
[+]
..
[+]
WorkMail
[+]
Rekognition
[+]
ConnectParticipant
[+]
IoTSiteWise
[+]
PersonalizeEvents
[+]
Redshift
[-] MonitoringEventsInterface.php
[edit]
[+]
ResourceGroups
[+]
ApplicationCostProfiler
[+]
DLM
[+]
LookoutMetrics
[+]
CodeStarconnections
[+]
IoTJobsDataPlane
[+]
KinesisVideoMedia
[+]
ElasticTranscoder
[+]
EndpointDiscovery
[+]
Mobile
[+]
RAM
[+]
TimestreamWrite
[+]
Athena
[+]
Backup
[+]
LakeFormation
[+]
AlexaForBusiness
[+]
Neptune
[+]
IoT1ClickDevicesService
[-] ConfigurationProviderInterface.php
[edit]
[+]
LicenseManager
[+]
DynamoDb
[+]
StorageGateway
[+]
ForecastQueryService
[+]
Credentials
[+]
Glue
[-] MultiRegionClient.php
[edit]
[+]
Chime
[+]
data
[+]
DeviceFarm
[-] HasDataTrait.php
[edit]
[+]
HealthLake
[+]
Comprehend
[+]
mgn
[+]
CloudFront
[+]
ResourceGroupsTaggingAPI
[+]
Iot
[+]
signer
[+]
MarketplaceCatalog
[+]
CodeDeploy
[+]
EBS
[+]
SSMIncidents
[+]
DevOpsGuru
[+]
AutoScaling
[+]
AppRunner
[-] MockHandler.php
[edit]
[+]
AppMesh
[+]
RedshiftDataAPIService
[+]
CloudHsm
[+]
MediaStore
[+]
DirectoryService
[+]
LexModelsV2
[-] HashingStream.php
[edit]
[+]
Arn
[+]
DirectConnect
[+]
Ecr
[+]
MediaLive
[-] Result.php
[edit]
[-] AwsClientTrait.php
[edit]
[+]
PinpointSMSVoice
[+]
GameLift
[+]
CodeStarNotifications
[+]
SSOOIDC
[+]
MQ
[+]
Schemas
[+]
Health
[+]
DatabaseMigrationService
[+]
Detective
[-] ClientResolver.php
[edit]
[+]
Signature
[+]
Swf
[+]
Honeycode
[+]
Macie2
[+]
GuardDuty
[-] WrappedHttpHandler.php
[edit]
[+]
ServiceCatalog
[-] LruArrayCache.php
[edit]
[+]
ApplicationAutoScaling
[+]
LookoutEquipment
[+]
MediaConnect
[+]
KinesisAnalyticsV2
[+]
SSOAdmin
[+]
LocationService
[+]
IoTEventsData
[+]
KinesisAnalytics
[+]
ManagedBlockchain
[+]
SSO
[+]
WAFV2
[+]
Pricing
[-] functions.php
[edit]
[+]
SagemakerEdgeManager
[+]
DataPipeline
[-] CommandInterface.php
[edit]
[+]
PersonalizeRuntime
[+]
Route53
[+]
CloudDirectory
[-] Command.php
[edit]
[-] PsrCacheAdapter.php
[edit]
[+]
AppRegistry
[+]
RDSDataService
[-] RetryMiddlewareV2.php
[edit]
[+]
LookoutforVision
[+]
GlueDataBrew
[+]
Appstream
[+]
CostandUsageReportService
[+]
EventBridge
[+]
NetworkFirewall
[+]
CloudTrail
[+]
SageMaker
[+]
DynamoDbStreams
[+]
ElasticLoadBalancingV2
[+]
Waf
[+]
CodeGuruProfiler
[-] EndpointParameterMiddleware.php
[edit]
[+]
CloudWatchEvents
[+]
Transfer
[+]
CodeGuruReviewer
[+]
SnowBall
[+]
CognitoIdentityProvider
[+]
ECRPublic
[+]
MediaConvert
[+]
PI
[+]
KinesisVideo
[+]
CloudSearch
[+]
CloudWatchLogs
[-] JsonCompiler.php
[edit]
[+]
MigrationHubConfig
[+]
MediaPackage
[-] ResultInterface.php
[edit]
[+]
CloudSearchDomain
[+]
IoTThingsGraph
[+]
Emr
[+]
ComputeOptimizer
[+]
PinpointEmail
[+]
ClientSideMonitoring
[+]
MigrationHub
[+]
WafRegional
[+]
IdentityStore
[+]
IoT1ClickProjects
[+]
ServiceDiscovery
[+]
FinSpaceData
[+]
IoTDeviceAdvisor
[+]
CodeCommit
[+]
AutoScalingPlans
[+]
IotDataPlane
[+]
CostExplorer
[+]
Efs
[+]
CodeArtifact
[+]
FSx
[-] Middleware.php
[edit]
[+]
GroundStation
[+]
Firehose
[+]
Cloud9
[+]
Sts
[+]
ConnectContactLens
[+]
GreengrassV2
[+]
Acm
[+]
Kafka
[+]
MarketplaceMetering
[+]
ApplicationInsights
[+]
MarketplaceCommerceAnalytics
[+]
MachineLearning
[+]
Multipart
[+]
Personalize
[+]
Support
[+]
ApiGatewayV2
[-] AwsClient.php
[edit]
[+]
IVS
[+]
ElasticInference
[+]
DataExchange
[+]
S3Outposts
[+]
ACMPCA
[+]
GlobalAccelerator
[+]
Translate
[+]
AccessAnalyzer
[+]
Ecs
[+]
QuickSight
[+]
Sfn
[+]
CustomerProfiles
[+]
WorkSpaces
[+]
ImportExport
[+]
PrometheusService
[+]
MTurk
[-] ResultPaginator.php
[edit]
[+]
SecurityHub
[+]
CodePipeline
[+]
MediaPackageVod
[+]
LexRuntimeV2
[+]
Ssm
[+]
Organizations
[-] PresignUrlMiddleware.php
[edit]
[+]
AppIntegrationsService
[+]
Braket
[+]
ServerlessApplicationRepository
[+]
Retry
[+]
Rds
[-] HasMonitoringEventsTrait.php
[edit]
[+]
WorkDocs
[-] InputValidationMiddleware.php
[edit]
[+]
DAX
[+]
IoTSecureTunneling
[+]
Outposts
[+]
Handler
[+]
imagebuilder
[-] AbstractConfigurationProvider.php
[edit]
[+]
Sns
[+]
Pinpoint
[+]
ComprehendMedical
[+]
MediaTailor
[+]
Ec2
[+]
ElasticBeanstalk
[+]
Textract
[+]
Lightsail
[+]
CognitoSync
[+]
FraudDetector
[+]
IoTFleetHub
[+]
CodeStar
[+]
SageMakerFeatureStoreRuntime
[+]
EMRContainers
[-] TraceMiddleware.php
[edit]
[+]
SageMakerRuntime
[+]
Sms
[+]
AugmentedAIRuntime
[+]
FIS
[+]
FMS
[+]
TimestreamQuery
[-] StreamRequestPayloadMiddleware.php
[edit]
[+]
Shield
[+]
Amplify
[+]
S3
[+]
ApplicationDiscoveryService
[+]
Lambda
[-] AwsClientInterface.php
[edit]
[-] HandlerList.php
[edit]
[+]
Exception
[-] CacheInterface.php
[edit]
[+]
SavingsPlans
[+]
ElasticLoadBalancing
[+]
ElasticsearchService
[+]
AmplifyBackend
[+]
Glacier
[+]
Polly
[-] Waiter.php
[edit]
[+]
CognitoIdentity
[+]
TranscribeService
[+]
ForecastService
[-] HashInterface.php
[edit]
[+]
WellArchitected
[+]
Api
[-] ResponseContainerInterface.php
[edit]
[+]
AppConfig
[+]
Sqs
[+]
SecretsManager
[+]
QLDB
[+]
Batch
[+]
Endpoint
[+]
Macie
[+]
Kms
[-] RetryMiddleware.php
[edit]
[+]
S3Control
[+]
AppSync
[+]
ApiGatewayManagementApi
[-] DoctrineCacheAdapter.php
[edit]
[+]
kendra
[+]
EC2InstanceConnect
[+]
Budgets
[+]
CodeBuild
[-] IdempotencyTokenMiddleware.php
[edit]
[+]
WorkMailMessageFlow
[-] CommandPool.php
[edit]
[+]
MediaStoreData
[+]
IoTEvents
[+]
Greengrass
[+]
QLDBSession
[+]
CloudFormation
[+]
KinesisVideoSignalingChannels
[+]
MWAA
[-] Psr16CacheAdapter.php
[edit]
[+]
DocDB
[+]
Crypto
[+]
ConfigService
[+]
EKS
[+]
ServiceQuotas
[+]
XRay
[+]
KinesisVideoArchivedMedia
[+]
SSMContacts
[+]
RoboMaker
[+]
IoTWireless
[+]
MarketplaceEntitlementService
[+]
OpsWorksCM
[+]
Iam
[+]
ElastiCache
[+]
WorkLink
[+]
DataSync
[+]
AuditManager
[+]
Synthetics
[+]
Ses
[+]
Route53Resolver
[+]
Connect
[+]
Route53Domains
[+]
LexRuntimeService
[+]
OpsWorks
[+]
IoTAnalytics
[-] Sdk.php
[edit]
[-] PhpHash.php
[edit]
[+]
finspace
[+]
Appflow
[+]
NimbleStudio
[+]
CloudWatch
[+]
SesV2
[-] History.php
[edit]
[+]
LexModelBuildingService
[+]
NetworkManager
[+]
Inspector
[+]
ApiGateway
[+]
Kinesis
[+]
CloudHSMV2