PATH:
home
/
lab2454c
/
vaultchip.com
/
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(); } }
[+]
..
[+]
ServiceQuotas
[+]
Crypto
[+]
ForecastService
[+]
EBS
[+]
CloudFormation
[+]
Sts
[+]
Athena
[-] RetryMiddleware.php
[edit]
[+]
WorkDocs
[+]
ClientSideMonitoring
[+]
DeviceFarm
[+]
ComprehendMedical
[+]
Rekognition
[+]
FIS
[+]
DAX
[+]
SageMaker
[+]
MTurk
[+]
ElasticLoadBalancing
[+]
Ecs
[+]
IdentityStore
[+]
LookoutEquipment
[-] StreamRequestPayloadMiddleware.php
[edit]
[+]
WellArchitected
[+]
Health
[-] HasDataTrait.php
[edit]
[+]
Ses
[+]
Schemas
[+]
MachineLearning
[+]
Route53RecoveryControlConfig
[+]
WorkMail
[-] ConfigurationProviderInterface.php
[edit]
[+]
IoTWireless
[+]
data
[-] HasMonitoringEventsTrait.php
[edit]
[+]
KinesisVideoMedia
[+]
Pinpoint
[+]
AppMesh
[+]
IoTFleetHub
[+]
AutoScaling
[+]
CodeGuruProfiler
[+]
MediaTailor
[+]
CodeCommit
[+]
GlueDataBrew
[-] CacheInterface.php
[edit]
[+]
Sqs
[+]
AutoScalingPlans
[+]
IoTEvents
[+]
MediaPackage
[+]
Budgets
[+]
IVS
[+]
ForecastQueryService
[+]
MarketplaceEntitlementService
[+]
AmplifyBackend
[+]
LicenseManager
[+]
CloudTrail
[+]
IoT1ClickProjects
[+]
IoTThingsGraph
[+]
SavingsPlans
[+]
CloudFront
[+]
ServerlessApplicationRepository
[+]
ElasticsearchService
[+]
DynamoDbStreams
[+]
DLM
[-] Sdk.php
[edit]
[+]
XRay
[+]
CloudSearchDomain
[+]
MarketplaceCatalog
[+]
CostExplorer
[+]
Chime
[-] MockHandler.php
[edit]
[-] JsonCompiler.php
[edit]
[+]
IoTJobsDataPlane
[-] HashingStream.php
[edit]
[+]
SSOAdmin
[+]
NimbleStudio
[+]
ResourceGroupsTaggingAPI
[-] PsrCacheAdapter.php
[edit]
[+]
LakeFormation
[+]
ChimeSDKMessaging
[+]
Iot
[+]
NetworkFirewall
[+]
Synthetics
[+]
IoTSecureTunneling
[+]
Glue
[+]
signer
[+]
kendra
[+]
CodeArtifact
[+]
OpenSearchService
[+]
LocationService
[+]
Sns
[+]
WorkLink
[+]
Api
[+]
MQ
[+]
Exception
[+]
WafRegional
[+]
ResourceGroups
[+]
S3Control
[+]
EventBridge
[+]
Appstream
[+]
CodeBuild
[+]
MediaLive
[+]
SesV2
[+]
Kinesis
[+]
MediaStoreData
[-] CommandInterface.php
[edit]
[+]
KafkaConnect
[+]
Kafka
[+]
EC2InstanceConnect
[+]
CodeGuruReviewer
[+]
CloudHsm
[+]
MarketplaceMetering
[+]
CloudDirectory
[+]
ImportExport
[+]
Route53RecoveryCluster
[+]
Route53Resolver
[+]
ChimeSDKIdentity
[+]
KinesisVideoSignalingChannels
[+]
ConfigService
[-] HandlerList.php
[edit]
[+]
KinesisAnalyticsV2
[+]
ElasticBeanstalk
[-] Waiter.php
[edit]
[+]
GroundStation
[+]
ElastiCache
[+]
KinesisVideoArchivedMedia
[+]
mgn
[+]
Efs
[+]
imagebuilder
[+]
AppConfig
[+]
QLDB
[+]
WAFV2
[+]
CloudSearch
[+]
Redshift
[+]
PinpointSMSVoice
[+]
QLDBSession
[+]
SecretsManager
[+]
EMRContainers
[+]
SSMIncidents
[+]
Lambda
[+]
Multipart
[+]
DatabaseMigrationService
[+]
AugmentedAIRuntime
[+]
DataExchange
[-] AbstractConfigurationProvider.php
[edit]
[+]
Proton
[+]
RedshiftDataAPIService
[-] InputValidationMiddleware.php
[edit]
[+]
CustomerProfiles
[+]
WorkMailMessageFlow
[-] ResultPaginator.php
[edit]
[+]
Route53Domains
[+]
CloudHSMV2
[-] RetryMiddlewareV2.php
[edit]
[+]
ApplicationDiscoveryService
[+]
Ec2
[+]
Shield
[+]
LexModelBuildingService
[+]
ElasticTranscoder
[+]
Handler
[+]
EndpointDiscovery
[+]
DynamoDb
[+]
CloudWatchLogs
[-] ResponseContainerInterface.php
[edit]
[+]
Inspector
[+]
Ecr
[+]
RDSDataService
[+]
DirectoryService
[+]
IoTAnalytics
[+]
CloudWatchEvents
[+]
RAM
[+]
FMS
[-] ClientResolver.php
[edit]
[+]
Signature
[+]
AccessAnalyzer
[-] Command.php
[edit]
[+]
PrometheusService
[+]
ConnectParticipant
[+]
ServiceCatalog
[+]
Ssm
[+]
IoT1ClickDevicesService
[+]
TimestreamWrite
[+]
ApplicationAutoScaling
[+]
CodePipeline
[-] History.php
[edit]
[+]
FSx
[+]
Batch
[+]
AlexaForBusiness
[+]
Braket
[+]
ACMPCA
[-] Middleware.php
[edit]
[+]
Personalize
[+]
Detective
[+]
ManagedBlockchain
[+]
SSOOIDC
[+]
Endpoint
[+]
SnowBall
[+]
Acm
[-] AwsClientInterface.php
[edit]
[+]
Kms
[+]
Iam
[+]
SSMContacts
[+]
AppIntegrationsService
[+]
ElasticInference
[-] Psr16CacheAdapter.php
[edit]
[+]
HealthLake
[+]
StorageGateway
[+]
Polly
[-] MultiRegionClient.php
[edit]
[+]
Honeycode
[+]
MediaStore
[+]
MWAA
[-] CommandPool.php
[edit]
[+]
S3Outposts
[+]
Swf
[+]
Mobile
[+]
ECRPublic
[+]
CognitoIdentityProvider
[+]
ApiGatewayV2
[+]
Backup
[+]
Route53RecoveryReadiness
[+]
IotDataPlane
[+]
CognitoSync
[+]
SnowDeviceManagement
[+]
LookoutMetrics
[-] HashInterface.php
[edit]
[+]
TranscribeService
[-] IdempotencyTokenMiddleware.php
[edit]
[+]
GlobalAccelerator
[+]
LookoutforVision
[+]
ApiGatewayManagementApi
[+]
SageMakerFeatureStoreRuntime
[+]
Cloud9
[+]
MemoryDB
[-] AwsClientTrait.php
[edit]
[+]
Macie2
[-] MonitoringEventsInterface.php
[edit]
[+]
AppRunner
[+]
OpsWorks
[+]
OpsWorksCM
[+]
AuditManager
[+]
Support
[-] TraceMiddleware.php
[edit]
[+]
Lightsail
[-] EndpointParameterMiddleware.php
[edit]
[+]
Arn
[+]
MigrationHub
[+]
Firehose
[+]
CostandUsageReportService
[+]
Credentials
[+]
Sms
[+]
DataPipeline
[+]
QuickSight
[+]
PI
[+]
Outposts
[+]
NetworkManager
[+]
RoboMaker
[+]
FinSpaceData
[+]
MarketplaceCommerceAnalytics
[+]
AppSync
[+]
CodeDeploy
[-] functions.php
[edit]
[+]
TimestreamQuery
[+]
ConnectContactLens
[+]
DirectConnect
[+]
CodeStarconnections
[+]
GuardDuty
[+]
LexRuntimeService
[+]
CognitoIdentity
[+]
ApplicationInsights
[+]
GreengrassV2
[+]
IoTDeviceAdvisor
[+]
WorkSpaces
[+]
ComputeOptimizer
[+]
Comprehend
[+]
Emr
[+]
CloudWatch
[+]
finspace
[+]
DocDB
[+]
IoTSiteWise
[+]
ApiGateway
[+]
Amplify
[+]
Greengrass
[+]
Connect
[+]
ApplicationCostProfiler
[-] PresignUrlMiddleware.php
[edit]
[-] AwsClient.php
[edit]
[+]
Macie
[+]
SagemakerEdgeManager
[+]
CodeStar
[+]
Appflow
[+]
Organizations
[+]
PersonalizeEvents
[+]
GameLift
[+]
KinesisVideo
[+]
Pricing
[+]
PinpointEmail
[-] Result.php
[edit]
[+]
Rds
[-] ResultInterface.php
[edit]
[+]
SageMakerRuntime
[+]
Waf
[+]
MigrationHubConfig
[+]
Translate
[-] WrappedHttpHandler.php
[edit]
[+]
Glacier
[+]
Retry
[+]
Neptune
[+]
AppRegistry
[+]
LexRuntimeV2
[+]
MediaConnect
[+]
SSO
[+]
IoTEventsData
[-] PhpHash.php
[edit]
[+]
CodeStarNotifications
[+]
SecurityHub
[+]
FraudDetector
[+]
Route53
[+]
PersonalizeRuntime
[+]
DataSync
[+]
Textract
[+]
MediaConvert
[+]
Transfer
[+]
LexModelsV2
[-] LruArrayCache.php
[edit]
[-] DoctrineCacheAdapter.php
[edit]
[+]
MediaPackageVod
[+]
S3
[+]
KinesisAnalytics
[+]
ServiceDiscovery
[+]
EKS
[+]
ElasticLoadBalancingV2
[+]
DevOpsGuru
[+]
Sfn