From a5c0a503ef7007945e0016017dc8dad56ed696e6 Mon Sep 17 00:00:00 2001 From: Luc Talatinian <102624213+lucix-aws@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:43:50 -0500 Subject: [PATCH] Restore pre-SRA optionalAuth/no-auth behaviors (#2410) --- .../2efef09a601c4db4a1631723cfe07183.json | 8 + .../a104556111d04ca68b2950f76bd9e9a9.json | 388 ++++++++++++++++++ .../BackfillOptionalAuthTrait.java | 7 +- .../auth/EndpointAuthResolution.java | 2 +- .../auth/GlobalAnonymousOption.java | 110 +++++ ...mithy.go.codegen.integration.GoIntegration | 1 + .../protocoltest/awsrestjson/api_client.go | 2 + internal/protocoltest/awsrestjson/auth.go | 28 ++ internal/protocoltest/ec2query/api_client.go | 2 + internal/protocoltest/ec2query/auth.go | 28 ++ internal/protocoltest/jsonrpc/api_client.go | 2 + internal/protocoltest/jsonrpc/auth.go | 28 ++ internal/protocoltest/jsonrpc10/api_client.go | 2 + internal/protocoltest/jsonrpc10/auth.go | 28 ++ internal/protocoltest/query/api_client.go | 2 + internal/protocoltest/query/auth.go | 28 ++ internal/protocoltest/restxml/api_client.go | 2 + internal/protocoltest/restxml/auth.go | 28 ++ .../restxmlwithnamespace/api_client.go | 2 + .../protocoltest/restxmlwithnamespace/auth.go | 28 ++ service/accessanalyzer/api_client.go | 2 + service/accessanalyzer/auth.go | 28 ++ service/account/api_client.go | 2 + service/account/auth.go | 28 ++ service/acm/api_client.go | 2 + service/acm/auth.go | 28 ++ service/acmpca/api_client.go | 2 + service/acmpca/auth.go | 28 ++ service/alexaforbusiness/api_client.go | 2 + service/alexaforbusiness/auth.go | 28 ++ service/amp/api_client.go | 2 + service/amp/auth.go | 28 ++ service/amplify/api_client.go | 2 + service/amplify/auth.go | 28 ++ service/amplifybackend/api_client.go | 2 + service/amplifybackend/auth.go | 28 ++ service/amplifyuibuilder/api_client.go | 2 + service/amplifyuibuilder/auth.go | 28 ++ service/apigateway/api_client.go | 2 + service/apigateway/auth.go | 28 ++ service/apigatewaymanagementapi/api_client.go | 2 + service/apigatewaymanagementapi/auth.go | 28 ++ service/apigatewayv2/api_client.go | 2 + service/apigatewayv2/auth.go | 28 ++ service/appconfig/api_client.go | 2 + service/appconfig/auth.go | 28 ++ service/appconfigdata/api_client.go | 2 + service/appconfigdata/auth.go | 28 ++ service/appfabric/api_client.go | 2 + service/appfabric/auth.go | 28 ++ service/appflow/api_client.go | 2 + service/appflow/auth.go | 28 ++ service/appintegrations/api_client.go | 2 + service/appintegrations/auth.go | 28 ++ service/applicationautoscaling/api_client.go | 2 + service/applicationautoscaling/auth.go | 28 ++ service/applicationcostprofiler/api_client.go | 2 + service/applicationcostprofiler/auth.go | 28 ++ .../applicationdiscoveryservice/api_client.go | 2 + service/applicationdiscoveryservice/auth.go | 28 ++ service/applicationinsights/api_client.go | 2 + service/applicationinsights/auth.go | 28 ++ service/appmesh/api_client.go | 2 + service/appmesh/auth.go | 28 ++ service/apprunner/api_client.go | 2 + service/apprunner/auth.go | 28 ++ service/appstream/api_client.go | 2 + service/appstream/auth.go | 28 ++ service/appsync/api_client.go | 2 + service/appsync/auth.go | 28 ++ service/arczonalshift/api_client.go | 2 + service/arczonalshift/auth.go | 28 ++ service/athena/api_client.go | 2 + service/athena/auth.go | 28 ++ service/auditmanager/api_client.go | 2 + service/auditmanager/auth.go | 28 ++ service/autoscaling/api_client.go | 2 + service/autoscaling/auth.go | 28 ++ service/autoscalingplans/api_client.go | 2 + service/autoscalingplans/auth.go | 28 ++ service/b2bi/api_client.go | 2 + service/b2bi/auth.go | 28 ++ service/backup/api_client.go | 2 + service/backup/auth.go | 28 ++ service/backupgateway/api_client.go | 2 + service/backupgateway/auth.go | 28 ++ service/backupstorage/api_client.go | 2 + service/backupstorage/auth.go | 28 ++ service/batch/api_client.go | 2 + service/batch/auth.go | 28 ++ service/bcmdataexports/api_client.go | 2 + service/bcmdataexports/auth.go | 28 ++ service/bedrock/api_client.go | 2 + service/bedrock/auth.go | 28 ++ service/bedrockagent/api_client.go | 2 + service/bedrockagent/auth.go | 28 ++ service/bedrockagentruntime/api_client.go | 2 + service/bedrockagentruntime/auth.go | 28 ++ service/bedrockruntime/api_client.go | 2 + service/bedrockruntime/auth.go | 28 ++ service/billingconductor/api_client.go | 2 + service/billingconductor/auth.go | 28 ++ service/braket/api_client.go | 2 + service/braket/auth.go | 28 ++ service/budgets/api_client.go | 2 + service/budgets/auth.go | 28 ++ service/chime/api_client.go | 2 + service/chime/auth.go | 28 ++ service/chimesdkidentity/api_client.go | 2 + service/chimesdkidentity/auth.go | 28 ++ service/chimesdkmediapipelines/api_client.go | 2 + service/chimesdkmediapipelines/auth.go | 28 ++ service/chimesdkmeetings/api_client.go | 2 + service/chimesdkmeetings/auth.go | 28 ++ service/chimesdkmessaging/api_client.go | 2 + service/chimesdkmessaging/auth.go | 28 ++ service/chimesdkvoice/api_client.go | 2 + service/chimesdkvoice/auth.go | 28 ++ service/cleanrooms/api_client.go | 2 + service/cleanrooms/auth.go | 28 ++ service/cleanroomsml/api_client.go | 2 + service/cleanroomsml/auth.go | 28 ++ service/cloud9/api_client.go | 2 + service/cloud9/auth.go | 28 ++ service/cloudcontrol/api_client.go | 2 + service/cloudcontrol/auth.go | 28 ++ service/clouddirectory/api_client.go | 2 + service/clouddirectory/auth.go | 28 ++ service/cloudformation/api_client.go | 2 + service/cloudformation/auth.go | 28 ++ service/cloudfront/api_client.go | 2 + service/cloudfront/auth.go | 28 ++ service/cloudfrontkeyvaluestore/api_client.go | 2 + service/cloudfrontkeyvaluestore/auth.go | 28 ++ service/cloudhsm/api_client.go | 2 + service/cloudhsm/auth.go | 28 ++ service/cloudhsmv2/api_client.go | 2 + service/cloudhsmv2/auth.go | 28 ++ service/cloudsearch/api_client.go | 2 + service/cloudsearch/auth.go | 28 ++ service/cloudsearchdomain/api_client.go | 2 + service/cloudsearchdomain/auth.go | 28 ++ service/cloudtrail/api_client.go | 2 + service/cloudtrail/auth.go | 28 ++ service/cloudtraildata/api_client.go | 2 + service/cloudtraildata/auth.go | 28 ++ service/cloudwatch/api_client.go | 2 + service/cloudwatch/auth.go | 28 ++ service/cloudwatchevents/api_client.go | 2 + service/cloudwatchevents/auth.go | 28 ++ service/cloudwatchlogs/api_client.go | 2 + service/cloudwatchlogs/auth.go | 28 ++ service/codeartifact/api_client.go | 2 + service/codeartifact/auth.go | 28 ++ service/codebuild/api_client.go | 2 + service/codebuild/auth.go | 28 ++ service/codecatalyst/api_client.go | 2 + service/codecatalyst/auth.go | 28 ++ service/codecommit/api_client.go | 2 + service/codecommit/auth.go | 28 ++ service/codedeploy/api_client.go | 2 + service/codedeploy/auth.go | 28 ++ service/codeguruprofiler/api_client.go | 2 + service/codeguruprofiler/auth.go | 28 ++ service/codegurureviewer/api_client.go | 2 + service/codegurureviewer/auth.go | 28 ++ service/codegurusecurity/api_client.go | 2 + service/codegurusecurity/auth.go | 28 ++ service/codepipeline/api_client.go | 2 + service/codepipeline/auth.go | 28 ++ service/codestar/api_client.go | 2 + service/codestar/auth.go | 28 ++ service/codestarconnections/api_client.go | 2 + service/codestarconnections/auth.go | 28 ++ service/codestarnotifications/api_client.go | 2 + service/codestarnotifications/auth.go | 28 ++ service/cognitoidentity/api_client.go | 2 + service/cognitoidentity/auth.go | 28 ++ service/cognitoidentityprovider/api_client.go | 2 + service/cognitoidentityprovider/auth.go | 28 ++ service/cognitosync/api_client.go | 2 + service/cognitosync/auth.go | 28 ++ service/comprehend/api_client.go | 2 + service/comprehend/auth.go | 28 ++ service/comprehendmedical/api_client.go | 2 + service/comprehendmedical/auth.go | 28 ++ service/computeoptimizer/api_client.go | 2 + service/computeoptimizer/auth.go | 28 ++ service/configservice/api_client.go | 2 + service/configservice/auth.go | 28 ++ service/connect/api_client.go | 2 + service/connect/auth.go | 28 ++ service/connectcampaigns/api_client.go | 2 + service/connectcampaigns/auth.go | 28 ++ service/connectcases/api_client.go | 2 + service/connectcases/auth.go | 28 ++ service/connectcontactlens/api_client.go | 2 + service/connectcontactlens/auth.go | 28 ++ service/connectparticipant/api_client.go | 2 + service/connectparticipant/auth.go | 28 ++ service/controltower/api_client.go | 2 + service/controltower/auth.go | 28 ++ .../costandusagereportservice/api_client.go | 2 + service/costandusagereportservice/auth.go | 28 ++ service/costexplorer/api_client.go | 2 + service/costexplorer/auth.go | 28 ++ service/costoptimizationhub/api_client.go | 2 + service/costoptimizationhub/auth.go | 28 ++ service/customerprofiles/api_client.go | 2 + service/customerprofiles/auth.go | 28 ++ .../databasemigrationservice/api_client.go | 2 + service/databasemigrationservice/auth.go | 28 ++ service/databrew/api_client.go | 2 + service/databrew/auth.go | 28 ++ service/dataexchange/api_client.go | 2 + service/dataexchange/auth.go | 28 ++ service/datapipeline/api_client.go | 2 + service/datapipeline/auth.go | 28 ++ service/datasync/api_client.go | 2 + service/datasync/auth.go | 28 ++ service/datazone/api_client.go | 2 + service/datazone/auth.go | 28 ++ service/dax/api_client.go | 2 + service/dax/auth.go | 28 ++ service/detective/api_client.go | 2 + service/detective/auth.go | 28 ++ service/devicefarm/api_client.go | 2 + service/devicefarm/auth.go | 28 ++ service/devopsguru/api_client.go | 2 + service/devopsguru/auth.go | 28 ++ service/directconnect/api_client.go | 2 + service/directconnect/auth.go | 28 ++ service/directoryservice/api_client.go | 2 + service/directoryservice/auth.go | 28 ++ service/dlm/api_client.go | 2 + service/dlm/auth.go | 28 ++ service/docdb/api_client.go | 2 + service/docdb/auth.go | 28 ++ service/docdbelastic/api_client.go | 2 + service/docdbelastic/auth.go | 28 ++ service/drs/api_client.go | 2 + service/drs/auth.go | 28 ++ service/dynamodb/api_client.go | 2 + service/dynamodb/auth.go | 28 ++ service/dynamodbstreams/api_client.go | 2 + service/dynamodbstreams/auth.go | 28 ++ service/ebs/api_client.go | 2 + service/ebs/auth.go | 28 ++ service/ec2/api_client.go | 2 + service/ec2/auth.go | 28 ++ service/ec2instanceconnect/api_client.go | 2 + service/ec2instanceconnect/auth.go | 28 ++ service/ecr/api_client.go | 2 + service/ecr/auth.go | 28 ++ service/ecrpublic/api_client.go | 2 + service/ecrpublic/auth.go | 28 ++ service/ecs/api_client.go | 2 + service/ecs/auth.go | 28 ++ service/efs/api_client.go | 2 + service/efs/auth.go | 28 ++ service/eks/api_client.go | 2 + service/eks/auth.go | 28 ++ service/eksauth/api_client.go | 2 + service/eksauth/auth.go | 28 ++ service/elasticache/api_client.go | 2 + service/elasticache/auth.go | 28 ++ service/elasticbeanstalk/api_client.go | 2 + service/elasticbeanstalk/auth.go | 28 ++ service/elasticinference/api_client.go | 2 + service/elasticinference/auth.go | 28 ++ service/elasticloadbalancing/api_client.go | 2 + service/elasticloadbalancing/auth.go | 28 ++ service/elasticloadbalancingv2/api_client.go | 2 + service/elasticloadbalancingv2/auth.go | 28 ++ service/elasticsearchservice/api_client.go | 2 + service/elasticsearchservice/auth.go | 28 ++ service/elastictranscoder/api_client.go | 2 + service/elastictranscoder/auth.go | 28 ++ service/emr/api_client.go | 2 + service/emr/auth.go | 28 ++ service/emrcontainers/api_client.go | 2 + service/emrcontainers/auth.go | 28 ++ service/emrserverless/api_client.go | 2 + service/emrserverless/auth.go | 28 ++ service/entityresolution/api_client.go | 2 + service/entityresolution/auth.go | 28 ++ service/eventbridge/auth.go | 28 ++ service/eventbridge/endpoint_auth_resolver.go | 16 + service/evidently/api_client.go | 2 + service/evidently/auth.go | 28 ++ service/finspace/api_client.go | 2 + service/finspace/auth.go | 28 ++ service/finspacedata/api_client.go | 2 + service/finspacedata/auth.go | 28 ++ service/firehose/api_client.go | 2 + service/firehose/auth.go | 28 ++ service/fis/api_client.go | 2 + service/fis/auth.go | 28 ++ service/fms/api_client.go | 2 + service/fms/auth.go | 28 ++ service/forecast/api_client.go | 2 + service/forecast/auth.go | 28 ++ service/forecastquery/api_client.go | 2 + service/forecastquery/auth.go | 28 ++ service/frauddetector/api_client.go | 2 + service/frauddetector/auth.go | 28 ++ service/freetier/api_client.go | 2 + service/freetier/auth.go | 28 ++ service/fsx/api_client.go | 2 + service/fsx/auth.go | 28 ++ service/gamelift/api_client.go | 2 + service/gamelift/auth.go | 28 ++ service/glacier/api_client.go | 2 + service/glacier/auth.go | 28 ++ service/globalaccelerator/api_client.go | 2 + service/globalaccelerator/auth.go | 28 ++ service/glue/api_client.go | 2 + service/glue/auth.go | 28 ++ service/grafana/api_client.go | 2 + service/grafana/auth.go | 28 ++ service/greengrass/api_client.go | 2 + service/greengrass/auth.go | 28 ++ service/greengrassv2/api_client.go | 2 + service/greengrassv2/auth.go | 28 ++ service/groundstation/api_client.go | 2 + service/groundstation/auth.go | 28 ++ service/guardduty/api_client.go | 2 + service/guardduty/auth.go | 28 ++ service/health/api_client.go | 2 + service/health/auth.go | 28 ++ service/healthlake/api_client.go | 2 + service/healthlake/auth.go | 28 ++ service/honeycode/api_client.go | 2 + service/honeycode/auth.go | 28 ++ service/iam/api_client.go | 2 + service/iam/auth.go | 28 ++ service/identitystore/api_client.go | 2 + service/identitystore/auth.go | 28 ++ service/imagebuilder/api_client.go | 2 + service/imagebuilder/auth.go | 28 ++ service/inspector/api_client.go | 2 + service/inspector/auth.go | 28 ++ service/inspector2/api_client.go | 2 + service/inspector2/auth.go | 28 ++ service/inspectorscan/api_client.go | 2 + service/inspectorscan/auth.go | 28 ++ service/internetmonitor/api_client.go | 2 + service/internetmonitor/auth.go | 28 ++ service/iot/api_client.go | 2 + service/iot/auth.go | 28 ++ service/iot1clickdevicesservice/api_client.go | 2 + service/iot1clickdevicesservice/auth.go | 28 ++ service/iot1clickprojects/api_client.go | 2 + service/iot1clickprojects/auth.go | 28 ++ service/iotanalytics/api_client.go | 2 + service/iotanalytics/auth.go | 28 ++ service/iotdataplane/api_client.go | 2 + service/iotdataplane/auth.go | 28 ++ service/iotdeviceadvisor/api_client.go | 2 + service/iotdeviceadvisor/auth.go | 28 ++ service/iotevents/api_client.go | 2 + service/iotevents/auth.go | 28 ++ service/ioteventsdata/api_client.go | 2 + service/ioteventsdata/auth.go | 28 ++ service/iotfleethub/api_client.go | 2 + service/iotfleethub/auth.go | 28 ++ service/iotfleetwise/api_client.go | 2 + service/iotfleetwise/auth.go | 28 ++ service/iotjobsdataplane/api_client.go | 2 + service/iotjobsdataplane/auth.go | 28 ++ service/iotroborunner/api_client.go | 2 + service/iotroborunner/auth.go | 28 ++ service/iotsecuretunneling/api_client.go | 2 + service/iotsecuretunneling/auth.go | 28 ++ service/iotsitewise/api_client.go | 2 + service/iotsitewise/auth.go | 28 ++ service/iotthingsgraph/api_client.go | 2 + service/iotthingsgraph/auth.go | 28 ++ service/iottwinmaker/api_client.go | 2 + service/iottwinmaker/auth.go | 28 ++ service/iotwireless/api_client.go | 2 + service/iotwireless/auth.go | 28 ++ service/ivs/api_client.go | 2 + service/ivs/auth.go | 28 ++ service/ivschat/api_client.go | 2 + service/ivschat/auth.go | 28 ++ service/ivsrealtime/api_client.go | 2 + service/ivsrealtime/auth.go | 28 ++ service/kafka/api_client.go | 2 + service/kafka/auth.go | 28 ++ service/kafkaconnect/api_client.go | 2 + service/kafkaconnect/auth.go | 28 ++ service/kendra/api_client.go | 2 + service/kendra/auth.go | 28 ++ service/kendraranking/api_client.go | 2 + service/kendraranking/auth.go | 28 ++ service/keyspaces/api_client.go | 2 + service/keyspaces/auth.go | 28 ++ service/kinesis/api_client.go | 2 + service/kinesis/auth.go | 28 ++ service/kinesisanalytics/api_client.go | 2 + service/kinesisanalytics/auth.go | 28 ++ service/kinesisanalyticsv2/api_client.go | 2 + service/kinesisanalyticsv2/auth.go | 28 ++ service/kinesisvideo/api_client.go | 2 + service/kinesisvideo/auth.go | 28 ++ .../kinesisvideoarchivedmedia/api_client.go | 2 + service/kinesisvideoarchivedmedia/auth.go | 28 ++ service/kinesisvideomedia/api_client.go | 2 + service/kinesisvideomedia/auth.go | 28 ++ service/kinesisvideosignaling/api_client.go | 2 + service/kinesisvideosignaling/auth.go | 28 ++ .../kinesisvideowebrtcstorage/api_client.go | 2 + service/kinesisvideowebrtcstorage/auth.go | 28 ++ service/kms/api_client.go | 2 + service/kms/auth.go | 28 ++ service/lakeformation/api_client.go | 2 + service/lakeformation/auth.go | 28 ++ service/lambda/api_client.go | 2 + service/lambda/auth.go | 28 ++ service/launchwizard/api_client.go | 2 + service/launchwizard/auth.go | 28 ++ service/lexmodelbuildingservice/api_client.go | 2 + service/lexmodelbuildingservice/auth.go | 28 ++ service/lexmodelsv2/api_client.go | 2 + service/lexmodelsv2/auth.go | 28 ++ service/lexruntimeservice/api_client.go | 2 + service/lexruntimeservice/auth.go | 28 ++ service/lexruntimev2/api_client.go | 2 + service/lexruntimev2/auth.go | 28 ++ service/licensemanager/api_client.go | 2 + service/licensemanager/auth.go | 28 ++ .../api_client.go | 2 + .../licensemanagerlinuxsubscriptions/auth.go | 28 ++ .../api_client.go | 2 + .../licensemanagerusersubscriptions/auth.go | 28 ++ service/lightsail/api_client.go | 2 + service/lightsail/auth.go | 28 ++ service/location/api_client.go | 2 + service/location/auth.go | 28 ++ service/lookoutequipment/api_client.go | 2 + service/lookoutequipment/auth.go | 28 ++ service/lookoutmetrics/api_client.go | 2 + service/lookoutmetrics/auth.go | 28 ++ service/lookoutvision/api_client.go | 2 + service/lookoutvision/auth.go | 28 ++ service/m2/api_client.go | 2 + service/m2/auth.go | 28 ++ service/machinelearning/api_client.go | 2 + service/machinelearning/auth.go | 28 ++ service/macie2/api_client.go | 2 + service/macie2/auth.go | 28 ++ service/managedblockchain/api_client.go | 2 + service/managedblockchain/auth.go | 28 ++ service/managedblockchainquery/api_client.go | 2 + service/managedblockchainquery/auth.go | 28 ++ service/marketplaceagreement/api_client.go | 2 + service/marketplaceagreement/auth.go | 28 ++ service/marketplacecatalog/api_client.go | 2 + service/marketplacecatalog/auth.go | 28 ++ .../api_client.go | 2 + service/marketplacecommerceanalytics/auth.go | 28 ++ service/marketplacedeployment/api_client.go | 2 + service/marketplacedeployment/auth.go | 28 ++ .../api_client.go | 2 + service/marketplaceentitlementservice/auth.go | 28 ++ service/marketplacemetering/api_client.go | 2 + service/marketplacemetering/auth.go | 28 ++ service/mediaconnect/api_client.go | 2 + service/mediaconnect/auth.go | 28 ++ service/mediaconvert/api_client.go | 2 + service/mediaconvert/auth.go | 28 ++ service/medialive/api_client.go | 2 + service/medialive/auth.go | 28 ++ service/mediapackage/api_client.go | 2 + service/mediapackage/auth.go | 28 ++ service/mediapackagev2/api_client.go | 2 + service/mediapackagev2/auth.go | 28 ++ service/mediapackagevod/api_client.go | 2 + service/mediapackagevod/auth.go | 28 ++ service/mediastore/api_client.go | 2 + service/mediastore/auth.go | 28 ++ service/mediastoredata/api_client.go | 2 + service/mediastoredata/auth.go | 28 ++ service/mediatailor/api_client.go | 2 + service/mediatailor/auth.go | 28 ++ service/medicalimaging/api_client.go | 2 + service/medicalimaging/auth.go | 28 ++ service/memorydb/api_client.go | 2 + service/memorydb/auth.go | 28 ++ service/mgn/api_client.go | 2 + service/mgn/auth.go | 28 ++ service/migrationhub/api_client.go | 2 + service/migrationhub/auth.go | 28 ++ service/migrationhubconfig/api_client.go | 2 + service/migrationhubconfig/auth.go | 28 ++ .../migrationhuborchestrator/api_client.go | 2 + service/migrationhuborchestrator/auth.go | 28 ++ .../migrationhubrefactorspaces/api_client.go | 2 + service/migrationhubrefactorspaces/auth.go | 28 ++ service/migrationhubstrategy/api_client.go | 2 + service/migrationhubstrategy/auth.go | 28 ++ service/mobile/api_client.go | 2 + service/mobile/auth.go | 28 ++ service/mq/api_client.go | 2 + service/mq/auth.go | 28 ++ service/mturk/api_client.go | 2 + service/mturk/auth.go | 28 ++ service/mwaa/api_client.go | 2 + service/mwaa/auth.go | 28 ++ service/neptune/api_client.go | 2 + service/neptune/auth.go | 28 ++ service/neptunedata/api_client.go | 2 + service/neptunedata/auth.go | 28 ++ service/networkfirewall/api_client.go | 2 + service/networkfirewall/auth.go | 28 ++ service/networkmanager/api_client.go | 2 + service/networkmanager/auth.go | 28 ++ service/nimble/api_client.go | 2 + service/nimble/auth.go | 28 ++ service/oam/api_client.go | 2 + service/oam/auth.go | 28 ++ service/omics/api_client.go | 2 + service/omics/auth.go | 28 ++ service/opensearch/api_client.go | 2 + service/opensearch/auth.go | 28 ++ service/opensearchserverless/api_client.go | 2 + service/opensearchserverless/auth.go | 28 ++ service/opsworks/api_client.go | 2 + service/opsworks/auth.go | 28 ++ service/opsworkscm/api_client.go | 2 + service/opsworkscm/auth.go | 28 ++ service/organizations/api_client.go | 2 + service/organizations/auth.go | 28 ++ service/osis/api_client.go | 2 + service/osis/auth.go | 28 ++ service/outposts/api_client.go | 2 + service/outposts/auth.go | 28 ++ service/panorama/api_client.go | 2 + service/panorama/auth.go | 28 ++ service/paymentcryptography/api_client.go | 2 + service/paymentcryptography/auth.go | 28 ++ service/paymentcryptographydata/api_client.go | 2 + service/paymentcryptographydata/auth.go | 28 ++ service/pcaconnectorad/api_client.go | 2 + service/pcaconnectorad/auth.go | 28 ++ service/personalize/api_client.go | 2 + service/personalize/auth.go | 28 ++ service/personalizeevents/api_client.go | 2 + service/personalizeevents/auth.go | 28 ++ service/personalizeruntime/api_client.go | 2 + service/personalizeruntime/auth.go | 28 ++ service/pi/api_client.go | 2 + service/pi/auth.go | 28 ++ service/pinpoint/api_client.go | 2 + service/pinpoint/auth.go | 28 ++ service/pinpointemail/api_client.go | 2 + service/pinpointemail/auth.go | 28 ++ service/pinpointsmsvoice/api_client.go | 2 + service/pinpointsmsvoice/auth.go | 28 ++ service/pinpointsmsvoicev2/api_client.go | 2 + service/pinpointsmsvoicev2/auth.go | 28 ++ service/pipes/api_client.go | 2 + service/pipes/auth.go | 28 ++ service/polly/api_client.go | 2 + service/polly/auth.go | 28 ++ service/pricing/api_client.go | 2 + service/pricing/auth.go | 28 ++ service/privatenetworks/api_client.go | 2 + service/privatenetworks/auth.go | 28 ++ service/proton/api_client.go | 2 + service/proton/auth.go | 28 ++ service/qbusiness/api_client.go | 2 + service/qbusiness/auth.go | 28 ++ service/qconnect/api_client.go | 2 + service/qconnect/auth.go | 28 ++ service/qldb/api_client.go | 2 + service/qldb/auth.go | 28 ++ service/qldbsession/api_client.go | 2 + service/qldbsession/auth.go | 28 ++ service/quicksight/api_client.go | 2 + service/quicksight/auth.go | 28 ++ service/ram/api_client.go | 2 + service/ram/auth.go | 28 ++ service/rbin/api_client.go | 2 + service/rbin/auth.go | 28 ++ service/rds/api_client.go | 2 + service/rds/auth.go | 28 ++ service/rdsdata/api_client.go | 2 + service/rdsdata/auth.go | 28 ++ service/redshift/api_client.go | 2 + service/redshift/auth.go | 28 ++ service/redshiftdata/api_client.go | 2 + service/redshiftdata/auth.go | 28 ++ service/redshiftserverless/api_client.go | 2 + service/redshiftserverless/auth.go | 28 ++ service/rekognition/api_client.go | 2 + service/rekognition/auth.go | 28 ++ service/repostspace/api_client.go | 2 + service/repostspace/auth.go | 28 ++ service/resiliencehub/api_client.go | 2 + service/resiliencehub/auth.go | 28 ++ service/resourceexplorer2/api_client.go | 2 + service/resourceexplorer2/auth.go | 28 ++ service/resourcegroups/api_client.go | 2 + service/resourcegroups/auth.go | 28 ++ .../resourcegroupstaggingapi/api_client.go | 2 + service/resourcegroupstaggingapi/auth.go | 28 ++ service/robomaker/api_client.go | 2 + service/robomaker/auth.go | 28 ++ service/rolesanywhere/api_client.go | 2 + service/rolesanywhere/auth.go | 28 ++ service/route53/api_client.go | 2 + service/route53/auth.go | 28 ++ service/route53domains/api_client.go | 2 + service/route53domains/auth.go | 28 ++ service/route53recoverycluster/api_client.go | 2 + service/route53recoverycluster/auth.go | 28 ++ .../api_client.go | 2 + service/route53recoverycontrolconfig/auth.go | 28 ++ .../route53recoveryreadiness/api_client.go | 2 + service/route53recoveryreadiness/auth.go | 28 ++ service/route53resolver/api_client.go | 2 + service/route53resolver/auth.go | 28 ++ service/rum/api_client.go | 2 + service/rum/auth.go | 28 ++ service/s3/auth.go | 28 ++ service/s3/endpoint_auth_resolver.go | 2 +- service/s3control/api_client.go | 2 + service/s3control/auth.go | 28 ++ service/s3outposts/api_client.go | 2 + service/s3outposts/auth.go | 28 ++ service/sagemaker/api_client.go | 2 + service/sagemaker/auth.go | 28 ++ service/sagemakera2iruntime/api_client.go | 2 + service/sagemakera2iruntime/auth.go | 28 ++ service/sagemakeredge/api_client.go | 2 + service/sagemakeredge/auth.go | 28 ++ .../api_client.go | 2 + service/sagemakerfeaturestoreruntime/auth.go | 28 ++ service/sagemakergeospatial/api_client.go | 2 + service/sagemakergeospatial/auth.go | 28 ++ service/sagemakermetrics/api_client.go | 2 + service/sagemakermetrics/auth.go | 28 ++ service/sagemakerruntime/api_client.go | 2 + service/sagemakerruntime/auth.go | 28 ++ service/savingsplans/api_client.go | 2 + service/savingsplans/auth.go | 28 ++ service/scheduler/api_client.go | 2 + service/scheduler/auth.go | 28 ++ service/schemas/api_client.go | 2 + service/schemas/auth.go | 28 ++ service/secretsmanager/api_client.go | 2 + service/secretsmanager/auth.go | 28 ++ service/securityhub/api_client.go | 2 + service/securityhub/auth.go | 28 ++ service/securitylake/api_client.go | 2 + service/securitylake/auth.go | 28 ++ .../api_client.go | 2 + .../serverlessapplicationrepository/auth.go | 28 ++ service/servicecatalog/api_client.go | 2 + service/servicecatalog/auth.go | 28 ++ .../servicecatalogappregistry/api_client.go | 2 + service/servicecatalogappregistry/auth.go | 28 ++ service/servicediscovery/api_client.go | 2 + service/servicediscovery/auth.go | 28 ++ service/servicequotas/api_client.go | 2 + service/servicequotas/auth.go | 28 ++ service/ses/api_client.go | 2 + service/ses/auth.go | 28 ++ service/sesv2/api_client.go | 2 + service/sesv2/auth.go | 28 ++ service/sfn/api_client.go | 2 + service/sfn/auth.go | 28 ++ service/shield/api_client.go | 2 + service/shield/auth.go | 28 ++ service/signer/api_client.go | 2 + service/signer/auth.go | 28 ++ service/simspaceweaver/api_client.go | 2 + service/simspaceweaver/auth.go | 28 ++ service/sms/api_client.go | 2 + service/sms/auth.go | 28 ++ service/snowball/api_client.go | 2 + service/snowball/auth.go | 28 ++ service/snowdevicemanagement/api_client.go | 2 + service/snowdevicemanagement/auth.go | 28 ++ service/sns/api_client.go | 2 + service/sns/auth.go | 28 ++ service/sqs/api_client.go | 2 + service/sqs/auth.go | 28 ++ service/ssm/api_client.go | 2 + service/ssm/auth.go | 28 ++ service/ssmcontacts/api_client.go | 2 + service/ssmcontacts/auth.go | 28 ++ service/ssmincidents/api_client.go | 2 + service/ssmincidents/auth.go | 28 ++ service/ssmsap/api_client.go | 2 + service/ssmsap/auth.go | 28 ++ service/sso/api_client.go | 2 + service/sso/auth.go | 28 ++ service/ssoadmin/api_client.go | 2 + service/ssoadmin/auth.go | 28 ++ service/ssooidc/api_client.go | 2 + service/ssooidc/auth.go | 28 ++ service/storagegateway/api_client.go | 2 + service/storagegateway/auth.go | 28 ++ service/sts/api_client.go | 2 + service/sts/auth.go | 50 ++- service/support/api_client.go | 2 + service/support/auth.go | 28 ++ service/supportapp/api_client.go | 2 + service/supportapp/auth.go | 28 ++ service/swf/api_client.go | 2 + service/swf/auth.go | 28 ++ service/synthetics/api_client.go | 2 + service/synthetics/auth.go | 28 ++ service/textract/api_client.go | 2 + service/textract/auth.go | 28 ++ service/timestreamquery/api_client.go | 2 + service/timestreamquery/auth.go | 28 ++ service/timestreamwrite/api_client.go | 2 + service/timestreamwrite/auth.go | 28 ++ service/tnb/api_client.go | 2 + service/tnb/auth.go | 28 ++ service/transcribe/api_client.go | 2 + service/transcribe/auth.go | 28 ++ service/transcribestreaming/api_client.go | 2 + service/transcribestreaming/auth.go | 28 ++ service/transfer/api_client.go | 2 + service/transfer/auth.go | 28 ++ service/translate/api_client.go | 2 + service/translate/auth.go | 28 ++ service/trustedadvisor/api_client.go | 2 + service/trustedadvisor/auth.go | 28 ++ service/verifiedpermissions/api_client.go | 2 + service/verifiedpermissions/auth.go | 28 ++ service/voiceid/api_client.go | 2 + service/voiceid/auth.go | 28 ++ service/vpclattice/api_client.go | 2 + service/vpclattice/auth.go | 28 ++ service/waf/api_client.go | 2 + service/waf/auth.go | 28 ++ service/wafregional/api_client.go | 2 + service/wafregional/auth.go | 28 ++ service/wafv2/api_client.go | 2 + service/wafv2/auth.go | 28 ++ service/wellarchitected/api_client.go | 2 + service/wellarchitected/auth.go | 28 ++ service/wisdom/api_client.go | 2 + service/wisdom/auth.go | 28 ++ service/workdocs/api_client.go | 2 + service/workdocs/auth.go | 28 ++ service/worklink/api_client.go | 2 + service/worklink/auth.go | 28 ++ service/workmail/api_client.go | 2 + service/workmail/auth.go | 28 ++ service/workmailmessageflow/api_client.go | 2 + service/workmailmessageflow/auth.go | 28 ++ service/workspaces/api_client.go | 2 + service/workspaces/auth.go | 28 ++ service/workspacesthinclient/api_client.go | 2 + service/workspacesthinclient/auth.go | 28 ++ service/workspacesweb/api_client.go | 2 + service/workspacesweb/auth.go | 28 ++ service/xray/api_client.go | 2 + service/xray/auth.go | 28 ++ 766 files changed, 11927 insertions(+), 25 deletions(-) create mode 100644 .changelog/2efef09a601c4db4a1631723cfe07183.json create mode 100644 .changelog/a104556111d04ca68b2950f76bd9e9a9.json create mode 100644 codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/GlobalAnonymousOption.java diff --git a/.changelog/2efef09a601c4db4a1631723cfe07183.json b/.changelog/2efef09a601c4db4a1631723cfe07183.json new file mode 100644 index 00000000000..c2d2dcf2f65 --- /dev/null +++ b/.changelog/2efef09a601c4db4a1631723cfe07183.json @@ -0,0 +1,8 @@ +{ + "id": "2efef09a-601c-4db4-a163-1723cfe07183", + "type": "bugfix", + "description": "STS `AssumeRoleWithSAML` and `AssumeRoleWithWebIdentity` would incorrectly attempt to use SigV4 authentication.", + "modules": [ + "service/sts" + ] +} \ No newline at end of file diff --git a/.changelog/a104556111d04ca68b2950f76bd9e9a9.json b/.changelog/a104556111d04ca68b2950f76bd9e9a9.json new file mode 100644 index 00000000000..6ddd6f29c99 --- /dev/null +++ b/.changelog/a104556111d04ca68b2950f76bd9e9a9.json @@ -0,0 +1,388 @@ +{ + "id": "a1045561-11d0-4ca6-8b29-50f76bd9e9a9", + "type": "bugfix", + "collapse": true, + "description": "Restore pre-refactor auth behavior where all operations could technically be performed anonymously.", + "modules": [ + "internal/protocoltest/awsrestjson", + "internal/protocoltest/ec2query", + "internal/protocoltest/jsonrpc", + "internal/protocoltest/jsonrpc10", + "internal/protocoltest/query", + "internal/protocoltest/restxml", + "internal/protocoltest/restxmlwithnamespace", + "service/accessanalyzer", + "service/account", + "service/acm", + "service/acmpca", + "service/alexaforbusiness", + "service/amp", + "service/amplify", + "service/amplifybackend", + "service/amplifyuibuilder", + "service/apigateway", + "service/apigatewaymanagementapi", + "service/apigatewayv2", + "service/appconfig", + "service/appconfigdata", + "service/appfabric", + "service/appflow", + "service/appintegrations", + "service/applicationautoscaling", + "service/applicationcostprofiler", + "service/applicationdiscoveryservice", + "service/applicationinsights", + "service/appmesh", + "service/apprunner", + "service/appstream", + "service/appsync", + "service/arczonalshift", + "service/athena", + "service/auditmanager", + "service/autoscaling", + "service/autoscalingplans", + "service/b2bi", + "service/backup", + "service/backupgateway", + "service/backupstorage", + "service/batch", + "service/bcmdataexports", + "service/bedrock", + "service/bedrockagent", + "service/bedrockagentruntime", + "service/bedrockruntime", + "service/billingconductor", + "service/braket", + "service/budgets", + "service/chime", + "service/chimesdkidentity", + "service/chimesdkmediapipelines", + "service/chimesdkmeetings", + "service/chimesdkmessaging", + "service/chimesdkvoice", + "service/cleanrooms", + "service/cleanroomsml", + "service/cloud9", + "service/cloudcontrol", + "service/clouddirectory", + "service/cloudformation", + "service/cloudfront", + "service/cloudfrontkeyvaluestore", + "service/cloudhsm", + "service/cloudhsmv2", + "service/cloudsearch", + "service/cloudsearchdomain", + "service/cloudtrail", + "service/cloudtraildata", + "service/cloudwatch", + "service/cloudwatchevents", + "service/cloudwatchlogs", + "service/codeartifact", + "service/codebuild", + "service/codecatalyst", + "service/codecommit", + "service/codedeploy", + "service/codeguruprofiler", + "service/codegurureviewer", + "service/codegurusecurity", + "service/codepipeline", + "service/codestar", + "service/codestarconnections", + "service/codestarnotifications", + "service/cognitoidentity", + "service/cognitoidentityprovider", + "service/cognitosync", + "service/comprehend", + "service/comprehendmedical", + "service/computeoptimizer", + "service/configservice", + "service/connect", + "service/connectcampaigns", + "service/connectcases", + "service/connectcontactlens", + "service/connectparticipant", + "service/controltower", + "service/costandusagereportservice", + "service/costexplorer", + "service/costoptimizationhub", + "service/customerprofiles", + "service/databasemigrationservice", + "service/databrew", + "service/dataexchange", + "service/datapipeline", + "service/datasync", + "service/datazone", + "service/dax", + "service/detective", + "service/devicefarm", + "service/devopsguru", + "service/directconnect", + "service/directoryservice", + "service/dlm", + "service/docdb", + "service/docdbelastic", + "service/drs", + "service/dynamodb", + "service/dynamodbstreams", + "service/ebs", + "service/ec2", + "service/ec2instanceconnect", + "service/ecr", + "service/ecrpublic", + "service/ecs", + "service/efs", + "service/eks", + "service/eksauth", + "service/elasticache", + "service/elasticbeanstalk", + "service/elasticinference", + "service/elasticloadbalancing", + "service/elasticloadbalancingv2", + "service/elasticsearchservice", + "service/elastictranscoder", + "service/emr", + "service/emrcontainers", + "service/emrserverless", + "service/entityresolution", + "service/eventbridge", + "service/evidently", + "service/finspace", + "service/finspacedata", + "service/firehose", + "service/fis", + "service/fms", + "service/forecast", + "service/forecastquery", + "service/frauddetector", + "service/freetier", + "service/fsx", + "service/gamelift", + "service/glacier", + "service/globalaccelerator", + "service/glue", + "service/grafana", + "service/greengrass", + "service/greengrassv2", + "service/groundstation", + "service/guardduty", + "service/health", + "service/healthlake", + "service/honeycode", + "service/iam", + "service/identitystore", + "service/imagebuilder", + "service/inspector", + "service/inspector2", + "service/inspectorscan", + "service/internetmonitor", + "service/iot", + "service/iot1clickdevicesservice", + "service/iot1clickprojects", + "service/iotanalytics", + "service/iotdataplane", + "service/iotdeviceadvisor", + "service/iotevents", + "service/ioteventsdata", + "service/iotfleethub", + "service/iotfleetwise", + "service/iotjobsdataplane", + "service/iotroborunner", + "service/iotsecuretunneling", + "service/iotsitewise", + "service/iotthingsgraph", + "service/iottwinmaker", + "service/iotwireless", + "service/ivs", + "service/ivschat", + "service/ivsrealtime", + "service/kafka", + "service/kafkaconnect", + "service/kendra", + "service/kendraranking", + "service/keyspaces", + "service/kinesis", + "service/kinesisanalytics", + "service/kinesisanalyticsv2", + "service/kinesisvideo", + "service/kinesisvideoarchivedmedia", + "service/kinesisvideomedia", + "service/kinesisvideosignaling", + "service/kinesisvideowebrtcstorage", + "service/kms", + "service/lakeformation", + "service/lambda", + "service/launchwizard", + "service/lexmodelbuildingservice", + "service/lexmodelsv2", + "service/lexruntimeservice", + "service/lexruntimev2", + "service/licensemanager", + "service/licensemanagerlinuxsubscriptions", + "service/licensemanagerusersubscriptions", + "service/lightsail", + "service/location", + "service/lookoutequipment", + "service/lookoutmetrics", + "service/lookoutvision", + "service/m2", + "service/machinelearning", + "service/macie2", + "service/managedblockchain", + "service/managedblockchainquery", + "service/marketplaceagreement", + "service/marketplacecatalog", + "service/marketplacecommerceanalytics", + "service/marketplacedeployment", + "service/marketplaceentitlementservice", + "service/marketplacemetering", + "service/mediaconnect", + "service/mediaconvert", + "service/medialive", + "service/mediapackage", + "service/mediapackagev2", + "service/mediapackagevod", + "service/mediastore", + "service/mediastoredata", + "service/mediatailor", + "service/medicalimaging", + "service/memorydb", + "service/mgn", + "service/migrationhub", + "service/migrationhubconfig", + "service/migrationhuborchestrator", + "service/migrationhubrefactorspaces", + "service/migrationhubstrategy", + "service/mobile", + "service/mq", + "service/mturk", + "service/mwaa", + "service/neptune", + "service/neptunedata", + "service/networkfirewall", + "service/networkmanager", + "service/nimble", + "service/oam", + "service/omics", + "service/opensearch", + "service/opensearchserverless", + "service/opsworks", + "service/opsworkscm", + "service/organizations", + "service/osis", + "service/outposts", + "service/panorama", + "service/paymentcryptography", + "service/paymentcryptographydata", + "service/pcaconnectorad", + "service/personalize", + "service/personalizeevents", + "service/personalizeruntime", + "service/pi", + "service/pinpoint", + "service/pinpointemail", + "service/pinpointsmsvoice", + "service/pinpointsmsvoicev2", + "service/pipes", + "service/polly", + "service/pricing", + "service/privatenetworks", + "service/proton", + "service/qbusiness", + "service/qconnect", + "service/qldb", + "service/qldbsession", + "service/quicksight", + "service/ram", + "service/rbin", + "service/rds", + "service/rdsdata", + "service/redshift", + "service/redshiftdata", + "service/redshiftserverless", + "service/rekognition", + "service/repostspace", + "service/resiliencehub", + "service/resourceexplorer2", + "service/resourcegroups", + "service/resourcegroupstaggingapi", + "service/robomaker", + "service/rolesanywhere", + "service/route53", + "service/route53domains", + "service/route53recoverycluster", + "service/route53recoverycontrolconfig", + "service/route53recoveryreadiness", + "service/route53resolver", + "service/rum", + "service/s3", + "service/s3control", + "service/s3outposts", + "service/sagemaker", + "service/sagemakera2iruntime", + "service/sagemakeredge", + "service/sagemakerfeaturestoreruntime", + "service/sagemakergeospatial", + "service/sagemakermetrics", + "service/sagemakerruntime", + "service/savingsplans", + "service/scheduler", + "service/schemas", + "service/secretsmanager", + "service/securityhub", + "service/securitylake", + "service/serverlessapplicationrepository", + "service/servicecatalog", + "service/servicecatalogappregistry", + "service/servicediscovery", + "service/servicequotas", + "service/ses", + "service/sesv2", + "service/sfn", + "service/shield", + "service/signer", + "service/simspaceweaver", + "service/sms", + "service/snowball", + "service/snowdevicemanagement", + "service/sns", + "service/sqs", + "service/ssm", + "service/ssmcontacts", + "service/ssmincidents", + "service/ssmsap", + "service/sso", + "service/ssoadmin", + "service/ssooidc", + "service/storagegateway", + "service/sts", + "service/support", + "service/supportapp", + "service/swf", + "service/synthetics", + "service/textract", + "service/timestreamquery", + "service/timestreamwrite", + "service/tnb", + "service/transcribe", + "service/transcribestreaming", + "service/transfer", + "service/translate", + "service/trustedadvisor", + "service/verifiedpermissions", + "service/voiceid", + "service/vpclattice", + "service/waf", + "service/wafregional", + "service/wafv2", + "service/wellarchitected", + "service/wisdom", + "service/workdocs", + "service/worklink", + "service/workmail", + "service/workmailmessageflow", + "service/workspaces", + "service/workspacesthinclient", + "service/workspacesweb", + "service/xray" + ] +} \ No newline at end of file diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/BackfillOptionalAuthTrait.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/BackfillOptionalAuthTrait.java index ca19281088e..07796a9b0fd 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/BackfillOptionalAuthTrait.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/BackfillOptionalAuthTrait.java @@ -23,12 +23,16 @@ import software.amazon.smithy.model.Model; import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ShapeId; +import software.amazon.smithy.model.traits.AuthTrait; import software.amazon.smithy.model.traits.OptionalAuthTrait; import software.amazon.smithy.utils.MapUtils; import software.amazon.smithy.utils.SetUtils; /** - * Backfill missing Smithy OptionalAuth traits to AWS models. + * Backfill missing Smithy OptionalAuth traits to AWS models. Also adds empty auth (@auth: []) since defaulted+invalid + * credential providers from the environment would otherwise get stuck on sigv4 in post-SRA auth if sigv4 suddenly + * became an option, which anecdotally matches the c2s transform that causes all existing instances of @optionalAuth + * anyway. */ public class BackfillOptionalAuthTrait implements GoIntegration { private static final Logger LOGGER = Logger.getLogger(BackfillOptionalAuthTrait.class.getName()); @@ -69,6 +73,7 @@ public Model preprocessModel( } builder.addShape(operationShape.toBuilder() .addTrait(new OptionalAuthTrait()) + .addTrait(new AuthTrait(SetUtils.of())) .build()); } diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/EndpointAuthResolution.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/EndpointAuthResolution.java index 499f7008f7c..c9f026e78aa 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/EndpointAuthResolution.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/EndpointAuthResolution.java @@ -42,7 +42,7 @@ public class EndpointAuthResolution implements GoIntegration { .target(ConfigFieldResolver.Target.FINALIZATION) .build(); - private static boolean isEndpointAuthService(Model model, ServiceShape service) { + public static boolean isEndpointAuthService(Model model, ServiceShape service) { final String sdkId = service.expectTrait(ServiceTrait.class).getSdkId(); return sdkId.equalsIgnoreCase("s3") || sdkId.equalsIgnoreCase("eventbridge"); }; diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/GlobalAnonymousOption.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/GlobalAnonymousOption.java new file mode 100644 index 00000000000..ab6d2868526 --- /dev/null +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/GlobalAnonymousOption.java @@ -0,0 +1,110 @@ +/* + * Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package software.amazon.smithy.aws.go.codegen.customization.auth; + +import software.amazon.smithy.codegen.core.SymbolProvider; +import software.amazon.smithy.go.codegen.GoDelegator; +import software.amazon.smithy.go.codegen.GoSettings; +import software.amazon.smithy.go.codegen.GoStdlibTypes; +import software.amazon.smithy.go.codegen.GoWriter; +import software.amazon.smithy.go.codegen.SmithyGoTypes; +import software.amazon.smithy.go.codegen.integration.ConfigFieldResolver; +import software.amazon.smithy.go.codegen.integration.GoIntegration; +import software.amazon.smithy.go.codegen.integration.RuntimeClientPlugin; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.utils.ListUtils; +import software.amazon.smithy.utils.MapUtils; + +import static software.amazon.smithy.aws.go.codegen.customization.auth.EndpointAuthResolution.isEndpointAuthService; +import static software.amazon.smithy.go.codegen.GoWriter.goTemplate; +import static software.amazon.smithy.go.codegen.SymbolUtils.buildPackageSymbol; + +/** + * SDK v2 has always implicitly supported noAuth / anonymous as an option, because all of the legacy signing middlewares + * would just noop if you didn't have credentials for them. We have to preserve this going forward in a post-SRA + * landscape. + */ +public class GlobalAnonymousOption implements GoIntegration { + private static final ConfigFieldResolver wrapWithAnonymousAuth = ConfigFieldResolver.builder() + .resolver(buildPackageSymbol("wrapWithAnonymousAuth")) + .location(ConfigFieldResolver.Location.CLIENT) + .target(ConfigFieldResolver.Target.FINALIZATION) + .build(); + + @Override + public byte getOrder() { + return 127; + } + + @Override + public java.util.List getClientPlugins() { + return ListUtils.of( + RuntimeClientPlugin.builder() + .servicePredicate((model, service) -> !isEndpointAuthService(model, service)) + .addConfigFieldResolver(wrapWithAnonymousAuth) + .build() + ); + } + + @Override + public void writeAdditionalFiles(GoSettings settings, Model model, SymbolProvider symbolProvider, GoDelegator goDelegator) { + goDelegator.useFileWriter("auth.go", settings.getModuleName(), GoWriter.ChainWritable.of( + generateAuthResolver(), + generateConfigResolver() + ).compose()); + } + + private GoWriter.Writable generateAuthResolver() { + return goTemplate(""" + type withAnonymous struct { + resolver AuthSchemeResolver + } + + var _ AuthSchemeResolver = (*withAnonymous)(nil) + + func (v *withAnonymous) ResolveAuthSchemes(ctx $context:T, params *AuthResolverParameters) ([]$option:P, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &$option:T{ + SchemeID: $anonymous:T, + }) + return opts, nil + } + """, + MapUtils.of( + "context", GoStdlibTypes.Context.Context, + "option", SmithyGoTypes.Auth.Option, + "anonymous", SmithyGoTypes.Auth.SchemeIDAnonymous + )); + } + + private GoWriter.Writable generateConfigResolver() { + return goTemplate(""" + func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } + } + """); + } +} diff --git a/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration b/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration index f6917466637..540f3a8d080 100644 --- a/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration +++ b/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration @@ -72,3 +72,4 @@ software.amazon.smithy.aws.go.codegen.customization.RemoveDefaults software.amazon.smithy.aws.go.codegen.customization.auth.S3ExpressAuthScheme software.amazon.smithy.aws.go.codegen.customization.S3BucketContext software.amazon.smithy.aws.go.codegen.customization.s3.ExpressDefaultChecksum +software.amazon.smithy.aws.go.codegen.customization.auth.GlobalAnonymousOption diff --git a/internal/protocoltest/awsrestjson/api_client.go b/internal/protocoltest/awsrestjson/api_client.go index 55dac8f2623..06105aeb6b8 100644 --- a/internal/protocoltest/awsrestjson/api_client.go +++ b/internal/protocoltest/awsrestjson/api_client.go @@ -54,6 +54,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveRetryer(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/internal/protocoltest/awsrestjson/auth.go b/internal/protocoltest/awsrestjson/auth.go index ce4a98539cb..5564edd67f6 100644 --- a/internal/protocoltest/awsrestjson/auth.go +++ b/internal/protocoltest/awsrestjson/auth.go @@ -48,6 +48,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/internal/protocoltest/ec2query/api_client.go b/internal/protocoltest/ec2query/api_client.go index 8f648af1489..1756327776a 100644 --- a/internal/protocoltest/ec2query/api_client.go +++ b/internal/protocoltest/ec2query/api_client.go @@ -54,6 +54,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveRetryer(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/internal/protocoltest/ec2query/auth.go b/internal/protocoltest/ec2query/auth.go index 7f42d8b47b9..3d784083847 100644 --- a/internal/protocoltest/ec2query/auth.go +++ b/internal/protocoltest/ec2query/auth.go @@ -48,6 +48,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/internal/protocoltest/jsonrpc/api_client.go b/internal/protocoltest/jsonrpc/api_client.go index b41ec84c450..f33d4ad0417 100644 --- a/internal/protocoltest/jsonrpc/api_client.go +++ b/internal/protocoltest/jsonrpc/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/internal/protocoltest/jsonrpc/auth.go b/internal/protocoltest/jsonrpc/auth.go index 80a1e42aa9e..b5ccf33dfc6 100644 --- a/internal/protocoltest/jsonrpc/auth.go +++ b/internal/protocoltest/jsonrpc/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/internal/protocoltest/jsonrpc10/api_client.go b/internal/protocoltest/jsonrpc10/api_client.go index 23d81523964..145706f8d3c 100644 --- a/internal/protocoltest/jsonrpc10/api_client.go +++ b/internal/protocoltest/jsonrpc10/api_client.go @@ -50,6 +50,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveRetryer(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/internal/protocoltest/jsonrpc10/auth.go b/internal/protocoltest/jsonrpc10/auth.go index 56c9f2f295b..463ee3e7df5 100644 --- a/internal/protocoltest/jsonrpc10/auth.go +++ b/internal/protocoltest/jsonrpc10/auth.go @@ -48,6 +48,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/internal/protocoltest/query/api_client.go b/internal/protocoltest/query/api_client.go index b239b7e0c74..aa54e22adb7 100644 --- a/internal/protocoltest/query/api_client.go +++ b/internal/protocoltest/query/api_client.go @@ -54,6 +54,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveRetryer(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/internal/protocoltest/query/auth.go b/internal/protocoltest/query/auth.go index 618c6952a97..e6417c9b6ca 100644 --- a/internal/protocoltest/query/auth.go +++ b/internal/protocoltest/query/auth.go @@ -48,6 +48,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/internal/protocoltest/restxml/api_client.go b/internal/protocoltest/restxml/api_client.go index 8b0eeb30283..78c25b86950 100644 --- a/internal/protocoltest/restxml/api_client.go +++ b/internal/protocoltest/restxml/api_client.go @@ -54,6 +54,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveRetryer(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/internal/protocoltest/restxml/auth.go b/internal/protocoltest/restxml/auth.go index 64247bdfa83..279fa13ea46 100644 --- a/internal/protocoltest/restxml/auth.go +++ b/internal/protocoltest/restxml/auth.go @@ -48,6 +48,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/internal/protocoltest/restxmlwithnamespace/api_client.go b/internal/protocoltest/restxmlwithnamespace/api_client.go index dc57bbef46a..cb791e64154 100644 --- a/internal/protocoltest/restxmlwithnamespace/api_client.go +++ b/internal/protocoltest/restxmlwithnamespace/api_client.go @@ -50,6 +50,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveRetryer(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/internal/protocoltest/restxmlwithnamespace/auth.go b/internal/protocoltest/restxmlwithnamespace/auth.go index 41559150738..8128ce90d17 100644 --- a/internal/protocoltest/restxmlwithnamespace/auth.go +++ b/internal/protocoltest/restxmlwithnamespace/auth.go @@ -48,6 +48,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/accessanalyzer/api_client.go b/service/accessanalyzer/api_client.go index 37269568003..72de07e1748 100644 --- a/service/accessanalyzer/api_client.go +++ b/service/accessanalyzer/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/accessanalyzer/auth.go b/service/accessanalyzer/auth.go index 85954a008e2..dc7e2e64c13 100644 --- a/service/accessanalyzer/auth.go +++ b/service/accessanalyzer/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/account/api_client.go b/service/account/api_client.go index f9822b51fda..2f857a0f0e0 100644 --- a/service/account/api_client.go +++ b/service/account/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/account/auth.go b/service/account/auth.go index 2a479e1705e..eff6c3b0bd8 100644 --- a/service/account/auth.go +++ b/service/account/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/acm/api_client.go b/service/acm/api_client.go index 64709493ee1..9f11b85db61 100644 --- a/service/acm/api_client.go +++ b/service/acm/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/acm/auth.go b/service/acm/auth.go index a2511252b21..d835fd61fad 100644 --- a/service/acm/auth.go +++ b/service/acm/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/acmpca/api_client.go b/service/acmpca/api_client.go index 02996cbb462..15cc8d37020 100644 --- a/service/acmpca/api_client.go +++ b/service/acmpca/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/acmpca/auth.go b/service/acmpca/auth.go index 33447889035..69b02aca23d 100644 --- a/service/acmpca/auth.go +++ b/service/acmpca/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/alexaforbusiness/api_client.go b/service/alexaforbusiness/api_client.go index 167c31f6441..1cc65d0c1aa 100644 --- a/service/alexaforbusiness/api_client.go +++ b/service/alexaforbusiness/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/alexaforbusiness/auth.go b/service/alexaforbusiness/auth.go index 7ae52913d92..dc24f714049 100644 --- a/service/alexaforbusiness/auth.go +++ b/service/alexaforbusiness/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/amp/api_client.go b/service/amp/api_client.go index 7a61f00dd1f..a26a88e4457 100644 --- a/service/amp/api_client.go +++ b/service/amp/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/amp/auth.go b/service/amp/auth.go index 448bc422748..8e90d81a4bd 100644 --- a/service/amp/auth.go +++ b/service/amp/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/amplify/api_client.go b/service/amplify/api_client.go index c30e0480c55..157cf93c468 100644 --- a/service/amplify/api_client.go +++ b/service/amplify/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/amplify/auth.go b/service/amplify/auth.go index b8785fd4298..fab9ad320e9 100644 --- a/service/amplify/auth.go +++ b/service/amplify/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/amplifybackend/api_client.go b/service/amplifybackend/api_client.go index 77de51bebb7..ceac5c6c805 100644 --- a/service/amplifybackend/api_client.go +++ b/service/amplifybackend/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/amplifybackend/auth.go b/service/amplifybackend/auth.go index 7ecbbb1cc54..88e12264988 100644 --- a/service/amplifybackend/auth.go +++ b/service/amplifybackend/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/amplifyuibuilder/api_client.go b/service/amplifyuibuilder/api_client.go index cd583f32193..2e11e2e1eb1 100644 --- a/service/amplifyuibuilder/api_client.go +++ b/service/amplifyuibuilder/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/amplifyuibuilder/auth.go b/service/amplifyuibuilder/auth.go index 62c3774e720..213f2652aa1 100644 --- a/service/amplifyuibuilder/auth.go +++ b/service/amplifyuibuilder/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/apigateway/api_client.go b/service/apigateway/api_client.go index cef244e3570..ca3a0e9951f 100644 --- a/service/apigateway/api_client.go +++ b/service/apigateway/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/apigateway/auth.go b/service/apigateway/auth.go index 13eec1d8419..2ff757469f6 100644 --- a/service/apigateway/auth.go +++ b/service/apigateway/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/apigatewaymanagementapi/api_client.go b/service/apigatewaymanagementapi/api_client.go index 792d8c27895..4167422d984 100644 --- a/service/apigatewaymanagementapi/api_client.go +++ b/service/apigatewaymanagementapi/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/apigatewaymanagementapi/auth.go b/service/apigatewaymanagementapi/auth.go index f4aaca5c51b..51cf731ac1b 100644 --- a/service/apigatewaymanagementapi/auth.go +++ b/service/apigatewaymanagementapi/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/apigatewayv2/api_client.go b/service/apigatewayv2/api_client.go index 0e05c268029..200ab8c46e2 100644 --- a/service/apigatewayv2/api_client.go +++ b/service/apigatewayv2/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/apigatewayv2/auth.go b/service/apigatewayv2/auth.go index 5c5a490867a..366e1d62487 100644 --- a/service/apigatewayv2/auth.go +++ b/service/apigatewayv2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/appconfig/api_client.go b/service/appconfig/api_client.go index d798cc35f36..404641fa9e5 100644 --- a/service/appconfig/api_client.go +++ b/service/appconfig/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/appconfig/auth.go b/service/appconfig/auth.go index 53696e68e45..399b2a3e472 100644 --- a/service/appconfig/auth.go +++ b/service/appconfig/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/appconfigdata/api_client.go b/service/appconfigdata/api_client.go index 4ed58aae57a..af60fa9de0a 100644 --- a/service/appconfigdata/api_client.go +++ b/service/appconfigdata/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/appconfigdata/auth.go b/service/appconfigdata/auth.go index 6451dcdc853..c611bb300a3 100644 --- a/service/appconfigdata/auth.go +++ b/service/appconfigdata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/appfabric/api_client.go b/service/appfabric/api_client.go index 9a05ba7625c..b7762b5f9e4 100644 --- a/service/appfabric/api_client.go +++ b/service/appfabric/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/appfabric/auth.go b/service/appfabric/auth.go index 6c71a420332..892b57015b3 100644 --- a/service/appfabric/auth.go +++ b/service/appfabric/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/appflow/api_client.go b/service/appflow/api_client.go index 56a353c738c..4262e2e6346 100644 --- a/service/appflow/api_client.go +++ b/service/appflow/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/appflow/auth.go b/service/appflow/auth.go index 5b4bab64d33..e8bdec2c46d 100644 --- a/service/appflow/auth.go +++ b/service/appflow/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/appintegrations/api_client.go b/service/appintegrations/api_client.go index 607a8b6fea8..f20c6e80187 100644 --- a/service/appintegrations/api_client.go +++ b/service/appintegrations/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/appintegrations/auth.go b/service/appintegrations/auth.go index 784b8452c69..bbcc9d43195 100644 --- a/service/appintegrations/auth.go +++ b/service/appintegrations/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/applicationautoscaling/api_client.go b/service/applicationautoscaling/api_client.go index 1870113f01b..4a2d6c9a681 100644 --- a/service/applicationautoscaling/api_client.go +++ b/service/applicationautoscaling/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/applicationautoscaling/auth.go b/service/applicationautoscaling/auth.go index 173baae4230..0d831c03ced 100644 --- a/service/applicationautoscaling/auth.go +++ b/service/applicationautoscaling/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/applicationcostprofiler/api_client.go b/service/applicationcostprofiler/api_client.go index c8366f3eb08..dca514bf309 100644 --- a/service/applicationcostprofiler/api_client.go +++ b/service/applicationcostprofiler/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/applicationcostprofiler/auth.go b/service/applicationcostprofiler/auth.go index 2e0a5485327..3b5bd5100d3 100644 --- a/service/applicationcostprofiler/auth.go +++ b/service/applicationcostprofiler/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/applicationdiscoveryservice/api_client.go b/service/applicationdiscoveryservice/api_client.go index 0c5482c33b0..e032bf5d668 100644 --- a/service/applicationdiscoveryservice/api_client.go +++ b/service/applicationdiscoveryservice/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/applicationdiscoveryservice/auth.go b/service/applicationdiscoveryservice/auth.go index 0439d49cbdf..4510690c411 100644 --- a/service/applicationdiscoveryservice/auth.go +++ b/service/applicationdiscoveryservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/applicationinsights/api_client.go b/service/applicationinsights/api_client.go index 51a4a2e6e19..6b1385af55c 100644 --- a/service/applicationinsights/api_client.go +++ b/service/applicationinsights/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/applicationinsights/auth.go b/service/applicationinsights/auth.go index 40c02fa8813..a440b044c34 100644 --- a/service/applicationinsights/auth.go +++ b/service/applicationinsights/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/appmesh/api_client.go b/service/appmesh/api_client.go index 6cbae369c0c..59a2af2d89f 100644 --- a/service/appmesh/api_client.go +++ b/service/appmesh/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/appmesh/auth.go b/service/appmesh/auth.go index eb823e7223e..2a4c86d891a 100644 --- a/service/appmesh/auth.go +++ b/service/appmesh/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/apprunner/api_client.go b/service/apprunner/api_client.go index 1c1e2975225..fb7f171e15e 100644 --- a/service/apprunner/api_client.go +++ b/service/apprunner/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/apprunner/auth.go b/service/apprunner/auth.go index 8b49b81b937..331ea57342a 100644 --- a/service/apprunner/auth.go +++ b/service/apprunner/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/appstream/api_client.go b/service/appstream/api_client.go index cda9c3c932d..777f9101249 100644 --- a/service/appstream/api_client.go +++ b/service/appstream/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/appstream/auth.go b/service/appstream/auth.go index 86a6785a506..b420016665e 100644 --- a/service/appstream/auth.go +++ b/service/appstream/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/appsync/api_client.go b/service/appsync/api_client.go index 3c4cf87f208..f05233c7b48 100644 --- a/service/appsync/api_client.go +++ b/service/appsync/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/appsync/auth.go b/service/appsync/auth.go index 619d50886b2..c5dd4955ae2 100644 --- a/service/appsync/auth.go +++ b/service/appsync/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/arczonalshift/api_client.go b/service/arczonalshift/api_client.go index 6f148cfa1c1..d2c174401ca 100644 --- a/service/arczonalshift/api_client.go +++ b/service/arczonalshift/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/arczonalshift/auth.go b/service/arczonalshift/auth.go index 78fbe5786b7..8c947a047ec 100644 --- a/service/arczonalshift/auth.go +++ b/service/arczonalshift/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/athena/api_client.go b/service/athena/api_client.go index 0f505874864..e0b563f21ce 100644 --- a/service/athena/api_client.go +++ b/service/athena/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/athena/auth.go b/service/athena/auth.go index f857eab9e9c..a819f1195df 100644 --- a/service/athena/auth.go +++ b/service/athena/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/auditmanager/api_client.go b/service/auditmanager/api_client.go index be5f0e4492e..5ddef73d3e5 100644 --- a/service/auditmanager/api_client.go +++ b/service/auditmanager/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/auditmanager/auth.go b/service/auditmanager/auth.go index 9401f30a98d..7782307f945 100644 --- a/service/auditmanager/auth.go +++ b/service/auditmanager/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/autoscaling/api_client.go b/service/autoscaling/api_client.go index d9bdc568f9e..4311b456abb 100644 --- a/service/autoscaling/api_client.go +++ b/service/autoscaling/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/autoscaling/auth.go b/service/autoscaling/auth.go index f77b335209e..4c2a3897ec4 100644 --- a/service/autoscaling/auth.go +++ b/service/autoscaling/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/autoscalingplans/api_client.go b/service/autoscalingplans/api_client.go index 47bee9739df..b5b263c585b 100644 --- a/service/autoscalingplans/api_client.go +++ b/service/autoscalingplans/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/autoscalingplans/auth.go b/service/autoscalingplans/auth.go index 5c1f5a76fa5..47bc2e5478d 100644 --- a/service/autoscalingplans/auth.go +++ b/service/autoscalingplans/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/b2bi/api_client.go b/service/b2bi/api_client.go index c2f2ef76042..d809378606f 100644 --- a/service/b2bi/api_client.go +++ b/service/b2bi/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/b2bi/auth.go b/service/b2bi/auth.go index 82d89684cb8..621982d01b2 100644 --- a/service/b2bi/auth.go +++ b/service/b2bi/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/backup/api_client.go b/service/backup/api_client.go index 4a4131bcf00..e0b1a1417fb 100644 --- a/service/backup/api_client.go +++ b/service/backup/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/backup/auth.go b/service/backup/auth.go index 03f26522cc8..a80946ab435 100644 --- a/service/backup/auth.go +++ b/service/backup/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/backupgateway/api_client.go b/service/backupgateway/api_client.go index 43e14ea837e..0b216bb6db0 100644 --- a/service/backupgateway/api_client.go +++ b/service/backupgateway/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/backupgateway/auth.go b/service/backupgateway/auth.go index 9c28a00844f..d91472bc572 100644 --- a/service/backupgateway/auth.go +++ b/service/backupgateway/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/backupstorage/api_client.go b/service/backupstorage/api_client.go index 7c68b4f26a7..26fb3db22a2 100644 --- a/service/backupstorage/api_client.go +++ b/service/backupstorage/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/backupstorage/auth.go b/service/backupstorage/auth.go index a82e595a09f..9dacc499bfe 100644 --- a/service/backupstorage/auth.go +++ b/service/backupstorage/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/batch/api_client.go b/service/batch/api_client.go index 11cf89cc4a2..0979f1b401d 100644 --- a/service/batch/api_client.go +++ b/service/batch/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/batch/auth.go b/service/batch/auth.go index 3b2ad549107..f17ae176ebd 100644 --- a/service/batch/auth.go +++ b/service/batch/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/bcmdataexports/api_client.go b/service/bcmdataexports/api_client.go index a4664f6315d..85d759094de 100644 --- a/service/bcmdataexports/api_client.go +++ b/service/bcmdataexports/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/bcmdataexports/auth.go b/service/bcmdataexports/auth.go index aa4aa1149e7..9fbb062c8e7 100644 --- a/service/bcmdataexports/auth.go +++ b/service/bcmdataexports/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/bedrock/api_client.go b/service/bedrock/api_client.go index aa0c780dde3..0ceac6e41ce 100644 --- a/service/bedrock/api_client.go +++ b/service/bedrock/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/bedrock/auth.go b/service/bedrock/auth.go index 516a7df3173..5fb4c6956b5 100644 --- a/service/bedrock/auth.go +++ b/service/bedrock/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/bedrockagent/api_client.go b/service/bedrockagent/api_client.go index 0b3ad58907f..9208d81dc6b 100644 --- a/service/bedrockagent/api_client.go +++ b/service/bedrockagent/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/bedrockagent/auth.go b/service/bedrockagent/auth.go index 21f13e86f03..0a53cadc7b4 100644 --- a/service/bedrockagent/auth.go +++ b/service/bedrockagent/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/bedrockagentruntime/api_client.go b/service/bedrockagentruntime/api_client.go index aed6967890e..25707e64bcc 100644 --- a/service/bedrockagentruntime/api_client.go +++ b/service/bedrockagentruntime/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/bedrockagentruntime/auth.go b/service/bedrockagentruntime/auth.go index e9deb0854be..f7aa5347ff0 100644 --- a/service/bedrockagentruntime/auth.go +++ b/service/bedrockagentruntime/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/bedrockruntime/api_client.go b/service/bedrockruntime/api_client.go index 1987ea985ff..06d0454237e 100644 --- a/service/bedrockruntime/api_client.go +++ b/service/bedrockruntime/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/bedrockruntime/auth.go b/service/bedrockruntime/auth.go index 51b0ec97574..e6b3c0bf253 100644 --- a/service/bedrockruntime/auth.go +++ b/service/bedrockruntime/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/billingconductor/api_client.go b/service/billingconductor/api_client.go index 7b159c917e8..5adb612cdfa 100644 --- a/service/billingconductor/api_client.go +++ b/service/billingconductor/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/billingconductor/auth.go b/service/billingconductor/auth.go index fd7efc61587..1130662d1f3 100644 --- a/service/billingconductor/auth.go +++ b/service/billingconductor/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/braket/api_client.go b/service/braket/api_client.go index 3cab4e73878..01600705f1c 100644 --- a/service/braket/api_client.go +++ b/service/braket/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/braket/auth.go b/service/braket/auth.go index ffdb57e8895..4ae3d36980f 100644 --- a/service/braket/auth.go +++ b/service/braket/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/budgets/api_client.go b/service/budgets/api_client.go index 5863f18c6f6..689a6681fd4 100644 --- a/service/budgets/api_client.go +++ b/service/budgets/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/budgets/auth.go b/service/budgets/auth.go index e6e5a23b1a6..9b66a814445 100644 --- a/service/budgets/auth.go +++ b/service/budgets/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/chime/api_client.go b/service/chime/api_client.go index 83ef23fb977..ca75899d09e 100644 --- a/service/chime/api_client.go +++ b/service/chime/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/chime/auth.go b/service/chime/auth.go index 982bcec65b1..6adcb392e6b 100644 --- a/service/chime/auth.go +++ b/service/chime/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/chimesdkidentity/api_client.go b/service/chimesdkidentity/api_client.go index 75a587f80de..85d357c279a 100644 --- a/service/chimesdkidentity/api_client.go +++ b/service/chimesdkidentity/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/chimesdkidentity/auth.go b/service/chimesdkidentity/auth.go index a7f66023d91..34fbc2694c4 100644 --- a/service/chimesdkidentity/auth.go +++ b/service/chimesdkidentity/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/chimesdkmediapipelines/api_client.go b/service/chimesdkmediapipelines/api_client.go index 8f155a81dcc..bd2ef568e81 100644 --- a/service/chimesdkmediapipelines/api_client.go +++ b/service/chimesdkmediapipelines/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/chimesdkmediapipelines/auth.go b/service/chimesdkmediapipelines/auth.go index 8393d8446b7..c75bebffd91 100644 --- a/service/chimesdkmediapipelines/auth.go +++ b/service/chimesdkmediapipelines/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/chimesdkmeetings/api_client.go b/service/chimesdkmeetings/api_client.go index 572c9c6bd93..c8686df09d5 100644 --- a/service/chimesdkmeetings/api_client.go +++ b/service/chimesdkmeetings/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/chimesdkmeetings/auth.go b/service/chimesdkmeetings/auth.go index 3846f2ecac5..08f48a4239c 100644 --- a/service/chimesdkmeetings/auth.go +++ b/service/chimesdkmeetings/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/chimesdkmessaging/api_client.go b/service/chimesdkmessaging/api_client.go index 14db483485b..f159865ce40 100644 --- a/service/chimesdkmessaging/api_client.go +++ b/service/chimesdkmessaging/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/chimesdkmessaging/auth.go b/service/chimesdkmessaging/auth.go index 44a13fb70ee..715791d49c9 100644 --- a/service/chimesdkmessaging/auth.go +++ b/service/chimesdkmessaging/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/chimesdkvoice/api_client.go b/service/chimesdkvoice/api_client.go index 0172213cc30..01dd2859bc4 100644 --- a/service/chimesdkvoice/api_client.go +++ b/service/chimesdkvoice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/chimesdkvoice/auth.go b/service/chimesdkvoice/auth.go index b19cade4058..e5ec8b7d74d 100644 --- a/service/chimesdkvoice/auth.go +++ b/service/chimesdkvoice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cleanrooms/api_client.go b/service/cleanrooms/api_client.go index 94d73c63edd..ac33e4cbdec 100644 --- a/service/cleanrooms/api_client.go +++ b/service/cleanrooms/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cleanrooms/auth.go b/service/cleanrooms/auth.go index 2f88458cd1c..b1878f8b06c 100644 --- a/service/cleanrooms/auth.go +++ b/service/cleanrooms/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cleanroomsml/api_client.go b/service/cleanroomsml/api_client.go index 37f458b198d..75842aa376b 100644 --- a/service/cleanroomsml/api_client.go +++ b/service/cleanroomsml/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cleanroomsml/auth.go b/service/cleanroomsml/auth.go index eec79d874e2..8cf00fe2d2a 100644 --- a/service/cleanroomsml/auth.go +++ b/service/cleanroomsml/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloud9/api_client.go b/service/cloud9/api_client.go index cef7307c77d..9e4ee0ca8d2 100644 --- a/service/cloud9/api_client.go +++ b/service/cloud9/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloud9/auth.go b/service/cloud9/auth.go index fd69e172d75..45b8810ca71 100644 --- a/service/cloud9/auth.go +++ b/service/cloud9/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudcontrol/api_client.go b/service/cloudcontrol/api_client.go index 7df123b59b4..64215a30287 100644 --- a/service/cloudcontrol/api_client.go +++ b/service/cloudcontrol/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudcontrol/auth.go b/service/cloudcontrol/auth.go index 19721b0dd6a..6c01a7870ca 100644 --- a/service/cloudcontrol/auth.go +++ b/service/cloudcontrol/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/clouddirectory/api_client.go b/service/clouddirectory/api_client.go index 706e5e45204..caa39f51351 100644 --- a/service/clouddirectory/api_client.go +++ b/service/clouddirectory/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/clouddirectory/auth.go b/service/clouddirectory/auth.go index 44a843e9279..7ef219219b7 100644 --- a/service/clouddirectory/auth.go +++ b/service/clouddirectory/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudformation/api_client.go b/service/cloudformation/api_client.go index b2f5ee767d8..49eff6a1f1e 100644 --- a/service/cloudformation/api_client.go +++ b/service/cloudformation/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudformation/auth.go b/service/cloudformation/auth.go index 04aaa1b47fb..b3ffff854fc 100644 --- a/service/cloudformation/auth.go +++ b/service/cloudformation/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudfront/api_client.go b/service/cloudfront/api_client.go index 200946fde97..91d06d91c17 100644 --- a/service/cloudfront/api_client.go +++ b/service/cloudfront/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudfront/auth.go b/service/cloudfront/auth.go index be6e33f42ae..424e6944949 100644 --- a/service/cloudfront/auth.go +++ b/service/cloudfront/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudfrontkeyvaluestore/api_client.go b/service/cloudfrontkeyvaluestore/api_client.go index f31cf12f441..b1cfd830950 100644 --- a/service/cloudfrontkeyvaluestore/api_client.go +++ b/service/cloudfrontkeyvaluestore/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudfrontkeyvaluestore/auth.go b/service/cloudfrontkeyvaluestore/auth.go index 8bef13216e8..e43490e9fa4 100644 --- a/service/cloudfrontkeyvaluestore/auth.go +++ b/service/cloudfrontkeyvaluestore/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudhsm/api_client.go b/service/cloudhsm/api_client.go index c71d7c729cf..be1e04fdb37 100644 --- a/service/cloudhsm/api_client.go +++ b/service/cloudhsm/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudhsm/auth.go b/service/cloudhsm/auth.go index c2db89e6f85..af7ba216d1f 100644 --- a/service/cloudhsm/auth.go +++ b/service/cloudhsm/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudhsmv2/api_client.go b/service/cloudhsmv2/api_client.go index fbde655ddc5..6a9523ef3b4 100644 --- a/service/cloudhsmv2/api_client.go +++ b/service/cloudhsmv2/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudhsmv2/auth.go b/service/cloudhsmv2/auth.go index ba18ccd9f32..50320c77406 100644 --- a/service/cloudhsmv2/auth.go +++ b/service/cloudhsmv2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudsearch/api_client.go b/service/cloudsearch/api_client.go index 8fb42ff03ef..045784ac583 100644 --- a/service/cloudsearch/api_client.go +++ b/service/cloudsearch/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudsearch/auth.go b/service/cloudsearch/auth.go index dd0bf179f1d..0e18b91c7c5 100644 --- a/service/cloudsearch/auth.go +++ b/service/cloudsearch/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudsearchdomain/api_client.go b/service/cloudsearchdomain/api_client.go index a48b82f8c88..44edcef086f 100644 --- a/service/cloudsearchdomain/api_client.go +++ b/service/cloudsearchdomain/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudsearchdomain/auth.go b/service/cloudsearchdomain/auth.go index 2272500dc90..cd60da2b0f8 100644 --- a/service/cloudsearchdomain/auth.go +++ b/service/cloudsearchdomain/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudtrail/api_client.go b/service/cloudtrail/api_client.go index 2d313bd4f16..48fe95e962c 100644 --- a/service/cloudtrail/api_client.go +++ b/service/cloudtrail/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudtrail/auth.go b/service/cloudtrail/auth.go index 91dd3785e0f..866b0958eba 100644 --- a/service/cloudtrail/auth.go +++ b/service/cloudtrail/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudtraildata/api_client.go b/service/cloudtraildata/api_client.go index 9e9e77ea476..92ff57d8392 100644 --- a/service/cloudtraildata/api_client.go +++ b/service/cloudtraildata/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudtraildata/auth.go b/service/cloudtraildata/auth.go index 2128d77b0c0..ffae409d45c 100644 --- a/service/cloudtraildata/auth.go +++ b/service/cloudtraildata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudwatch/api_client.go b/service/cloudwatch/api_client.go index d6a9c0508bf..ed6ed01dcf7 100644 --- a/service/cloudwatch/api_client.go +++ b/service/cloudwatch/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudwatch/auth.go b/service/cloudwatch/auth.go index 6f5d48fbe4d..d7dd29021ef 100644 --- a/service/cloudwatch/auth.go +++ b/service/cloudwatch/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudwatchevents/api_client.go b/service/cloudwatchevents/api_client.go index e83e3340cf5..6eda96f77f6 100644 --- a/service/cloudwatchevents/api_client.go +++ b/service/cloudwatchevents/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudwatchevents/auth.go b/service/cloudwatchevents/auth.go index ea206c578ba..54b6cf2b251 100644 --- a/service/cloudwatchevents/auth.go +++ b/service/cloudwatchevents/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cloudwatchlogs/api_client.go b/service/cloudwatchlogs/api_client.go index 8174522858d..5f12149d504 100644 --- a/service/cloudwatchlogs/api_client.go +++ b/service/cloudwatchlogs/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cloudwatchlogs/auth.go b/service/cloudwatchlogs/auth.go index 6176570140a..fff49614c8a 100644 --- a/service/cloudwatchlogs/auth.go +++ b/service/cloudwatchlogs/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codeartifact/api_client.go b/service/codeartifact/api_client.go index eaee3d24922..6d316790c4c 100644 --- a/service/codeartifact/api_client.go +++ b/service/codeartifact/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codeartifact/auth.go b/service/codeartifact/auth.go index 9ec51ffc37b..e3c5ce4848c 100644 --- a/service/codeartifact/auth.go +++ b/service/codeartifact/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codebuild/api_client.go b/service/codebuild/api_client.go index b2f62dab71c..2f285d542ed 100644 --- a/service/codebuild/api_client.go +++ b/service/codebuild/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codebuild/auth.go b/service/codebuild/auth.go index 0aa1a43c104..ee3a0c5363b 100644 --- a/service/codebuild/auth.go +++ b/service/codebuild/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codecatalyst/api_client.go b/service/codecatalyst/api_client.go index 01a8dafd08f..648abd59025 100644 --- a/service/codecatalyst/api_client.go +++ b/service/codecatalyst/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveRetryer(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codecatalyst/auth.go b/service/codecatalyst/auth.go index 04df4106161..862bbdb5a8f 100644 --- a/service/codecatalyst/auth.go +++ b/service/codecatalyst/auth.go @@ -48,6 +48,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codecommit/api_client.go b/service/codecommit/api_client.go index 5dfffd1aa82..bda75a17230 100644 --- a/service/codecommit/api_client.go +++ b/service/codecommit/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codecommit/auth.go b/service/codecommit/auth.go index c8109944cbe..4d144c4122b 100644 --- a/service/codecommit/auth.go +++ b/service/codecommit/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codedeploy/api_client.go b/service/codedeploy/api_client.go index 3dc773bb3a9..9a42eecfa6e 100644 --- a/service/codedeploy/api_client.go +++ b/service/codedeploy/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codedeploy/auth.go b/service/codedeploy/auth.go index 160ced1dec7..cd85dfc6595 100644 --- a/service/codedeploy/auth.go +++ b/service/codedeploy/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codeguruprofiler/api_client.go b/service/codeguruprofiler/api_client.go index abcd84887b9..2d86ae04aed 100644 --- a/service/codeguruprofiler/api_client.go +++ b/service/codeguruprofiler/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codeguruprofiler/auth.go b/service/codeguruprofiler/auth.go index 5d796a9ec2c..60053ae5d0b 100644 --- a/service/codeguruprofiler/auth.go +++ b/service/codeguruprofiler/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codegurureviewer/api_client.go b/service/codegurureviewer/api_client.go index ba89b514c31..4d21180576d 100644 --- a/service/codegurureviewer/api_client.go +++ b/service/codegurureviewer/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codegurureviewer/auth.go b/service/codegurureviewer/auth.go index 08c1e9757e8..3987f2f0511 100644 --- a/service/codegurureviewer/auth.go +++ b/service/codegurureviewer/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codegurusecurity/api_client.go b/service/codegurusecurity/api_client.go index 401c91bf22a..68e34c56509 100644 --- a/service/codegurusecurity/api_client.go +++ b/service/codegurusecurity/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codegurusecurity/auth.go b/service/codegurusecurity/auth.go index b74c6a7c7bd..3b9d0dd4893 100644 --- a/service/codegurusecurity/auth.go +++ b/service/codegurusecurity/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codepipeline/api_client.go b/service/codepipeline/api_client.go index 63525de45e1..71c28944c21 100644 --- a/service/codepipeline/api_client.go +++ b/service/codepipeline/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codepipeline/auth.go b/service/codepipeline/auth.go index caae7f9a7a7..9cc55014388 100644 --- a/service/codepipeline/auth.go +++ b/service/codepipeline/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codestar/api_client.go b/service/codestar/api_client.go index 717ea925f0a..188bfc1127e 100644 --- a/service/codestar/api_client.go +++ b/service/codestar/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codestar/auth.go b/service/codestar/auth.go index 5a6c12cb017..4b96c0ebcd5 100644 --- a/service/codestar/auth.go +++ b/service/codestar/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codestarconnections/api_client.go b/service/codestarconnections/api_client.go index 91568085915..59606805415 100644 --- a/service/codestarconnections/api_client.go +++ b/service/codestarconnections/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codestarconnections/auth.go b/service/codestarconnections/auth.go index 7894637ca30..702ad6f1f30 100644 --- a/service/codestarconnections/auth.go +++ b/service/codestarconnections/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/codestarnotifications/api_client.go b/service/codestarnotifications/api_client.go index c4ba82bc8b6..51223c3d4a1 100644 --- a/service/codestarnotifications/api_client.go +++ b/service/codestarnotifications/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/codestarnotifications/auth.go b/service/codestarnotifications/auth.go index 0562a1ad2f6..5c32b160d4e 100644 --- a/service/codestarnotifications/auth.go +++ b/service/codestarnotifications/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cognitoidentity/api_client.go b/service/cognitoidentity/api_client.go index 153caecd4f7..0d4670120c6 100644 --- a/service/cognitoidentity/api_client.go +++ b/service/cognitoidentity/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cognitoidentity/auth.go b/service/cognitoidentity/auth.go index 5dc347fc9cb..6bf60c37e84 100644 --- a/service/cognitoidentity/auth.go +++ b/service/cognitoidentity/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cognitoidentityprovider/api_client.go b/service/cognitoidentityprovider/api_client.go index e9598913fdf..5d4e67b073e 100644 --- a/service/cognitoidentityprovider/api_client.go +++ b/service/cognitoidentityprovider/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cognitoidentityprovider/auth.go b/service/cognitoidentityprovider/auth.go index eb1ff0f2525..471f9d2bfcf 100644 --- a/service/cognitoidentityprovider/auth.go +++ b/service/cognitoidentityprovider/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/cognitosync/api_client.go b/service/cognitosync/api_client.go index 3c356d4745e..949cbf7ee98 100644 --- a/service/cognitosync/api_client.go +++ b/service/cognitosync/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/cognitosync/auth.go b/service/cognitosync/auth.go index 38e6ff59a8f..9d24d23ea32 100644 --- a/service/cognitosync/auth.go +++ b/service/cognitosync/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/comprehend/api_client.go b/service/comprehend/api_client.go index 023190ab5c5..aed8f92708e 100644 --- a/service/comprehend/api_client.go +++ b/service/comprehend/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/comprehend/auth.go b/service/comprehend/auth.go index 477250891f5..0991e047085 100644 --- a/service/comprehend/auth.go +++ b/service/comprehend/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/comprehendmedical/api_client.go b/service/comprehendmedical/api_client.go index b40534d5171..f60dbe8283a 100644 --- a/service/comprehendmedical/api_client.go +++ b/service/comprehendmedical/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/comprehendmedical/auth.go b/service/comprehendmedical/auth.go index a9ca75207e1..6323342ed08 100644 --- a/service/comprehendmedical/auth.go +++ b/service/comprehendmedical/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/computeoptimizer/api_client.go b/service/computeoptimizer/api_client.go index a5a55a98f45..ff41ed22d77 100644 --- a/service/computeoptimizer/api_client.go +++ b/service/computeoptimizer/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/computeoptimizer/auth.go b/service/computeoptimizer/auth.go index 49d79c17f56..29c7c72065d 100644 --- a/service/computeoptimizer/auth.go +++ b/service/computeoptimizer/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/configservice/api_client.go b/service/configservice/api_client.go index abef8ca1ef8..7ac635d6294 100644 --- a/service/configservice/api_client.go +++ b/service/configservice/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/configservice/auth.go b/service/configservice/auth.go index fd246998d95..65dcd4a3e63 100644 --- a/service/configservice/auth.go +++ b/service/configservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/connect/api_client.go b/service/connect/api_client.go index 1c79e554167..8957975c8f6 100644 --- a/service/connect/api_client.go +++ b/service/connect/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/connect/auth.go b/service/connect/auth.go index 0b5bcb35983..9800a81735e 100644 --- a/service/connect/auth.go +++ b/service/connect/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/connectcampaigns/api_client.go b/service/connectcampaigns/api_client.go index a63a179403e..0724a34e40a 100644 --- a/service/connectcampaigns/api_client.go +++ b/service/connectcampaigns/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/connectcampaigns/auth.go b/service/connectcampaigns/auth.go index e81dc839302..f6737cde3fb 100644 --- a/service/connectcampaigns/auth.go +++ b/service/connectcampaigns/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/connectcases/api_client.go b/service/connectcases/api_client.go index 1211c36b218..35deae7ea88 100644 --- a/service/connectcases/api_client.go +++ b/service/connectcases/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/connectcases/auth.go b/service/connectcases/auth.go index de3d29c20c8..91fffcf9baf 100644 --- a/service/connectcases/auth.go +++ b/service/connectcases/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/connectcontactlens/api_client.go b/service/connectcontactlens/api_client.go index c6a0f48b94c..732ad2db681 100644 --- a/service/connectcontactlens/api_client.go +++ b/service/connectcontactlens/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/connectcontactlens/auth.go b/service/connectcontactlens/auth.go index 3088404a434..76699d95ae2 100644 --- a/service/connectcontactlens/auth.go +++ b/service/connectcontactlens/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/connectparticipant/api_client.go b/service/connectparticipant/api_client.go index a70c1622c39..bb79226ef75 100644 --- a/service/connectparticipant/api_client.go +++ b/service/connectparticipant/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/connectparticipant/auth.go b/service/connectparticipant/auth.go index 71ce701a8b5..f2e851a706f 100644 --- a/service/connectparticipant/auth.go +++ b/service/connectparticipant/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/controltower/api_client.go b/service/controltower/api_client.go index 93bf3470dcd..5123bb40901 100644 --- a/service/controltower/api_client.go +++ b/service/controltower/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/controltower/auth.go b/service/controltower/auth.go index 3f2f6adc2a6..f8b61c05704 100644 --- a/service/controltower/auth.go +++ b/service/controltower/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/costandusagereportservice/api_client.go b/service/costandusagereportservice/api_client.go index 5acaed656ec..98705089a69 100644 --- a/service/costandusagereportservice/api_client.go +++ b/service/costandusagereportservice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/costandusagereportservice/auth.go b/service/costandusagereportservice/auth.go index 1bce420a285..9bb25de4d39 100644 --- a/service/costandusagereportservice/auth.go +++ b/service/costandusagereportservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/costexplorer/api_client.go b/service/costexplorer/api_client.go index dd98b4b5e84..8092a8f0a09 100644 --- a/service/costexplorer/api_client.go +++ b/service/costexplorer/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/costexplorer/auth.go b/service/costexplorer/auth.go index 10044acec23..d04e0be26e3 100644 --- a/service/costexplorer/auth.go +++ b/service/costexplorer/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/costoptimizationhub/api_client.go b/service/costoptimizationhub/api_client.go index 944ddd99ac2..739767bc456 100644 --- a/service/costoptimizationhub/api_client.go +++ b/service/costoptimizationhub/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/costoptimizationhub/auth.go b/service/costoptimizationhub/auth.go index ad5251d2f75..001ffd03fa6 100644 --- a/service/costoptimizationhub/auth.go +++ b/service/costoptimizationhub/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/customerprofiles/api_client.go b/service/customerprofiles/api_client.go index 6c4bce4aff7..1f73e9009cf 100644 --- a/service/customerprofiles/api_client.go +++ b/service/customerprofiles/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/customerprofiles/auth.go b/service/customerprofiles/auth.go index 7bd68580f6f..0c0672b1aa5 100644 --- a/service/customerprofiles/auth.go +++ b/service/customerprofiles/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/databasemigrationservice/api_client.go b/service/databasemigrationservice/api_client.go index f9c7c9962f2..00125b4996f 100644 --- a/service/databasemigrationservice/api_client.go +++ b/service/databasemigrationservice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/databasemigrationservice/auth.go b/service/databasemigrationservice/auth.go index d62e59c7014..ddb9776b960 100644 --- a/service/databasemigrationservice/auth.go +++ b/service/databasemigrationservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/databrew/api_client.go b/service/databrew/api_client.go index b7b8ba0b4d7..7565aacfdad 100644 --- a/service/databrew/api_client.go +++ b/service/databrew/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/databrew/auth.go b/service/databrew/auth.go index e7bf90ede9d..e4f3cc319fb 100644 --- a/service/databrew/auth.go +++ b/service/databrew/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/dataexchange/api_client.go b/service/dataexchange/api_client.go index f473ae158f6..a512e26dc21 100644 --- a/service/dataexchange/api_client.go +++ b/service/dataexchange/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/dataexchange/auth.go b/service/dataexchange/auth.go index acc34d05fec..e7b87cb1b16 100644 --- a/service/dataexchange/auth.go +++ b/service/dataexchange/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/datapipeline/api_client.go b/service/datapipeline/api_client.go index 558afb70f3d..c8e2f7b7624 100644 --- a/service/datapipeline/api_client.go +++ b/service/datapipeline/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/datapipeline/auth.go b/service/datapipeline/auth.go index d9c0ee7bbbd..95dc8ef9793 100644 --- a/service/datapipeline/auth.go +++ b/service/datapipeline/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/datasync/api_client.go b/service/datasync/api_client.go index 420dd674119..39cbb2480fd 100644 --- a/service/datasync/api_client.go +++ b/service/datasync/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/datasync/auth.go b/service/datasync/auth.go index 13f48c88e5a..32b6fa29edb 100644 --- a/service/datasync/auth.go +++ b/service/datasync/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/datazone/api_client.go b/service/datazone/api_client.go index bb74e4a5275..6cab458dd3a 100644 --- a/service/datazone/api_client.go +++ b/service/datazone/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/datazone/auth.go b/service/datazone/auth.go index 65d0eebdee5..c47c550f373 100644 --- a/service/datazone/auth.go +++ b/service/datazone/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/dax/api_client.go b/service/dax/api_client.go index 6ff87eccd27..12791756c5e 100644 --- a/service/dax/api_client.go +++ b/service/dax/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/dax/auth.go b/service/dax/auth.go index 7a78931fe67..06101460ce0 100644 --- a/service/dax/auth.go +++ b/service/dax/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/detective/api_client.go b/service/detective/api_client.go index 98f23d8eb97..537e918ee38 100644 --- a/service/detective/api_client.go +++ b/service/detective/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/detective/auth.go b/service/detective/auth.go index dc16d186c7f..58b15c470da 100644 --- a/service/detective/auth.go +++ b/service/detective/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/devicefarm/api_client.go b/service/devicefarm/api_client.go index 8acbbaa570b..8990aca3ecf 100644 --- a/service/devicefarm/api_client.go +++ b/service/devicefarm/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/devicefarm/auth.go b/service/devicefarm/auth.go index f6ffdaac2a7..a40d222f577 100644 --- a/service/devicefarm/auth.go +++ b/service/devicefarm/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/devopsguru/api_client.go b/service/devopsguru/api_client.go index aca68d2523a..6727ebaf62e 100644 --- a/service/devopsguru/api_client.go +++ b/service/devopsguru/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/devopsguru/auth.go b/service/devopsguru/auth.go index 5d995ed2ab1..1ee379495c4 100644 --- a/service/devopsguru/auth.go +++ b/service/devopsguru/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/directconnect/api_client.go b/service/directconnect/api_client.go index 17167ebeb56..2ab039de6b6 100644 --- a/service/directconnect/api_client.go +++ b/service/directconnect/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/directconnect/auth.go b/service/directconnect/auth.go index 83de9d41f9a..a139fa60735 100644 --- a/service/directconnect/auth.go +++ b/service/directconnect/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/directoryservice/api_client.go b/service/directoryservice/api_client.go index 1c329406495..cac03cac497 100644 --- a/service/directoryservice/api_client.go +++ b/service/directoryservice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/directoryservice/auth.go b/service/directoryservice/auth.go index a66bd4e5eda..b36e99bc54d 100644 --- a/service/directoryservice/auth.go +++ b/service/directoryservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/dlm/api_client.go b/service/dlm/api_client.go index d6cf78ede54..fe36801e513 100644 --- a/service/dlm/api_client.go +++ b/service/dlm/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/dlm/auth.go b/service/dlm/auth.go index b0758cdf580..79126cd58ca 100644 --- a/service/dlm/auth.go +++ b/service/dlm/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/docdb/api_client.go b/service/docdb/api_client.go index 216f3c80919..d067c130089 100644 --- a/service/docdb/api_client.go +++ b/service/docdb/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/docdb/auth.go b/service/docdb/auth.go index f14c6dcccc9..80174b1760f 100644 --- a/service/docdb/auth.go +++ b/service/docdb/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/docdbelastic/api_client.go b/service/docdbelastic/api_client.go index 50c410299bb..5e26c123f4d 100644 --- a/service/docdbelastic/api_client.go +++ b/service/docdbelastic/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/docdbelastic/auth.go b/service/docdbelastic/auth.go index a86c73f8362..a1d7b716326 100644 --- a/service/docdbelastic/auth.go +++ b/service/docdbelastic/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/drs/api_client.go b/service/drs/api_client.go index c826a5e9089..a6527933c95 100644 --- a/service/drs/api_client.go +++ b/service/drs/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/drs/auth.go b/service/drs/auth.go index ae9ad6d87d7..7acc999fb29 100644 --- a/service/drs/auth.go +++ b/service/drs/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/dynamodb/api_client.go b/service/dynamodb/api_client.go index 5da008a6d33..a554342e9e2 100644 --- a/service/dynamodb/api_client.go +++ b/service/dynamodb/api_client.go @@ -72,6 +72,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/dynamodb/auth.go b/service/dynamodb/auth.go index ddc52db9cf3..817a2851839 100644 --- a/service/dynamodb/auth.go +++ b/service/dynamodb/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/dynamodbstreams/api_client.go b/service/dynamodbstreams/api_client.go index 189f10e4a83..6081947e0b2 100644 --- a/service/dynamodbstreams/api_client.go +++ b/service/dynamodbstreams/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/dynamodbstreams/auth.go b/service/dynamodbstreams/auth.go index c0ff6f08823..25738f652c9 100644 --- a/service/dynamodbstreams/auth.go +++ b/service/dynamodbstreams/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ebs/api_client.go b/service/ebs/api_client.go index 347709e14e5..9e481af8c9c 100644 --- a/service/ebs/api_client.go +++ b/service/ebs/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ebs/auth.go b/service/ebs/auth.go index 8febbf1de2e..a32582f7732 100644 --- a/service/ebs/auth.go +++ b/service/ebs/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ec2/api_client.go b/service/ec2/api_client.go index 3e931c4d59c..da76d590215 100644 --- a/service/ec2/api_client.go +++ b/service/ec2/api_client.go @@ -66,6 +66,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ec2/auth.go b/service/ec2/auth.go index ff44fe06a1e..2e29d836bcc 100644 --- a/service/ec2/auth.go +++ b/service/ec2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ec2instanceconnect/api_client.go b/service/ec2instanceconnect/api_client.go index 3bb9f2fe7ca..82ca7d0417c 100644 --- a/service/ec2instanceconnect/api_client.go +++ b/service/ec2instanceconnect/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ec2instanceconnect/auth.go b/service/ec2instanceconnect/auth.go index 0abd6086586..024c19c37e2 100644 --- a/service/ec2instanceconnect/auth.go +++ b/service/ec2instanceconnect/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ecr/api_client.go b/service/ecr/api_client.go index d4fb594803f..17ca3499401 100644 --- a/service/ecr/api_client.go +++ b/service/ecr/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ecr/auth.go b/service/ecr/auth.go index 2e3b08c2d17..86ba7edf6b8 100644 --- a/service/ecr/auth.go +++ b/service/ecr/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ecrpublic/api_client.go b/service/ecrpublic/api_client.go index 243a6e52b55..581917e81bf 100644 --- a/service/ecrpublic/api_client.go +++ b/service/ecrpublic/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ecrpublic/auth.go b/service/ecrpublic/auth.go index 69f87ce6163..80729fbc78a 100644 --- a/service/ecrpublic/auth.go +++ b/service/ecrpublic/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ecs/api_client.go b/service/ecs/api_client.go index c026c1d50b8..3110e629762 100644 --- a/service/ecs/api_client.go +++ b/service/ecs/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ecs/auth.go b/service/ecs/auth.go index f7b0af9aae3..5aa04a20db8 100644 --- a/service/ecs/auth.go +++ b/service/ecs/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/efs/api_client.go b/service/efs/api_client.go index c70dbb02000..5669e1d2dd2 100644 --- a/service/efs/api_client.go +++ b/service/efs/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/efs/auth.go b/service/efs/auth.go index 1edab40b4da..f5d2e317fcd 100644 --- a/service/efs/auth.go +++ b/service/efs/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/eks/api_client.go b/service/eks/api_client.go index cd1896feeb0..70afb30e9a8 100644 --- a/service/eks/api_client.go +++ b/service/eks/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/eks/auth.go b/service/eks/auth.go index b42a5fc081f..8de3011f101 100644 --- a/service/eks/auth.go +++ b/service/eks/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/eksauth/api_client.go b/service/eksauth/api_client.go index 172cc5a26d0..73f70937bf5 100644 --- a/service/eksauth/api_client.go +++ b/service/eksauth/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/eksauth/auth.go b/service/eksauth/auth.go index 449470d8167..a1ce44f9076 100644 --- a/service/eksauth/auth.go +++ b/service/eksauth/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/elasticache/api_client.go b/service/elasticache/api_client.go index d2972a7f37f..67c38d29cd0 100644 --- a/service/elasticache/api_client.go +++ b/service/elasticache/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/elasticache/auth.go b/service/elasticache/auth.go index 59e3edcb790..fbd7f6111aa 100644 --- a/service/elasticache/auth.go +++ b/service/elasticache/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/elasticbeanstalk/api_client.go b/service/elasticbeanstalk/api_client.go index fb76bf7d76e..42467361982 100644 --- a/service/elasticbeanstalk/api_client.go +++ b/service/elasticbeanstalk/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/elasticbeanstalk/auth.go b/service/elasticbeanstalk/auth.go index bef04b3b807..cb63dd48eb6 100644 --- a/service/elasticbeanstalk/auth.go +++ b/service/elasticbeanstalk/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/elasticinference/api_client.go b/service/elasticinference/api_client.go index 8b6509a9807..2ee5eeaec84 100644 --- a/service/elasticinference/api_client.go +++ b/service/elasticinference/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/elasticinference/auth.go b/service/elasticinference/auth.go index f353fd620df..46398517c62 100644 --- a/service/elasticinference/auth.go +++ b/service/elasticinference/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/elasticloadbalancing/api_client.go b/service/elasticloadbalancing/api_client.go index 2976ab36929..663b2de3b0a 100644 --- a/service/elasticloadbalancing/api_client.go +++ b/service/elasticloadbalancing/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/elasticloadbalancing/auth.go b/service/elasticloadbalancing/auth.go index 254a8fd739c..b337a92f47e 100644 --- a/service/elasticloadbalancing/auth.go +++ b/service/elasticloadbalancing/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/elasticloadbalancingv2/api_client.go b/service/elasticloadbalancingv2/api_client.go index 10122f9d805..fb4092a6a34 100644 --- a/service/elasticloadbalancingv2/api_client.go +++ b/service/elasticloadbalancingv2/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/elasticloadbalancingv2/auth.go b/service/elasticloadbalancingv2/auth.go index aac8212c9f9..88459c677f4 100644 --- a/service/elasticloadbalancingv2/auth.go +++ b/service/elasticloadbalancingv2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/elasticsearchservice/api_client.go b/service/elasticsearchservice/api_client.go index 29600e9dd1f..6eeb3d388b1 100644 --- a/service/elasticsearchservice/api_client.go +++ b/service/elasticsearchservice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/elasticsearchservice/auth.go b/service/elasticsearchservice/auth.go index f640dcb7f17..15fe8b011f2 100644 --- a/service/elasticsearchservice/auth.go +++ b/service/elasticsearchservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/elastictranscoder/api_client.go b/service/elastictranscoder/api_client.go index 16e5033ceda..9769d091103 100644 --- a/service/elastictranscoder/api_client.go +++ b/service/elastictranscoder/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/elastictranscoder/auth.go b/service/elastictranscoder/auth.go index ef8808afaf4..161aee240ec 100644 --- a/service/elastictranscoder/auth.go +++ b/service/elastictranscoder/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/emr/api_client.go b/service/emr/api_client.go index a283d45f490..1cad0b849dd 100644 --- a/service/emr/api_client.go +++ b/service/emr/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/emr/auth.go b/service/emr/auth.go index 086691b136e..163f6cd1c0d 100644 --- a/service/emr/auth.go +++ b/service/emr/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/emrcontainers/api_client.go b/service/emrcontainers/api_client.go index 32f3fe56c8a..afe2d5d01ac 100644 --- a/service/emrcontainers/api_client.go +++ b/service/emrcontainers/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/emrcontainers/auth.go b/service/emrcontainers/auth.go index b8ce61c93a0..974f9db8255 100644 --- a/service/emrcontainers/auth.go +++ b/service/emrcontainers/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/emrserverless/api_client.go b/service/emrserverless/api_client.go index 4e23f2043f8..731380d9803 100644 --- a/service/emrserverless/api_client.go +++ b/service/emrserverless/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/emrserverless/auth.go b/service/emrserverless/auth.go index 3371d49c4d6..deb3f26d0e3 100644 --- a/service/emrserverless/auth.go +++ b/service/emrserverless/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/entityresolution/api_client.go b/service/entityresolution/api_client.go index 8845df5a377..2e389ff5b68 100644 --- a/service/entityresolution/api_client.go +++ b/service/entityresolution/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/entityresolution/auth.go b/service/entityresolution/auth.go index 2e34f4ec7cb..2f84e6c3c1a 100644 --- a/service/entityresolution/auth.go +++ b/service/entityresolution/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/eventbridge/auth.go b/service/eventbridge/auth.go index 50151e416c9..10df85af4f0 100644 --- a/service/eventbridge/auth.go +++ b/service/eventbridge/auth.go @@ -56,6 +56,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/eventbridge/endpoint_auth_resolver.go b/service/eventbridge/endpoint_auth_resolver.go index 950272ee3e0..c6fb16d42c6 100644 --- a/service/eventbridge/endpoint_auth_resolver.go +++ b/service/eventbridge/endpoint_auth_resolver.go @@ -19,6 +19,22 @@ func (r *endpointAuthResolver) ResolveAuthSchemes( ctx context.Context, params *AuthResolverParameters, ) ( []*smithyauth.Option, error, +) { + opts, err := r.resolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + // preserve pre-SRA behavior where everything technically had anonymous + return append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }), nil +} + +func (r *endpointAuthResolver) resolveAuthSchemes( + ctx context.Context, params *AuthResolverParameters, +) ( + []*smithyauth.Option, error, ) { endpt, err := r.EndpointResolver.ResolveEndpoint(ctx, *params.endpointParams) if err != nil { diff --git a/service/evidently/api_client.go b/service/evidently/api_client.go index 1fdd5ed91bd..4d0be6b0afe 100644 --- a/service/evidently/api_client.go +++ b/service/evidently/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/evidently/auth.go b/service/evidently/auth.go index 3978a2e030e..3a8a8a429f7 100644 --- a/service/evidently/auth.go +++ b/service/evidently/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/finspace/api_client.go b/service/finspace/api_client.go index e466b47d167..e829150a0ac 100644 --- a/service/finspace/api_client.go +++ b/service/finspace/api_client.go @@ -64,6 +64,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/finspace/auth.go b/service/finspace/auth.go index 7b5d0786e78..6095c338a3e 100644 --- a/service/finspace/auth.go +++ b/service/finspace/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/finspacedata/api_client.go b/service/finspacedata/api_client.go index b6a49d7e4f9..e9ff85bf39a 100644 --- a/service/finspacedata/api_client.go +++ b/service/finspacedata/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/finspacedata/auth.go b/service/finspacedata/auth.go index 2f1d54dbb20..cd1251577e0 100644 --- a/service/finspacedata/auth.go +++ b/service/finspacedata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/firehose/api_client.go b/service/firehose/api_client.go index 2e5a73ab989..b21452576f1 100644 --- a/service/firehose/api_client.go +++ b/service/firehose/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/firehose/auth.go b/service/firehose/auth.go index 72fbda96c48..7481cb66ed5 100644 --- a/service/firehose/auth.go +++ b/service/firehose/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/fis/api_client.go b/service/fis/api_client.go index ae25b5e7b94..5d8ce17508c 100644 --- a/service/fis/api_client.go +++ b/service/fis/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/fis/auth.go b/service/fis/auth.go index 685c03e2d78..1fdfb6d6b58 100644 --- a/service/fis/auth.go +++ b/service/fis/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/fms/api_client.go b/service/fms/api_client.go index 7dbbd404894..3eeb310c417 100644 --- a/service/fms/api_client.go +++ b/service/fms/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/fms/auth.go b/service/fms/auth.go index 8f3e2bfda31..2e5e9adeebb 100644 --- a/service/fms/auth.go +++ b/service/fms/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/forecast/api_client.go b/service/forecast/api_client.go index b9e37befdbc..aa44ce23c3f 100644 --- a/service/forecast/api_client.go +++ b/service/forecast/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/forecast/auth.go b/service/forecast/auth.go index 7bd1e23034a..b8aab0c76bf 100644 --- a/service/forecast/auth.go +++ b/service/forecast/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/forecastquery/api_client.go b/service/forecastquery/api_client.go index 4312d346641..61d1817ba1b 100644 --- a/service/forecastquery/api_client.go +++ b/service/forecastquery/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/forecastquery/auth.go b/service/forecastquery/auth.go index bb6345456d9..f0bce8c4315 100644 --- a/service/forecastquery/auth.go +++ b/service/forecastquery/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/frauddetector/api_client.go b/service/frauddetector/api_client.go index 3349eea8ac7..4591384c275 100644 --- a/service/frauddetector/api_client.go +++ b/service/frauddetector/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/frauddetector/auth.go b/service/frauddetector/auth.go index 07125816fe6..5250dd45969 100644 --- a/service/frauddetector/auth.go +++ b/service/frauddetector/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/freetier/api_client.go b/service/freetier/api_client.go index 0fa53d9dd3e..16e84927d8b 100644 --- a/service/freetier/api_client.go +++ b/service/freetier/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/freetier/auth.go b/service/freetier/auth.go index 328f470de66..a0ebc6c9548 100644 --- a/service/freetier/auth.go +++ b/service/freetier/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/fsx/api_client.go b/service/fsx/api_client.go index 9de48583a7c..45ee611d6ab 100644 --- a/service/fsx/api_client.go +++ b/service/fsx/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/fsx/auth.go b/service/fsx/auth.go index ac7b7d8a3ce..b76fcc777f7 100644 --- a/service/fsx/auth.go +++ b/service/fsx/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/gamelift/api_client.go b/service/gamelift/api_client.go index bb088fd7cb0..f8c3769c9f7 100644 --- a/service/gamelift/api_client.go +++ b/service/gamelift/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/gamelift/auth.go b/service/gamelift/auth.go index 7c4cbc1fdec..c94d706bb7e 100644 --- a/service/gamelift/auth.go +++ b/service/gamelift/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/glacier/api_client.go b/service/glacier/api_client.go index 6fc656e2396..27d348368d3 100644 --- a/service/glacier/api_client.go +++ b/service/glacier/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/glacier/auth.go b/service/glacier/auth.go index 83eb0881573..1717f878207 100644 --- a/service/glacier/auth.go +++ b/service/glacier/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/globalaccelerator/api_client.go b/service/globalaccelerator/api_client.go index fca9988bc9b..a7ce8f1ccdb 100644 --- a/service/globalaccelerator/api_client.go +++ b/service/globalaccelerator/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/globalaccelerator/auth.go b/service/globalaccelerator/auth.go index e41d6acade9..4cd6e297d35 100644 --- a/service/globalaccelerator/auth.go +++ b/service/globalaccelerator/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/glue/api_client.go b/service/glue/api_client.go index b255f672412..f585e8e3aff 100644 --- a/service/glue/api_client.go +++ b/service/glue/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/glue/auth.go b/service/glue/auth.go index bda1e172c01..e4f837742ce 100644 --- a/service/glue/auth.go +++ b/service/glue/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/grafana/api_client.go b/service/grafana/api_client.go index 92b969618fc..dc8e3cf8534 100644 --- a/service/grafana/api_client.go +++ b/service/grafana/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/grafana/auth.go b/service/grafana/auth.go index df5b03a2d2d..336ae476fb6 100644 --- a/service/grafana/auth.go +++ b/service/grafana/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/greengrass/api_client.go b/service/greengrass/api_client.go index 7c7b346ab78..1f240b37342 100644 --- a/service/greengrass/api_client.go +++ b/service/greengrass/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/greengrass/auth.go b/service/greengrass/auth.go index 44689a60a8b..020ca4e3efe 100644 --- a/service/greengrass/auth.go +++ b/service/greengrass/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/greengrassv2/api_client.go b/service/greengrassv2/api_client.go index a8dd59f2312..dcfac712120 100644 --- a/service/greengrassv2/api_client.go +++ b/service/greengrassv2/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/greengrassv2/auth.go b/service/greengrassv2/auth.go index 87f79b0110f..e65fd863f17 100644 --- a/service/greengrassv2/auth.go +++ b/service/greengrassv2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/groundstation/api_client.go b/service/groundstation/api_client.go index 9a275461e59..e12ffabff75 100644 --- a/service/groundstation/api_client.go +++ b/service/groundstation/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/groundstation/auth.go b/service/groundstation/auth.go index 60b3c46e78f..120c2285305 100644 --- a/service/groundstation/auth.go +++ b/service/groundstation/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/guardduty/api_client.go b/service/guardduty/api_client.go index 02889050c13..31b75aa71c7 100644 --- a/service/guardduty/api_client.go +++ b/service/guardduty/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/guardduty/auth.go b/service/guardduty/auth.go index 1920a38c662..c0187b3da94 100644 --- a/service/guardduty/auth.go +++ b/service/guardduty/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/health/api_client.go b/service/health/api_client.go index ea3476d1dec..8c9b663155e 100644 --- a/service/health/api_client.go +++ b/service/health/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/health/auth.go b/service/health/auth.go index 244aaeab614..4ec1bd7ad99 100644 --- a/service/health/auth.go +++ b/service/health/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/healthlake/api_client.go b/service/healthlake/api_client.go index 89aa793be2e..09ba20bb6ed 100644 --- a/service/healthlake/api_client.go +++ b/service/healthlake/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/healthlake/auth.go b/service/healthlake/auth.go index e2add0877b3..41c504098a6 100644 --- a/service/healthlake/auth.go +++ b/service/healthlake/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/honeycode/api_client.go b/service/honeycode/api_client.go index 242633cdc0c..76b2c591e73 100644 --- a/service/honeycode/api_client.go +++ b/service/honeycode/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/honeycode/auth.go b/service/honeycode/auth.go index 1985f7c6ef1..0b88434d806 100644 --- a/service/honeycode/auth.go +++ b/service/honeycode/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iam/api_client.go b/service/iam/api_client.go index d6e0b02531e..f77be1578f8 100644 --- a/service/iam/api_client.go +++ b/service/iam/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iam/auth.go b/service/iam/auth.go index f8383ea3e03..f7f5917156a 100644 --- a/service/iam/auth.go +++ b/service/iam/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/identitystore/api_client.go b/service/identitystore/api_client.go index 0d4da8feb19..7fa193ae0fa 100644 --- a/service/identitystore/api_client.go +++ b/service/identitystore/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/identitystore/auth.go b/service/identitystore/auth.go index 927ed8cc06d..57fc2a7b377 100644 --- a/service/identitystore/auth.go +++ b/service/identitystore/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/imagebuilder/api_client.go b/service/imagebuilder/api_client.go index 263fff6186d..11f4eccff31 100644 --- a/service/imagebuilder/api_client.go +++ b/service/imagebuilder/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/imagebuilder/auth.go b/service/imagebuilder/auth.go index 9809a06fc2f..a92e040d166 100644 --- a/service/imagebuilder/auth.go +++ b/service/imagebuilder/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/inspector/api_client.go b/service/inspector/api_client.go index 7d28049ffa6..6d0c547240a 100644 --- a/service/inspector/api_client.go +++ b/service/inspector/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/inspector/auth.go b/service/inspector/auth.go index 5f7cece800a..60736093ef4 100644 --- a/service/inspector/auth.go +++ b/service/inspector/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/inspector2/api_client.go b/service/inspector2/api_client.go index ec72adc5075..7239884f5b7 100644 --- a/service/inspector2/api_client.go +++ b/service/inspector2/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/inspector2/auth.go b/service/inspector2/auth.go index 53e034d1b1c..300dff2a278 100644 --- a/service/inspector2/auth.go +++ b/service/inspector2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/inspectorscan/api_client.go b/service/inspectorscan/api_client.go index 99e6b2c9b13..94dbd881654 100644 --- a/service/inspectorscan/api_client.go +++ b/service/inspectorscan/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/inspectorscan/auth.go b/service/inspectorscan/auth.go index c5172a8b678..e81c82b2a7a 100644 --- a/service/inspectorscan/auth.go +++ b/service/inspectorscan/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/internetmonitor/api_client.go b/service/internetmonitor/api_client.go index c7fe452f84a..6d6f7db2152 100644 --- a/service/internetmonitor/api_client.go +++ b/service/internetmonitor/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/internetmonitor/auth.go b/service/internetmonitor/auth.go index 79d6807b7c4..1b9db4666d2 100644 --- a/service/internetmonitor/auth.go +++ b/service/internetmonitor/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iot/api_client.go b/service/iot/api_client.go index 9dcc3e21559..0430253100e 100644 --- a/service/iot/api_client.go +++ b/service/iot/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iot/auth.go b/service/iot/auth.go index 282af9f41b5..f93b65e53b8 100644 --- a/service/iot/auth.go +++ b/service/iot/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iot1clickdevicesservice/api_client.go b/service/iot1clickdevicesservice/api_client.go index e5977c75e2f..8c9e87e65a9 100644 --- a/service/iot1clickdevicesservice/api_client.go +++ b/service/iot1clickdevicesservice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iot1clickdevicesservice/auth.go b/service/iot1clickdevicesservice/auth.go index 44b04a24ba3..5a87b0f6beb 100644 --- a/service/iot1clickdevicesservice/auth.go +++ b/service/iot1clickdevicesservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iot1clickprojects/api_client.go b/service/iot1clickprojects/api_client.go index d183273307a..72f597e3158 100644 --- a/service/iot1clickprojects/api_client.go +++ b/service/iot1clickprojects/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iot1clickprojects/auth.go b/service/iot1clickprojects/auth.go index a04166228a5..be8461a7418 100644 --- a/service/iot1clickprojects/auth.go +++ b/service/iot1clickprojects/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotanalytics/api_client.go b/service/iotanalytics/api_client.go index e7e26601300..85af1a489f0 100644 --- a/service/iotanalytics/api_client.go +++ b/service/iotanalytics/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotanalytics/auth.go b/service/iotanalytics/auth.go index 4224f05c3d2..5e1bc48b217 100644 --- a/service/iotanalytics/auth.go +++ b/service/iotanalytics/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotdataplane/api_client.go b/service/iotdataplane/api_client.go index ee9d07034c0..2512ee050b8 100644 --- a/service/iotdataplane/api_client.go +++ b/service/iotdataplane/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotdataplane/auth.go b/service/iotdataplane/auth.go index e2cd262df69..bcd7e31a15a 100644 --- a/service/iotdataplane/auth.go +++ b/service/iotdataplane/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotdeviceadvisor/api_client.go b/service/iotdeviceadvisor/api_client.go index a25e2f8f2a4..e4981fb28ce 100644 --- a/service/iotdeviceadvisor/api_client.go +++ b/service/iotdeviceadvisor/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotdeviceadvisor/auth.go b/service/iotdeviceadvisor/auth.go index 4ca226a62b6..f0aac369978 100644 --- a/service/iotdeviceadvisor/auth.go +++ b/service/iotdeviceadvisor/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotevents/api_client.go b/service/iotevents/api_client.go index 62ef9a10f45..76cf98c71fd 100644 --- a/service/iotevents/api_client.go +++ b/service/iotevents/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotevents/auth.go b/service/iotevents/auth.go index 431e4fb5e7b..939517f776b 100644 --- a/service/iotevents/auth.go +++ b/service/iotevents/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ioteventsdata/api_client.go b/service/ioteventsdata/api_client.go index ae014fd91ac..bca737f0797 100644 --- a/service/ioteventsdata/api_client.go +++ b/service/ioteventsdata/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ioteventsdata/auth.go b/service/ioteventsdata/auth.go index d7b4f7859a1..2c70588bff5 100644 --- a/service/ioteventsdata/auth.go +++ b/service/ioteventsdata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotfleethub/api_client.go b/service/iotfleethub/api_client.go index 7d681e0e035..5dc3681e8a3 100644 --- a/service/iotfleethub/api_client.go +++ b/service/iotfleethub/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotfleethub/auth.go b/service/iotfleethub/auth.go index aaf5a8386a2..0d2df7e3252 100644 --- a/service/iotfleethub/auth.go +++ b/service/iotfleethub/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotfleetwise/api_client.go b/service/iotfleetwise/api_client.go index f0ea3070ec2..c696b97b9ca 100644 --- a/service/iotfleetwise/api_client.go +++ b/service/iotfleetwise/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotfleetwise/auth.go b/service/iotfleetwise/auth.go index 804580b816c..de7d6acd364 100644 --- a/service/iotfleetwise/auth.go +++ b/service/iotfleetwise/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotjobsdataplane/api_client.go b/service/iotjobsdataplane/api_client.go index dcb0cdbf62e..49838f07ae4 100644 --- a/service/iotjobsdataplane/api_client.go +++ b/service/iotjobsdataplane/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotjobsdataplane/auth.go b/service/iotjobsdataplane/auth.go index 148dd3d0ac6..a6801b8c1b4 100644 --- a/service/iotjobsdataplane/auth.go +++ b/service/iotjobsdataplane/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotroborunner/api_client.go b/service/iotroborunner/api_client.go index 8dda3254989..ccb4ff8860c 100644 --- a/service/iotroborunner/api_client.go +++ b/service/iotroborunner/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotroborunner/auth.go b/service/iotroborunner/auth.go index 7e2008a9b95..697a1a31481 100644 --- a/service/iotroborunner/auth.go +++ b/service/iotroborunner/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotsecuretunneling/api_client.go b/service/iotsecuretunneling/api_client.go index 785f0b8bf94..3141eba1d7a 100644 --- a/service/iotsecuretunneling/api_client.go +++ b/service/iotsecuretunneling/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotsecuretunneling/auth.go b/service/iotsecuretunneling/auth.go index fa657b2e8fa..d12b1128098 100644 --- a/service/iotsecuretunneling/auth.go +++ b/service/iotsecuretunneling/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotsitewise/api_client.go b/service/iotsitewise/api_client.go index 61db04b2580..736d3b1e3a9 100644 --- a/service/iotsitewise/api_client.go +++ b/service/iotsitewise/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotsitewise/auth.go b/service/iotsitewise/auth.go index c7abe095779..95d3461977a 100644 --- a/service/iotsitewise/auth.go +++ b/service/iotsitewise/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotthingsgraph/api_client.go b/service/iotthingsgraph/api_client.go index 376df929daa..bf2f5044af0 100644 --- a/service/iotthingsgraph/api_client.go +++ b/service/iotthingsgraph/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotthingsgraph/auth.go b/service/iotthingsgraph/auth.go index aa0b15aafba..e921eea19a9 100644 --- a/service/iotthingsgraph/auth.go +++ b/service/iotthingsgraph/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iottwinmaker/api_client.go b/service/iottwinmaker/api_client.go index 09136a3189a..ccec2c8a673 100644 --- a/service/iottwinmaker/api_client.go +++ b/service/iottwinmaker/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iottwinmaker/auth.go b/service/iottwinmaker/auth.go index cee16d2d496..4082445a598 100644 --- a/service/iottwinmaker/auth.go +++ b/service/iottwinmaker/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/iotwireless/api_client.go b/service/iotwireless/api_client.go index 254d0e8a0b5..a542874a652 100644 --- a/service/iotwireless/api_client.go +++ b/service/iotwireless/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/iotwireless/auth.go b/service/iotwireless/auth.go index 7bbea0e50ad..e1533afc719 100644 --- a/service/iotwireless/auth.go +++ b/service/iotwireless/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ivs/api_client.go b/service/ivs/api_client.go index a318f603a64..e506e9c00e9 100644 --- a/service/ivs/api_client.go +++ b/service/ivs/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ivs/auth.go b/service/ivs/auth.go index cb8c2dd9189..f9c868d5f5b 100644 --- a/service/ivs/auth.go +++ b/service/ivs/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ivschat/api_client.go b/service/ivschat/api_client.go index ebeb3637924..d968f78cc8a 100644 --- a/service/ivschat/api_client.go +++ b/service/ivschat/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ivschat/auth.go b/service/ivschat/auth.go index 5fe11a511ad..8a7d30529c1 100644 --- a/service/ivschat/auth.go +++ b/service/ivschat/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ivsrealtime/api_client.go b/service/ivsrealtime/api_client.go index c738771fcae..6affda49c41 100644 --- a/service/ivsrealtime/api_client.go +++ b/service/ivsrealtime/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ivsrealtime/auth.go b/service/ivsrealtime/auth.go index cbff77d2a59..68eb6c1b273 100644 --- a/service/ivsrealtime/auth.go +++ b/service/ivsrealtime/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kafka/api_client.go b/service/kafka/api_client.go index 15502a8e3b8..8ff975aaf1a 100644 --- a/service/kafka/api_client.go +++ b/service/kafka/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kafka/auth.go b/service/kafka/auth.go index b55c22c0243..01c30d877a0 100644 --- a/service/kafka/auth.go +++ b/service/kafka/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kafkaconnect/api_client.go b/service/kafkaconnect/api_client.go index d6a788cd2df..e8b477e945c 100644 --- a/service/kafkaconnect/api_client.go +++ b/service/kafkaconnect/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kafkaconnect/auth.go b/service/kafkaconnect/auth.go index 24ad8b3b4a3..75479b40336 100644 --- a/service/kafkaconnect/auth.go +++ b/service/kafkaconnect/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kendra/api_client.go b/service/kendra/api_client.go index 0ae9b7be900..a10c61dd0b1 100644 --- a/service/kendra/api_client.go +++ b/service/kendra/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kendra/auth.go b/service/kendra/auth.go index 0b3c544d9c6..0f13f7f8a0a 100644 --- a/service/kendra/auth.go +++ b/service/kendra/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kendraranking/api_client.go b/service/kendraranking/api_client.go index 36d64e87ec0..4fb82b42ead 100644 --- a/service/kendraranking/api_client.go +++ b/service/kendraranking/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kendraranking/auth.go b/service/kendraranking/auth.go index 4c47bbcc808..30fcdd4b20c 100644 --- a/service/kendraranking/auth.go +++ b/service/kendraranking/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/keyspaces/api_client.go b/service/keyspaces/api_client.go index be1e4d86220..ab2c21e30de 100644 --- a/service/keyspaces/api_client.go +++ b/service/keyspaces/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/keyspaces/auth.go b/service/keyspaces/auth.go index 12c2fc3fe34..56b83a4a676 100644 --- a/service/keyspaces/auth.go +++ b/service/keyspaces/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kinesis/api_client.go b/service/kinesis/api_client.go index 77a596a6366..ee780f199e8 100644 --- a/service/kinesis/api_client.go +++ b/service/kinesis/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kinesis/auth.go b/service/kinesis/auth.go index 0edf8a93dea..0702f8afad6 100644 --- a/service/kinesis/auth.go +++ b/service/kinesis/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kinesisanalytics/api_client.go b/service/kinesisanalytics/api_client.go index d9caf98653b..4454d1fa8e5 100644 --- a/service/kinesisanalytics/api_client.go +++ b/service/kinesisanalytics/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kinesisanalytics/auth.go b/service/kinesisanalytics/auth.go index 7740b003176..b588328b8fb 100644 --- a/service/kinesisanalytics/auth.go +++ b/service/kinesisanalytics/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kinesisanalyticsv2/api_client.go b/service/kinesisanalyticsv2/api_client.go index 712c6f07a16..6a7a09e494e 100644 --- a/service/kinesisanalyticsv2/api_client.go +++ b/service/kinesisanalyticsv2/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kinesisanalyticsv2/auth.go b/service/kinesisanalyticsv2/auth.go index 9917a479646..72d79992f4e 100644 --- a/service/kinesisanalyticsv2/auth.go +++ b/service/kinesisanalyticsv2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kinesisvideo/api_client.go b/service/kinesisvideo/api_client.go index 83fc7c95f9a..62ff7cb468c 100644 --- a/service/kinesisvideo/api_client.go +++ b/service/kinesisvideo/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kinesisvideo/auth.go b/service/kinesisvideo/auth.go index 5e6dd5b28b9..8d90b1f6265 100644 --- a/service/kinesisvideo/auth.go +++ b/service/kinesisvideo/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kinesisvideoarchivedmedia/api_client.go b/service/kinesisvideoarchivedmedia/api_client.go index ee77a327af6..4973259a020 100644 --- a/service/kinesisvideoarchivedmedia/api_client.go +++ b/service/kinesisvideoarchivedmedia/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kinesisvideoarchivedmedia/auth.go b/service/kinesisvideoarchivedmedia/auth.go index 476ab356b93..320e348943a 100644 --- a/service/kinesisvideoarchivedmedia/auth.go +++ b/service/kinesisvideoarchivedmedia/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kinesisvideomedia/api_client.go b/service/kinesisvideomedia/api_client.go index bb97da70835..a6c52110a4e 100644 --- a/service/kinesisvideomedia/api_client.go +++ b/service/kinesisvideomedia/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kinesisvideomedia/auth.go b/service/kinesisvideomedia/auth.go index 4de32d363bb..08ed5503a49 100644 --- a/service/kinesisvideomedia/auth.go +++ b/service/kinesisvideomedia/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kinesisvideosignaling/api_client.go b/service/kinesisvideosignaling/api_client.go index 55531773312..6fe9c637a3d 100644 --- a/service/kinesisvideosignaling/api_client.go +++ b/service/kinesisvideosignaling/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kinesisvideosignaling/auth.go b/service/kinesisvideosignaling/auth.go index b0174e1e7f5..33d74b57825 100644 --- a/service/kinesisvideosignaling/auth.go +++ b/service/kinesisvideosignaling/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kinesisvideowebrtcstorage/api_client.go b/service/kinesisvideowebrtcstorage/api_client.go index 628bc5d316d..03afefef6fd 100644 --- a/service/kinesisvideowebrtcstorage/api_client.go +++ b/service/kinesisvideowebrtcstorage/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kinesisvideowebrtcstorage/auth.go b/service/kinesisvideowebrtcstorage/auth.go index f8bb222f721..6ccefb2a3b0 100644 --- a/service/kinesisvideowebrtcstorage/auth.go +++ b/service/kinesisvideowebrtcstorage/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/kms/api_client.go b/service/kms/api_client.go index d756de129f3..fe6e86d4059 100644 --- a/service/kms/api_client.go +++ b/service/kms/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/kms/auth.go b/service/kms/auth.go index dafb70143a2..16619a43751 100644 --- a/service/kms/auth.go +++ b/service/kms/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lakeformation/api_client.go b/service/lakeformation/api_client.go index 840fa16831a..26a31746c55 100644 --- a/service/lakeformation/api_client.go +++ b/service/lakeformation/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lakeformation/auth.go b/service/lakeformation/auth.go index 1683565cecd..7091cfcb8f3 100644 --- a/service/lakeformation/auth.go +++ b/service/lakeformation/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lambda/api_client.go b/service/lambda/api_client.go index 3a9fc2da90e..c051fa84cea 100644 --- a/service/lambda/api_client.go +++ b/service/lambda/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lambda/auth.go b/service/lambda/auth.go index f2944f9af6b..200f694bbba 100644 --- a/service/lambda/auth.go +++ b/service/lambda/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/launchwizard/api_client.go b/service/launchwizard/api_client.go index aec1a554425..344f572d10f 100644 --- a/service/launchwizard/api_client.go +++ b/service/launchwizard/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/launchwizard/auth.go b/service/launchwizard/auth.go index b581d30215b..02543832307 100644 --- a/service/launchwizard/auth.go +++ b/service/launchwizard/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lexmodelbuildingservice/api_client.go b/service/lexmodelbuildingservice/api_client.go index ca0398900d1..3a1fa0b0741 100644 --- a/service/lexmodelbuildingservice/api_client.go +++ b/service/lexmodelbuildingservice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lexmodelbuildingservice/auth.go b/service/lexmodelbuildingservice/auth.go index cc9da7f51c2..855958233cd 100644 --- a/service/lexmodelbuildingservice/auth.go +++ b/service/lexmodelbuildingservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lexmodelsv2/api_client.go b/service/lexmodelsv2/api_client.go index b094c20635c..9bab6926256 100644 --- a/service/lexmodelsv2/api_client.go +++ b/service/lexmodelsv2/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lexmodelsv2/auth.go b/service/lexmodelsv2/auth.go index cf26e27e945..2e4a3cd17eb 100644 --- a/service/lexmodelsv2/auth.go +++ b/service/lexmodelsv2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lexruntimeservice/api_client.go b/service/lexruntimeservice/api_client.go index f3ca76bbcc2..c6aaf751742 100644 --- a/service/lexruntimeservice/api_client.go +++ b/service/lexruntimeservice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lexruntimeservice/auth.go b/service/lexruntimeservice/auth.go index 49b0417033d..7d399d0f393 100644 --- a/service/lexruntimeservice/auth.go +++ b/service/lexruntimeservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lexruntimev2/api_client.go b/service/lexruntimev2/api_client.go index 491ab3d844a..2e29b5661b9 100644 --- a/service/lexruntimev2/api_client.go +++ b/service/lexruntimev2/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lexruntimev2/auth.go b/service/lexruntimev2/auth.go index fe198feb817..ae56fab8e1e 100644 --- a/service/lexruntimev2/auth.go +++ b/service/lexruntimev2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/licensemanager/api_client.go b/service/licensemanager/api_client.go index 1d72424fee9..ca3750e02ac 100644 --- a/service/licensemanager/api_client.go +++ b/service/licensemanager/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/licensemanager/auth.go b/service/licensemanager/auth.go index 525edf0e868..d31986262d4 100644 --- a/service/licensemanager/auth.go +++ b/service/licensemanager/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/licensemanagerlinuxsubscriptions/api_client.go b/service/licensemanagerlinuxsubscriptions/api_client.go index 51ccaca2044..cf04c6a4200 100644 --- a/service/licensemanagerlinuxsubscriptions/api_client.go +++ b/service/licensemanagerlinuxsubscriptions/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/licensemanagerlinuxsubscriptions/auth.go b/service/licensemanagerlinuxsubscriptions/auth.go index d4448b80a2f..496c786519d 100644 --- a/service/licensemanagerlinuxsubscriptions/auth.go +++ b/service/licensemanagerlinuxsubscriptions/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/licensemanagerusersubscriptions/api_client.go b/service/licensemanagerusersubscriptions/api_client.go index 3f67487de1c..7dc34f2c5df 100644 --- a/service/licensemanagerusersubscriptions/api_client.go +++ b/service/licensemanagerusersubscriptions/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/licensemanagerusersubscriptions/auth.go b/service/licensemanagerusersubscriptions/auth.go index ddc677d8eb6..b9bd20f3bdd 100644 --- a/service/licensemanagerusersubscriptions/auth.go +++ b/service/licensemanagerusersubscriptions/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lightsail/api_client.go b/service/lightsail/api_client.go index 1adcf656298..3a842e845b8 100644 --- a/service/lightsail/api_client.go +++ b/service/lightsail/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lightsail/auth.go b/service/lightsail/auth.go index 284426e2e49..ead0dd5f2fd 100644 --- a/service/lightsail/auth.go +++ b/service/lightsail/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/location/api_client.go b/service/location/api_client.go index 3234c56295b..62f60acaeca 100644 --- a/service/location/api_client.go +++ b/service/location/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/location/auth.go b/service/location/auth.go index 4b02dab964d..ed1aedaf4a6 100644 --- a/service/location/auth.go +++ b/service/location/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lookoutequipment/api_client.go b/service/lookoutequipment/api_client.go index b3687ffc5f6..080630697e7 100644 --- a/service/lookoutequipment/api_client.go +++ b/service/lookoutequipment/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lookoutequipment/auth.go b/service/lookoutequipment/auth.go index 60510b228a9..d15f3f05e4d 100644 --- a/service/lookoutequipment/auth.go +++ b/service/lookoutequipment/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lookoutmetrics/api_client.go b/service/lookoutmetrics/api_client.go index abbf5a4c717..a1cfa5d5717 100644 --- a/service/lookoutmetrics/api_client.go +++ b/service/lookoutmetrics/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lookoutmetrics/auth.go b/service/lookoutmetrics/auth.go index 2da4833417e..c2aef4c15d9 100644 --- a/service/lookoutmetrics/auth.go +++ b/service/lookoutmetrics/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/lookoutvision/api_client.go b/service/lookoutvision/api_client.go index a6763d3cba6..08e5e3be381 100644 --- a/service/lookoutvision/api_client.go +++ b/service/lookoutvision/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/lookoutvision/auth.go b/service/lookoutvision/auth.go index eea9e6a7fb5..c13d3ef3a71 100644 --- a/service/lookoutvision/auth.go +++ b/service/lookoutvision/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/m2/api_client.go b/service/m2/api_client.go index 075ea77cb70..93885e719b4 100644 --- a/service/m2/api_client.go +++ b/service/m2/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/m2/auth.go b/service/m2/auth.go index c0daf260faa..b0ca0a88579 100644 --- a/service/m2/auth.go +++ b/service/m2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/machinelearning/api_client.go b/service/machinelearning/api_client.go index 2697baac56a..ee40382f891 100644 --- a/service/machinelearning/api_client.go +++ b/service/machinelearning/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/machinelearning/auth.go b/service/machinelearning/auth.go index 4c0d6ada9c3..b43ad6a0989 100644 --- a/service/machinelearning/auth.go +++ b/service/machinelearning/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/macie2/api_client.go b/service/macie2/api_client.go index e8c640db266..e2d618c92a3 100644 --- a/service/macie2/api_client.go +++ b/service/macie2/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/macie2/auth.go b/service/macie2/auth.go index 600cd18c88b..b383ee11f22 100644 --- a/service/macie2/auth.go +++ b/service/macie2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/managedblockchain/api_client.go b/service/managedblockchain/api_client.go index 88f3fec76c3..09a85304135 100644 --- a/service/managedblockchain/api_client.go +++ b/service/managedblockchain/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/managedblockchain/auth.go b/service/managedblockchain/auth.go index 917207eae24..6bb7ffb526c 100644 --- a/service/managedblockchain/auth.go +++ b/service/managedblockchain/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/managedblockchainquery/api_client.go b/service/managedblockchainquery/api_client.go index c96dc5bd91e..b682468eb61 100644 --- a/service/managedblockchainquery/api_client.go +++ b/service/managedblockchainquery/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/managedblockchainquery/auth.go b/service/managedblockchainquery/auth.go index 385efa2e9ce..64a0ee71614 100644 --- a/service/managedblockchainquery/auth.go +++ b/service/managedblockchainquery/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/marketplaceagreement/api_client.go b/service/marketplaceagreement/api_client.go index 2b651d5cadc..c30ae2ec6ac 100644 --- a/service/marketplaceagreement/api_client.go +++ b/service/marketplaceagreement/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/marketplaceagreement/auth.go b/service/marketplaceagreement/auth.go index 331dd8d0bf8..e1158bbbfc5 100644 --- a/service/marketplaceagreement/auth.go +++ b/service/marketplaceagreement/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/marketplacecatalog/api_client.go b/service/marketplacecatalog/api_client.go index 9c084a4ec10..d84fa68f924 100644 --- a/service/marketplacecatalog/api_client.go +++ b/service/marketplacecatalog/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/marketplacecatalog/auth.go b/service/marketplacecatalog/auth.go index caeed14ead5..98603fa0055 100644 --- a/service/marketplacecatalog/auth.go +++ b/service/marketplacecatalog/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/marketplacecommerceanalytics/api_client.go b/service/marketplacecommerceanalytics/api_client.go index 17346e7f7b3..422a47c9281 100644 --- a/service/marketplacecommerceanalytics/api_client.go +++ b/service/marketplacecommerceanalytics/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/marketplacecommerceanalytics/auth.go b/service/marketplacecommerceanalytics/auth.go index 8a27be9101f..f72a1ed55b5 100644 --- a/service/marketplacecommerceanalytics/auth.go +++ b/service/marketplacecommerceanalytics/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/marketplacedeployment/api_client.go b/service/marketplacedeployment/api_client.go index edfbf3d0aed..2523075be1b 100644 --- a/service/marketplacedeployment/api_client.go +++ b/service/marketplacedeployment/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/marketplacedeployment/auth.go b/service/marketplacedeployment/auth.go index c5554e5fd0b..6081e5a7ee2 100644 --- a/service/marketplacedeployment/auth.go +++ b/service/marketplacedeployment/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/marketplaceentitlementservice/api_client.go b/service/marketplaceentitlementservice/api_client.go index acf0c467fd4..b240810e07c 100644 --- a/service/marketplaceentitlementservice/api_client.go +++ b/service/marketplaceentitlementservice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/marketplaceentitlementservice/auth.go b/service/marketplaceentitlementservice/auth.go index 700a6e2912b..f75c7f9d95a 100644 --- a/service/marketplaceentitlementservice/auth.go +++ b/service/marketplaceentitlementservice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/marketplacemetering/api_client.go b/service/marketplacemetering/api_client.go index dfec2eee3d1..e61e2d88394 100644 --- a/service/marketplacemetering/api_client.go +++ b/service/marketplacemetering/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/marketplacemetering/auth.go b/service/marketplacemetering/auth.go index b3c2014e00f..c1bf21503b1 100644 --- a/service/marketplacemetering/auth.go +++ b/service/marketplacemetering/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mediaconnect/api_client.go b/service/mediaconnect/api_client.go index 403074e0edf..9a34c528a79 100644 --- a/service/mediaconnect/api_client.go +++ b/service/mediaconnect/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mediaconnect/auth.go b/service/mediaconnect/auth.go index 7603eac67fa..4df5cfc35e8 100644 --- a/service/mediaconnect/auth.go +++ b/service/mediaconnect/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mediaconvert/api_client.go b/service/mediaconvert/api_client.go index 3fbcaa76d79..28420ecba12 100644 --- a/service/mediaconvert/api_client.go +++ b/service/mediaconvert/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mediaconvert/auth.go b/service/mediaconvert/auth.go index eeba6ab062f..f82fcebb752 100644 --- a/service/mediaconvert/auth.go +++ b/service/mediaconvert/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/medialive/api_client.go b/service/medialive/api_client.go index 30cdb9879a7..7e0a047f97c 100644 --- a/service/medialive/api_client.go +++ b/service/medialive/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/medialive/auth.go b/service/medialive/auth.go index 8cde1810048..46fb5302d22 100644 --- a/service/medialive/auth.go +++ b/service/medialive/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mediapackage/api_client.go b/service/mediapackage/api_client.go index 6ddb5e541db..381bbdbe4da 100644 --- a/service/mediapackage/api_client.go +++ b/service/mediapackage/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mediapackage/auth.go b/service/mediapackage/auth.go index 235d987ea87..c0c4052adc4 100644 --- a/service/mediapackage/auth.go +++ b/service/mediapackage/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mediapackagev2/api_client.go b/service/mediapackagev2/api_client.go index 19fbfafb5d3..d37facea292 100644 --- a/service/mediapackagev2/api_client.go +++ b/service/mediapackagev2/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mediapackagev2/auth.go b/service/mediapackagev2/auth.go index 1ecf7f507d1..27bb7dc022e 100644 --- a/service/mediapackagev2/auth.go +++ b/service/mediapackagev2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mediapackagevod/api_client.go b/service/mediapackagevod/api_client.go index 9596737b950..c40723ef4fd 100644 --- a/service/mediapackagevod/api_client.go +++ b/service/mediapackagevod/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mediapackagevod/auth.go b/service/mediapackagevod/auth.go index 2781b59eee3..11fbafdc5e2 100644 --- a/service/mediapackagevod/auth.go +++ b/service/mediapackagevod/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mediastore/api_client.go b/service/mediastore/api_client.go index 0276f59d9e7..f2b92a1cfde 100644 --- a/service/mediastore/api_client.go +++ b/service/mediastore/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mediastore/auth.go b/service/mediastore/auth.go index 5f875e0c7a1..9c4b4f065e2 100644 --- a/service/mediastore/auth.go +++ b/service/mediastore/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mediastoredata/api_client.go b/service/mediastoredata/api_client.go index 8e9ddb939de..4e3edb06f17 100644 --- a/service/mediastoredata/api_client.go +++ b/service/mediastoredata/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mediastoredata/auth.go b/service/mediastoredata/auth.go index e94992cd400..5a1fd4fe886 100644 --- a/service/mediastoredata/auth.go +++ b/service/mediastoredata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mediatailor/api_client.go b/service/mediatailor/api_client.go index b6e704597c4..7977fda3426 100644 --- a/service/mediatailor/api_client.go +++ b/service/mediatailor/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mediatailor/auth.go b/service/mediatailor/auth.go index 71cb057650d..4d3bf974c6a 100644 --- a/service/mediatailor/auth.go +++ b/service/mediatailor/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/medicalimaging/api_client.go b/service/medicalimaging/api_client.go index 4c04584e1b5..14ac627accb 100644 --- a/service/medicalimaging/api_client.go +++ b/service/medicalimaging/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/medicalimaging/auth.go b/service/medicalimaging/auth.go index 9f980ebcd2d..1650413683e 100644 --- a/service/medicalimaging/auth.go +++ b/service/medicalimaging/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/memorydb/api_client.go b/service/memorydb/api_client.go index a14c464fe3b..d8cf56d8673 100644 --- a/service/memorydb/api_client.go +++ b/service/memorydb/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/memorydb/auth.go b/service/memorydb/auth.go index 554f3dd3a52..9ea7dc9d2b7 100644 --- a/service/memorydb/auth.go +++ b/service/memorydb/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mgn/api_client.go b/service/mgn/api_client.go index e0b701907d7..eef09fabd57 100644 --- a/service/mgn/api_client.go +++ b/service/mgn/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mgn/auth.go b/service/mgn/auth.go index da41a054cab..033ec36a96a 100644 --- a/service/mgn/auth.go +++ b/service/mgn/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/migrationhub/api_client.go b/service/migrationhub/api_client.go index 0cfb6fa63c0..48cd7924dff 100644 --- a/service/migrationhub/api_client.go +++ b/service/migrationhub/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/migrationhub/auth.go b/service/migrationhub/auth.go index cf2c097ff41..d89541b35d6 100644 --- a/service/migrationhub/auth.go +++ b/service/migrationhub/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/migrationhubconfig/api_client.go b/service/migrationhubconfig/api_client.go index c3baa3a15e0..a1d0e2343b4 100644 --- a/service/migrationhubconfig/api_client.go +++ b/service/migrationhubconfig/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/migrationhubconfig/auth.go b/service/migrationhubconfig/auth.go index 7b0f6a61cd1..267a296e096 100644 --- a/service/migrationhubconfig/auth.go +++ b/service/migrationhubconfig/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/migrationhuborchestrator/api_client.go b/service/migrationhuborchestrator/api_client.go index e77d65e7988..7242be8a5d0 100644 --- a/service/migrationhuborchestrator/api_client.go +++ b/service/migrationhuborchestrator/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/migrationhuborchestrator/auth.go b/service/migrationhuborchestrator/auth.go index effeb59dbdf..dc6fe954b50 100644 --- a/service/migrationhuborchestrator/auth.go +++ b/service/migrationhuborchestrator/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/migrationhubrefactorspaces/api_client.go b/service/migrationhubrefactorspaces/api_client.go index 9850c79fee7..bdce214e0d8 100644 --- a/service/migrationhubrefactorspaces/api_client.go +++ b/service/migrationhubrefactorspaces/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/migrationhubrefactorspaces/auth.go b/service/migrationhubrefactorspaces/auth.go index 2b44bd04794..79884622158 100644 --- a/service/migrationhubrefactorspaces/auth.go +++ b/service/migrationhubrefactorspaces/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/migrationhubstrategy/api_client.go b/service/migrationhubstrategy/api_client.go index 62d1ce68c89..119c4d94006 100644 --- a/service/migrationhubstrategy/api_client.go +++ b/service/migrationhubstrategy/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/migrationhubstrategy/auth.go b/service/migrationhubstrategy/auth.go index 74bce681d74..c26be3e35df 100644 --- a/service/migrationhubstrategy/auth.go +++ b/service/migrationhubstrategy/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mobile/api_client.go b/service/mobile/api_client.go index b6059eaba9f..65d53f04dc4 100644 --- a/service/mobile/api_client.go +++ b/service/mobile/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mobile/auth.go b/service/mobile/auth.go index ef71bb5e262..0359b30e4ec 100644 --- a/service/mobile/auth.go +++ b/service/mobile/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mq/api_client.go b/service/mq/api_client.go index c89023e92e9..80ee1af832c 100644 --- a/service/mq/api_client.go +++ b/service/mq/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mq/auth.go b/service/mq/auth.go index 8197c62bfbd..b4bd0b92966 100644 --- a/service/mq/auth.go +++ b/service/mq/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mturk/api_client.go b/service/mturk/api_client.go index 64bcadf3871..a0391bb52d9 100644 --- a/service/mturk/api_client.go +++ b/service/mturk/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mturk/auth.go b/service/mturk/auth.go index f466f09403d..5ab097b2808 100644 --- a/service/mturk/auth.go +++ b/service/mturk/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/mwaa/api_client.go b/service/mwaa/api_client.go index 0febd0674e3..acfcb909f51 100644 --- a/service/mwaa/api_client.go +++ b/service/mwaa/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/mwaa/auth.go b/service/mwaa/auth.go index 718d1aed129..06e66fb967b 100644 --- a/service/mwaa/auth.go +++ b/service/mwaa/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/neptune/api_client.go b/service/neptune/api_client.go index 25177e08c70..84872ba10ee 100644 --- a/service/neptune/api_client.go +++ b/service/neptune/api_client.go @@ -61,6 +61,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/neptune/auth.go b/service/neptune/auth.go index a3c48ba1389..ca9d419446f 100644 --- a/service/neptune/auth.go +++ b/service/neptune/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/neptunedata/api_client.go b/service/neptunedata/api_client.go index da0cf1b4526..8592ca9d371 100644 --- a/service/neptunedata/api_client.go +++ b/service/neptunedata/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/neptunedata/auth.go b/service/neptunedata/auth.go index cedbfab6ed7..92a6c9c0527 100644 --- a/service/neptunedata/auth.go +++ b/service/neptunedata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/networkfirewall/api_client.go b/service/networkfirewall/api_client.go index 7f4112d9ac5..0ca0d76c687 100644 --- a/service/networkfirewall/api_client.go +++ b/service/networkfirewall/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/networkfirewall/auth.go b/service/networkfirewall/auth.go index 8ee25d682b4..1b9402e8cc9 100644 --- a/service/networkfirewall/auth.go +++ b/service/networkfirewall/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/networkmanager/api_client.go b/service/networkmanager/api_client.go index 14ef55db707..6c77c2c808b 100644 --- a/service/networkmanager/api_client.go +++ b/service/networkmanager/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/networkmanager/auth.go b/service/networkmanager/auth.go index 481ebb4e813..93a4a98aff4 100644 --- a/service/networkmanager/auth.go +++ b/service/networkmanager/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/nimble/api_client.go b/service/nimble/api_client.go index 584986a5d6d..7e306a6ee94 100644 --- a/service/nimble/api_client.go +++ b/service/nimble/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/nimble/auth.go b/service/nimble/auth.go index 62c671dc15c..a132e9880ab 100644 --- a/service/nimble/auth.go +++ b/service/nimble/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/oam/api_client.go b/service/oam/api_client.go index 01c7bd4cc3c..264fc18709b 100644 --- a/service/oam/api_client.go +++ b/service/oam/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/oam/auth.go b/service/oam/auth.go index 930644ee838..7f45f8d46ab 100644 --- a/service/oam/auth.go +++ b/service/oam/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/omics/api_client.go b/service/omics/api_client.go index c6f1de927ba..ad4c3493163 100644 --- a/service/omics/api_client.go +++ b/service/omics/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/omics/auth.go b/service/omics/auth.go index 3d9857e841f..83a846acccf 100644 --- a/service/omics/auth.go +++ b/service/omics/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/opensearch/api_client.go b/service/opensearch/api_client.go index 83d5fb3002a..eb9f1f50d75 100644 --- a/service/opensearch/api_client.go +++ b/service/opensearch/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/opensearch/auth.go b/service/opensearch/auth.go index ff25d097ec3..8b5a30b77a8 100644 --- a/service/opensearch/auth.go +++ b/service/opensearch/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/opensearchserverless/api_client.go b/service/opensearchserverless/api_client.go index 8402379eb3a..5524ec1ec35 100644 --- a/service/opensearchserverless/api_client.go +++ b/service/opensearchserverless/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/opensearchserverless/auth.go b/service/opensearchserverless/auth.go index fabcc25f9bf..9d7c3cccb76 100644 --- a/service/opensearchserverless/auth.go +++ b/service/opensearchserverless/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/opsworks/api_client.go b/service/opsworks/api_client.go index 217fc292ad2..3a4bec7e66d 100644 --- a/service/opsworks/api_client.go +++ b/service/opsworks/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/opsworks/auth.go b/service/opsworks/auth.go index 2eb2ea717e8..e276062caab 100644 --- a/service/opsworks/auth.go +++ b/service/opsworks/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/opsworkscm/api_client.go b/service/opsworkscm/api_client.go index 3bf73f020df..23dd72c6f7a 100644 --- a/service/opsworkscm/api_client.go +++ b/service/opsworkscm/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/opsworkscm/auth.go b/service/opsworkscm/auth.go index 63d8678a3d8..eb4c462a222 100644 --- a/service/opsworkscm/auth.go +++ b/service/opsworkscm/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/organizations/api_client.go b/service/organizations/api_client.go index 215ab7f12df..220670f5014 100644 --- a/service/organizations/api_client.go +++ b/service/organizations/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/organizations/auth.go b/service/organizations/auth.go index 2ebd7a78b12..3e8a26568c4 100644 --- a/service/organizations/auth.go +++ b/service/organizations/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/osis/api_client.go b/service/osis/api_client.go index ababfa81cc3..442514566d6 100644 --- a/service/osis/api_client.go +++ b/service/osis/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/osis/auth.go b/service/osis/auth.go index 380fd0a93aa..15025142c33 100644 --- a/service/osis/auth.go +++ b/service/osis/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/outposts/api_client.go b/service/outposts/api_client.go index ca5802b11b9..3f14f774932 100644 --- a/service/outposts/api_client.go +++ b/service/outposts/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/outposts/auth.go b/service/outposts/auth.go index 86d7321b803..2cba6d3a70b 100644 --- a/service/outposts/auth.go +++ b/service/outposts/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/panorama/api_client.go b/service/panorama/api_client.go index b140506984b..9c3b71a2886 100644 --- a/service/panorama/api_client.go +++ b/service/panorama/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/panorama/auth.go b/service/panorama/auth.go index bb010ebd5dc..408dba51cdd 100644 --- a/service/panorama/auth.go +++ b/service/panorama/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/paymentcryptography/api_client.go b/service/paymentcryptography/api_client.go index 838ab3e895a..9a26618f38a 100644 --- a/service/paymentcryptography/api_client.go +++ b/service/paymentcryptography/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/paymentcryptography/auth.go b/service/paymentcryptography/auth.go index c9c5847a840..9ff3271eb22 100644 --- a/service/paymentcryptography/auth.go +++ b/service/paymentcryptography/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/paymentcryptographydata/api_client.go b/service/paymentcryptographydata/api_client.go index 7eaf66dcf4e..11cf78ff1ee 100644 --- a/service/paymentcryptographydata/api_client.go +++ b/service/paymentcryptographydata/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/paymentcryptographydata/auth.go b/service/paymentcryptographydata/auth.go index 024d23c43cb..750fa36ea67 100644 --- a/service/paymentcryptographydata/auth.go +++ b/service/paymentcryptographydata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/pcaconnectorad/api_client.go b/service/pcaconnectorad/api_client.go index df64199d809..a6f299bc2f7 100644 --- a/service/pcaconnectorad/api_client.go +++ b/service/pcaconnectorad/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/pcaconnectorad/auth.go b/service/pcaconnectorad/auth.go index 88de31f9ece..b30abfba5ae 100644 --- a/service/pcaconnectorad/auth.go +++ b/service/pcaconnectorad/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/personalize/api_client.go b/service/personalize/api_client.go index 9d6104cbaea..f95f6fd5217 100644 --- a/service/personalize/api_client.go +++ b/service/personalize/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/personalize/auth.go b/service/personalize/auth.go index f681025a947..8ef02ff21d2 100644 --- a/service/personalize/auth.go +++ b/service/personalize/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/personalizeevents/api_client.go b/service/personalizeevents/api_client.go index 13a60c8b7e8..d453d14340e 100644 --- a/service/personalizeevents/api_client.go +++ b/service/personalizeevents/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/personalizeevents/auth.go b/service/personalizeevents/auth.go index 580fbbeac5b..ed002654aba 100644 --- a/service/personalizeevents/auth.go +++ b/service/personalizeevents/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/personalizeruntime/api_client.go b/service/personalizeruntime/api_client.go index adde4981f58..4ce58dac9a4 100644 --- a/service/personalizeruntime/api_client.go +++ b/service/personalizeruntime/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/personalizeruntime/auth.go b/service/personalizeruntime/auth.go index cf2e30b3afd..2471a19d0ec 100644 --- a/service/personalizeruntime/auth.go +++ b/service/personalizeruntime/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/pi/api_client.go b/service/pi/api_client.go index f589ecb67cc..14c00d47df9 100644 --- a/service/pi/api_client.go +++ b/service/pi/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/pi/auth.go b/service/pi/auth.go index ae74575af21..e591b8ec95a 100644 --- a/service/pi/auth.go +++ b/service/pi/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/pinpoint/api_client.go b/service/pinpoint/api_client.go index 3b2a319e4cf..8a15fcf53e5 100644 --- a/service/pinpoint/api_client.go +++ b/service/pinpoint/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/pinpoint/auth.go b/service/pinpoint/auth.go index 4ae2abb33ff..0a48a980aa8 100644 --- a/service/pinpoint/auth.go +++ b/service/pinpoint/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/pinpointemail/api_client.go b/service/pinpointemail/api_client.go index 52af5e7a820..d6217c238c1 100644 --- a/service/pinpointemail/api_client.go +++ b/service/pinpointemail/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/pinpointemail/auth.go b/service/pinpointemail/auth.go index 9d69f362ce5..2a4d0ab93ce 100644 --- a/service/pinpointemail/auth.go +++ b/service/pinpointemail/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/pinpointsmsvoice/api_client.go b/service/pinpointsmsvoice/api_client.go index 4de23a08288..0f66d9f89d4 100644 --- a/service/pinpointsmsvoice/api_client.go +++ b/service/pinpointsmsvoice/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/pinpointsmsvoice/auth.go b/service/pinpointsmsvoice/auth.go index b51c75bb334..4b0847e23e0 100644 --- a/service/pinpointsmsvoice/auth.go +++ b/service/pinpointsmsvoice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/pinpointsmsvoicev2/api_client.go b/service/pinpointsmsvoicev2/api_client.go index ea5a1c1b66c..708d141cad6 100644 --- a/service/pinpointsmsvoicev2/api_client.go +++ b/service/pinpointsmsvoicev2/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/pinpointsmsvoicev2/auth.go b/service/pinpointsmsvoicev2/auth.go index 0f63abbccb3..c5d979e30c8 100644 --- a/service/pinpointsmsvoicev2/auth.go +++ b/service/pinpointsmsvoicev2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/pipes/api_client.go b/service/pipes/api_client.go index 2a52b2da367..f153a8414c3 100644 --- a/service/pipes/api_client.go +++ b/service/pipes/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/pipes/auth.go b/service/pipes/auth.go index 88336b38ac0..15a361df493 100644 --- a/service/pipes/auth.go +++ b/service/pipes/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/polly/api_client.go b/service/polly/api_client.go index abba4c00ba8..307e9240053 100644 --- a/service/polly/api_client.go +++ b/service/polly/api_client.go @@ -61,6 +61,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/polly/auth.go b/service/polly/auth.go index 47b14a4d766..ec4a0e8f072 100644 --- a/service/polly/auth.go +++ b/service/polly/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/pricing/api_client.go b/service/pricing/api_client.go index b5031fb92e2..6d3c2e7923c 100644 --- a/service/pricing/api_client.go +++ b/service/pricing/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/pricing/auth.go b/service/pricing/auth.go index 83d9db4bf4d..dcc7845c983 100644 --- a/service/pricing/auth.go +++ b/service/pricing/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/privatenetworks/api_client.go b/service/privatenetworks/api_client.go index c97e2b0a2a0..66280e5ed82 100644 --- a/service/privatenetworks/api_client.go +++ b/service/privatenetworks/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/privatenetworks/auth.go b/service/privatenetworks/auth.go index 82df45001a4..3fad0959e16 100644 --- a/service/privatenetworks/auth.go +++ b/service/privatenetworks/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/proton/api_client.go b/service/proton/api_client.go index 79e1265b3a5..49d206745c8 100644 --- a/service/proton/api_client.go +++ b/service/proton/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/proton/auth.go b/service/proton/auth.go index 4c82e6c00f9..1bde7428634 100644 --- a/service/proton/auth.go +++ b/service/proton/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/qbusiness/api_client.go b/service/qbusiness/api_client.go index 3e6ffa7e4da..bab5cc6721b 100644 --- a/service/qbusiness/api_client.go +++ b/service/qbusiness/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/qbusiness/auth.go b/service/qbusiness/auth.go index eea1c0c4202..487dc2392d2 100644 --- a/service/qbusiness/auth.go +++ b/service/qbusiness/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/qconnect/api_client.go b/service/qconnect/api_client.go index 1a0dda1aff3..29549c8094c 100644 --- a/service/qconnect/api_client.go +++ b/service/qconnect/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/qconnect/auth.go b/service/qconnect/auth.go index 6c3112fcf6c..34142319821 100644 --- a/service/qconnect/auth.go +++ b/service/qconnect/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/qldb/api_client.go b/service/qldb/api_client.go index 501a8dc9c3e..7cc62422f32 100644 --- a/service/qldb/api_client.go +++ b/service/qldb/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/qldb/auth.go b/service/qldb/auth.go index 40bfc73fab7..eb1a484cd8c 100644 --- a/service/qldb/auth.go +++ b/service/qldb/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/qldbsession/api_client.go b/service/qldbsession/api_client.go index ec6a0b20c20..2c74ecc05ad 100644 --- a/service/qldbsession/api_client.go +++ b/service/qldbsession/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/qldbsession/auth.go b/service/qldbsession/auth.go index 562a2bbe0d1..051dc62b032 100644 --- a/service/qldbsession/auth.go +++ b/service/qldbsession/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/quicksight/api_client.go b/service/quicksight/api_client.go index 7147e604f0c..f5950bc6f5f 100644 --- a/service/quicksight/api_client.go +++ b/service/quicksight/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/quicksight/auth.go b/service/quicksight/auth.go index 6ba47d7b339..3bbeeff2507 100644 --- a/service/quicksight/auth.go +++ b/service/quicksight/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ram/api_client.go b/service/ram/api_client.go index fefa5d394e2..f21765c4771 100644 --- a/service/ram/api_client.go +++ b/service/ram/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ram/auth.go b/service/ram/auth.go index 5e11f29efcc..819418af550 100644 --- a/service/ram/auth.go +++ b/service/ram/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/rbin/api_client.go b/service/rbin/api_client.go index 55d987ade37..e09c1df6190 100644 --- a/service/rbin/api_client.go +++ b/service/rbin/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/rbin/auth.go b/service/rbin/auth.go index 850abb99c4a..3c4c5d002c1 100644 --- a/service/rbin/auth.go +++ b/service/rbin/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/rds/api_client.go b/service/rds/api_client.go index d941aeaba28..ab6600b2081 100644 --- a/service/rds/api_client.go +++ b/service/rds/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/rds/auth.go b/service/rds/auth.go index 7e47a8e4f22..4c1ad1ee8c5 100644 --- a/service/rds/auth.go +++ b/service/rds/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/rdsdata/api_client.go b/service/rdsdata/api_client.go index 148a41b8083..0ccc3786b37 100644 --- a/service/rdsdata/api_client.go +++ b/service/rdsdata/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/rdsdata/auth.go b/service/rdsdata/auth.go index 5ea5c683414..25e8d40014b 100644 --- a/service/rdsdata/auth.go +++ b/service/rdsdata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/redshift/api_client.go b/service/redshift/api_client.go index ba26c75cd3d..1d5bab47658 100644 --- a/service/redshift/api_client.go +++ b/service/redshift/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/redshift/auth.go b/service/redshift/auth.go index 4341e17cde2..3e704fde790 100644 --- a/service/redshift/auth.go +++ b/service/redshift/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/redshiftdata/api_client.go b/service/redshiftdata/api_client.go index d8ea5600d53..f14cbe0581f 100644 --- a/service/redshiftdata/api_client.go +++ b/service/redshiftdata/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/redshiftdata/auth.go b/service/redshiftdata/auth.go index 3a73545719f..3d8523b426c 100644 --- a/service/redshiftdata/auth.go +++ b/service/redshiftdata/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/redshiftserverless/api_client.go b/service/redshiftserverless/api_client.go index 1a63efc08b4..4f6c4ad6cf2 100644 --- a/service/redshiftserverless/api_client.go +++ b/service/redshiftserverless/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/redshiftserverless/auth.go b/service/redshiftserverless/auth.go index bc85523cad4..9954df495ea 100644 --- a/service/redshiftserverless/auth.go +++ b/service/redshiftserverless/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/rekognition/api_client.go b/service/rekognition/api_client.go index 4839c187ef6..e96ec824bce 100644 --- a/service/rekognition/api_client.go +++ b/service/rekognition/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/rekognition/auth.go b/service/rekognition/auth.go index d0053abd6b0..31124e531a1 100644 --- a/service/rekognition/auth.go +++ b/service/rekognition/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/repostspace/api_client.go b/service/repostspace/api_client.go index a6ad998d078..2e9aca6e185 100644 --- a/service/repostspace/api_client.go +++ b/service/repostspace/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/repostspace/auth.go b/service/repostspace/auth.go index 48e54660b49..9660a59141c 100644 --- a/service/repostspace/auth.go +++ b/service/repostspace/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/resiliencehub/api_client.go b/service/resiliencehub/api_client.go index 9c332d75faa..a15c05c82ae 100644 --- a/service/resiliencehub/api_client.go +++ b/service/resiliencehub/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/resiliencehub/auth.go b/service/resiliencehub/auth.go index 1622bc2786d..70128c734f3 100644 --- a/service/resiliencehub/auth.go +++ b/service/resiliencehub/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/resourceexplorer2/api_client.go b/service/resourceexplorer2/api_client.go index 1012119b9ea..50de79b1b5d 100644 --- a/service/resourceexplorer2/api_client.go +++ b/service/resourceexplorer2/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/resourceexplorer2/auth.go b/service/resourceexplorer2/auth.go index a77b11e7628..0444437656d 100644 --- a/service/resourceexplorer2/auth.go +++ b/service/resourceexplorer2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/resourcegroups/api_client.go b/service/resourcegroups/api_client.go index 842c3fb376d..e72e6a80667 100644 --- a/service/resourcegroups/api_client.go +++ b/service/resourcegroups/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/resourcegroups/auth.go b/service/resourcegroups/auth.go index 51995538d38..d769c10e82a 100644 --- a/service/resourcegroups/auth.go +++ b/service/resourcegroups/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/resourcegroupstaggingapi/api_client.go b/service/resourcegroupstaggingapi/api_client.go index 3aab73eb5f1..7226eec9644 100644 --- a/service/resourcegroupstaggingapi/api_client.go +++ b/service/resourcegroupstaggingapi/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/resourcegroupstaggingapi/auth.go b/service/resourcegroupstaggingapi/auth.go index 6dad465b4ad..a858c9c565c 100644 --- a/service/resourcegroupstaggingapi/auth.go +++ b/service/resourcegroupstaggingapi/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/robomaker/api_client.go b/service/robomaker/api_client.go index f272845ba72..b49aaf3c490 100644 --- a/service/robomaker/api_client.go +++ b/service/robomaker/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/robomaker/auth.go b/service/robomaker/auth.go index 5a851db87df..b12a0f982bb 100644 --- a/service/robomaker/auth.go +++ b/service/robomaker/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/rolesanywhere/api_client.go b/service/rolesanywhere/api_client.go index 3d9ee76e7c6..856f19cdc51 100644 --- a/service/rolesanywhere/api_client.go +++ b/service/rolesanywhere/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/rolesanywhere/auth.go b/service/rolesanywhere/auth.go index d5930931a95..dad98f4e241 100644 --- a/service/rolesanywhere/auth.go +++ b/service/rolesanywhere/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/route53/api_client.go b/service/route53/api_client.go index eae1d8a3bf0..e0630a21cf2 100644 --- a/service/route53/api_client.go +++ b/service/route53/api_client.go @@ -60,6 +60,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/route53/auth.go b/service/route53/auth.go index 0371817aac6..5e979833419 100644 --- a/service/route53/auth.go +++ b/service/route53/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/route53domains/api_client.go b/service/route53domains/api_client.go index fb39d8222c0..1a3d832aa67 100644 --- a/service/route53domains/api_client.go +++ b/service/route53domains/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/route53domains/auth.go b/service/route53domains/auth.go index 8d3ebfbc439..51085fdccd6 100644 --- a/service/route53domains/auth.go +++ b/service/route53domains/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/route53recoverycluster/api_client.go b/service/route53recoverycluster/api_client.go index 55c3896b8f4..3e37ad7b140 100644 --- a/service/route53recoverycluster/api_client.go +++ b/service/route53recoverycluster/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/route53recoverycluster/auth.go b/service/route53recoverycluster/auth.go index 853727c55e8..0bf77bf7bb3 100644 --- a/service/route53recoverycluster/auth.go +++ b/service/route53recoverycluster/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/route53recoverycontrolconfig/api_client.go b/service/route53recoverycontrolconfig/api_client.go index ee8d557f8bf..4fdf886c2bc 100644 --- a/service/route53recoverycontrolconfig/api_client.go +++ b/service/route53recoverycontrolconfig/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/route53recoverycontrolconfig/auth.go b/service/route53recoverycontrolconfig/auth.go index f05bb701324..78f797148e4 100644 --- a/service/route53recoverycontrolconfig/auth.go +++ b/service/route53recoverycontrolconfig/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/route53recoveryreadiness/api_client.go b/service/route53recoveryreadiness/api_client.go index e93feb44c6a..3af7a735ad8 100644 --- a/service/route53recoveryreadiness/api_client.go +++ b/service/route53recoveryreadiness/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/route53recoveryreadiness/auth.go b/service/route53recoveryreadiness/auth.go index 7e5de898964..b2f574252b9 100644 --- a/service/route53recoveryreadiness/auth.go +++ b/service/route53recoveryreadiness/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/route53resolver/api_client.go b/service/route53resolver/api_client.go index e77f86d73d6..0d74b6bbd30 100644 --- a/service/route53resolver/api_client.go +++ b/service/route53resolver/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/route53resolver/auth.go b/service/route53resolver/auth.go index 51b03d21b60..b3fd292116d 100644 --- a/service/route53resolver/auth.go +++ b/service/route53resolver/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/rum/api_client.go b/service/rum/api_client.go index 383251a7ffe..a37687404e0 100644 --- a/service/rum/api_client.go +++ b/service/rum/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/rum/auth.go b/service/rum/auth.go index c825e57572f..e0e89deba63 100644 --- a/service/rum/auth.go +++ b/service/rum/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/s3/auth.go b/service/s3/auth.go index 558dd1a2972..8a4f832f7f5 100644 --- a/service/s3/auth.go +++ b/service/s3/auth.go @@ -56,6 +56,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/s3/endpoint_auth_resolver.go b/service/s3/endpoint_auth_resolver.go index b2d55c24cb5..91af48fc0de 100644 --- a/service/s3/endpoint_auth_resolver.go +++ b/service/s3/endpoint_auth_resolver.go @@ -30,7 +30,7 @@ func (r *endpointAuthResolver) ResolveAuthSchemes( } } - // a host of undocumented s3 operations can be done anonymously + // preserve pre-SRA behavior where everything technically had anonymous return append(opts, &smithyauth.Option{ SchemeID: smithyauth.SchemeIDAnonymous, }), nil diff --git a/service/s3control/api_client.go b/service/s3control/api_client.go index de6dcaf1db1..9bd021cc7e0 100644 --- a/service/s3control/api_client.go +++ b/service/s3control/api_client.go @@ -64,6 +64,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/s3control/auth.go b/service/s3control/auth.go index 57a60ef9c6a..4ebc2326ddc 100644 --- a/service/s3control/auth.go +++ b/service/s3control/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/s3outposts/api_client.go b/service/s3outposts/api_client.go index a65f7cfd1e0..24e25d56df4 100644 --- a/service/s3outposts/api_client.go +++ b/service/s3outposts/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/s3outposts/auth.go b/service/s3outposts/auth.go index 1cd1425280d..0c4514c575b 100644 --- a/service/s3outposts/auth.go +++ b/service/s3outposts/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sagemaker/api_client.go b/service/sagemaker/api_client.go index 5d0ca4850b0..fec7061432c 100644 --- a/service/sagemaker/api_client.go +++ b/service/sagemaker/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sagemaker/auth.go b/service/sagemaker/auth.go index 6b3be09b716..e7150ad0cd5 100644 --- a/service/sagemaker/auth.go +++ b/service/sagemaker/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sagemakera2iruntime/api_client.go b/service/sagemakera2iruntime/api_client.go index fd093777c7b..656158791a5 100644 --- a/service/sagemakera2iruntime/api_client.go +++ b/service/sagemakera2iruntime/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sagemakera2iruntime/auth.go b/service/sagemakera2iruntime/auth.go index e7865bb6ed5..fec11b17c5e 100644 --- a/service/sagemakera2iruntime/auth.go +++ b/service/sagemakera2iruntime/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sagemakeredge/api_client.go b/service/sagemakeredge/api_client.go index 425b907608d..aa9d4353d05 100644 --- a/service/sagemakeredge/api_client.go +++ b/service/sagemakeredge/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sagemakeredge/auth.go b/service/sagemakeredge/auth.go index 8602f79f10e..9c4e8e7e115 100644 --- a/service/sagemakeredge/auth.go +++ b/service/sagemakeredge/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sagemakerfeaturestoreruntime/api_client.go b/service/sagemakerfeaturestoreruntime/api_client.go index 28821e0bce4..6dc0c3b26e9 100644 --- a/service/sagemakerfeaturestoreruntime/api_client.go +++ b/service/sagemakerfeaturestoreruntime/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sagemakerfeaturestoreruntime/auth.go b/service/sagemakerfeaturestoreruntime/auth.go index 84e17a747dc..54e82e81895 100644 --- a/service/sagemakerfeaturestoreruntime/auth.go +++ b/service/sagemakerfeaturestoreruntime/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sagemakergeospatial/api_client.go b/service/sagemakergeospatial/api_client.go index 38aee1c88a1..d0aecad5e83 100644 --- a/service/sagemakergeospatial/api_client.go +++ b/service/sagemakergeospatial/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sagemakergeospatial/auth.go b/service/sagemakergeospatial/auth.go index d2a8bc86efa..331ff4b0d6d 100644 --- a/service/sagemakergeospatial/auth.go +++ b/service/sagemakergeospatial/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sagemakermetrics/api_client.go b/service/sagemakermetrics/api_client.go index 91726e21395..d43cb05f619 100644 --- a/service/sagemakermetrics/api_client.go +++ b/service/sagemakermetrics/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sagemakermetrics/auth.go b/service/sagemakermetrics/auth.go index 43fe3ede61a..8c21d3ecd13 100644 --- a/service/sagemakermetrics/auth.go +++ b/service/sagemakermetrics/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sagemakerruntime/api_client.go b/service/sagemakerruntime/api_client.go index 92331bd0380..568d3237ada 100644 --- a/service/sagemakerruntime/api_client.go +++ b/service/sagemakerruntime/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sagemakerruntime/auth.go b/service/sagemakerruntime/auth.go index 5c37d41ba9c..70b7740ff98 100644 --- a/service/sagemakerruntime/auth.go +++ b/service/sagemakerruntime/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/savingsplans/api_client.go b/service/savingsplans/api_client.go index c863914b1e5..aa99134473e 100644 --- a/service/savingsplans/api_client.go +++ b/service/savingsplans/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/savingsplans/auth.go b/service/savingsplans/auth.go index e6cb4af3d7e..8cf18855e61 100644 --- a/service/savingsplans/auth.go +++ b/service/savingsplans/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/scheduler/api_client.go b/service/scheduler/api_client.go index ad078303f8b..5158657dcdb 100644 --- a/service/scheduler/api_client.go +++ b/service/scheduler/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/scheduler/auth.go b/service/scheduler/auth.go index e9bddf00909..6deb1919bb1 100644 --- a/service/scheduler/auth.go +++ b/service/scheduler/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/schemas/api_client.go b/service/schemas/api_client.go index 880ec52c2b1..f0588a57491 100644 --- a/service/schemas/api_client.go +++ b/service/schemas/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/schemas/auth.go b/service/schemas/auth.go index 0e064bf2573..482e04c18cd 100644 --- a/service/schemas/auth.go +++ b/service/schemas/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/secretsmanager/api_client.go b/service/secretsmanager/api_client.go index 2222951a996..237dc521c61 100644 --- a/service/secretsmanager/api_client.go +++ b/service/secretsmanager/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/secretsmanager/auth.go b/service/secretsmanager/auth.go index 0504f52311b..ff911710d8d 100644 --- a/service/secretsmanager/auth.go +++ b/service/secretsmanager/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/securityhub/api_client.go b/service/securityhub/api_client.go index 1ac60425667..6b637c381d4 100644 --- a/service/securityhub/api_client.go +++ b/service/securityhub/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/securityhub/auth.go b/service/securityhub/auth.go index 6279cbbe52b..e0c22d1f710 100644 --- a/service/securityhub/auth.go +++ b/service/securityhub/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/securitylake/api_client.go b/service/securitylake/api_client.go index 8672a3753f4..d87fad6641a 100644 --- a/service/securitylake/api_client.go +++ b/service/securitylake/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/securitylake/auth.go b/service/securitylake/auth.go index 8e3bee5d6a1..9dd7760a79f 100644 --- a/service/securitylake/auth.go +++ b/service/securitylake/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/serverlessapplicationrepository/api_client.go b/service/serverlessapplicationrepository/api_client.go index cb4faef7b78..46e12d5b51e 100644 --- a/service/serverlessapplicationrepository/api_client.go +++ b/service/serverlessapplicationrepository/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/serverlessapplicationrepository/auth.go b/service/serverlessapplicationrepository/auth.go index 2f7d48d9842..ebd835f7958 100644 --- a/service/serverlessapplicationrepository/auth.go +++ b/service/serverlessapplicationrepository/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/servicecatalog/api_client.go b/service/servicecatalog/api_client.go index 08b9e683cc5..033a52bdd07 100644 --- a/service/servicecatalog/api_client.go +++ b/service/servicecatalog/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/servicecatalog/auth.go b/service/servicecatalog/auth.go index c41524b373f..b524f9eb0c5 100644 --- a/service/servicecatalog/auth.go +++ b/service/servicecatalog/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/servicecatalogappregistry/api_client.go b/service/servicecatalogappregistry/api_client.go index 4fd8d73142d..0d9bad8fa02 100644 --- a/service/servicecatalogappregistry/api_client.go +++ b/service/servicecatalogappregistry/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/servicecatalogappregistry/auth.go b/service/servicecatalogappregistry/auth.go index d50cd7d8a93..9be5e3dd121 100644 --- a/service/servicecatalogappregistry/auth.go +++ b/service/servicecatalogappregistry/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/servicediscovery/api_client.go b/service/servicediscovery/api_client.go index dfdb5cf4fa8..044ee331f4d 100644 --- a/service/servicediscovery/api_client.go +++ b/service/servicediscovery/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/servicediscovery/auth.go b/service/servicediscovery/auth.go index 1587f864fdb..d5461ba4751 100644 --- a/service/servicediscovery/auth.go +++ b/service/servicediscovery/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/servicequotas/api_client.go b/service/servicequotas/api_client.go index 6f7233f4941..b8345c59dc5 100644 --- a/service/servicequotas/api_client.go +++ b/service/servicequotas/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/servicequotas/auth.go b/service/servicequotas/auth.go index 68d68716200..ceed199dc8f 100644 --- a/service/servicequotas/auth.go +++ b/service/servicequotas/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ses/api_client.go b/service/ses/api_client.go index c5decab0b8d..ab2af2d58a6 100644 --- a/service/ses/api_client.go +++ b/service/ses/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ses/auth.go b/service/ses/auth.go index 152129b6379..d8b13cc7ba2 100644 --- a/service/ses/auth.go +++ b/service/ses/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sesv2/api_client.go b/service/sesv2/api_client.go index 7bae737b346..0ba646615b9 100644 --- a/service/sesv2/api_client.go +++ b/service/sesv2/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sesv2/auth.go b/service/sesv2/auth.go index 62ba55a0088..394c55f4eb3 100644 --- a/service/sesv2/auth.go +++ b/service/sesv2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sfn/api_client.go b/service/sfn/api_client.go index a392f924e0d..721f0e77c69 100644 --- a/service/sfn/api_client.go +++ b/service/sfn/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sfn/auth.go b/service/sfn/auth.go index 6821289dabf..1322e8d24ba 100644 --- a/service/sfn/auth.go +++ b/service/sfn/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/shield/api_client.go b/service/shield/api_client.go index 7c45432fe3b..2cf37f7e258 100644 --- a/service/shield/api_client.go +++ b/service/shield/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/shield/auth.go b/service/shield/auth.go index de545b1eba4..153d4e905cf 100644 --- a/service/shield/auth.go +++ b/service/shield/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/signer/api_client.go b/service/signer/api_client.go index 2f8654f30dc..e53b3da25e7 100644 --- a/service/signer/api_client.go +++ b/service/signer/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/signer/auth.go b/service/signer/auth.go index 2363e6f2b61..873472ff6c1 100644 --- a/service/signer/auth.go +++ b/service/signer/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/simspaceweaver/api_client.go b/service/simspaceweaver/api_client.go index d9f1ef9f4ff..184094ab9c2 100644 --- a/service/simspaceweaver/api_client.go +++ b/service/simspaceweaver/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/simspaceweaver/auth.go b/service/simspaceweaver/auth.go index dea54bdc81c..13155737ce6 100644 --- a/service/simspaceweaver/auth.go +++ b/service/simspaceweaver/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sms/api_client.go b/service/sms/api_client.go index 07eb695d156..b1d7172b2c8 100644 --- a/service/sms/api_client.go +++ b/service/sms/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sms/auth.go b/service/sms/auth.go index 322e66f9c60..3409c153804 100644 --- a/service/sms/auth.go +++ b/service/sms/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/snowball/api_client.go b/service/snowball/api_client.go index a1fbae44eb2..a12d2205a78 100644 --- a/service/snowball/api_client.go +++ b/service/snowball/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/snowball/auth.go b/service/snowball/auth.go index 3b838d9f7b4..51a68ca8409 100644 --- a/service/snowball/auth.go +++ b/service/snowball/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/snowdevicemanagement/api_client.go b/service/snowdevicemanagement/api_client.go index 30ccd429170..72fffd76ca5 100644 --- a/service/snowdevicemanagement/api_client.go +++ b/service/snowdevicemanagement/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/snowdevicemanagement/auth.go b/service/snowdevicemanagement/auth.go index 448eee65a5c..49885783d79 100644 --- a/service/snowdevicemanagement/auth.go +++ b/service/snowdevicemanagement/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sns/api_client.go b/service/sns/api_client.go index 67e0f83b4ab..7db11858d3b 100644 --- a/service/sns/api_client.go +++ b/service/sns/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sns/auth.go b/service/sns/auth.go index c168116a39f..136bcc44ccc 100644 --- a/service/sns/auth.go +++ b/service/sns/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sqs/api_client.go b/service/sqs/api_client.go index 257d7bd84b0..76a77371bb8 100644 --- a/service/sqs/api_client.go +++ b/service/sqs/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sqs/auth.go b/service/sqs/auth.go index 189ecd50400..22607b3fb91 100644 --- a/service/sqs/auth.go +++ b/service/sqs/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ssm/api_client.go b/service/ssm/api_client.go index 45463867b5a..5f7a8403cb0 100644 --- a/service/ssm/api_client.go +++ b/service/ssm/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ssm/auth.go b/service/ssm/auth.go index c8905bdffdd..bad85d052dc 100644 --- a/service/ssm/auth.go +++ b/service/ssm/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ssmcontacts/api_client.go b/service/ssmcontacts/api_client.go index b6c2dbc6af8..30195f91900 100644 --- a/service/ssmcontacts/api_client.go +++ b/service/ssmcontacts/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ssmcontacts/auth.go b/service/ssmcontacts/auth.go index b99311d8c3c..09b1868c310 100644 --- a/service/ssmcontacts/auth.go +++ b/service/ssmcontacts/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ssmincidents/api_client.go b/service/ssmincidents/api_client.go index 0ecf49656b2..a580312598c 100644 --- a/service/ssmincidents/api_client.go +++ b/service/ssmincidents/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ssmincidents/auth.go b/service/ssmincidents/auth.go index d7a2cfa9240..6ea64afa132 100644 --- a/service/ssmincidents/auth.go +++ b/service/ssmincidents/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ssmsap/api_client.go b/service/ssmsap/api_client.go index 69dd9e4acf4..d20c4ab8e40 100644 --- a/service/ssmsap/api_client.go +++ b/service/ssmsap/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ssmsap/auth.go b/service/ssmsap/auth.go index dd45a45b41b..97794fe045c 100644 --- a/service/ssmsap/auth.go +++ b/service/ssmsap/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sso/api_client.go b/service/sso/api_client.go index 879dc35a11d..93669a966db 100644 --- a/service/sso/api_client.go +++ b/service/sso/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sso/auth.go b/service/sso/auth.go index f7702dd0d3b..3b28e825dd0 100644 --- a/service/sso/auth.go +++ b/service/sso/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ssoadmin/api_client.go b/service/ssoadmin/api_client.go index c56d7c28308..3908c722eef 100644 --- a/service/ssoadmin/api_client.go +++ b/service/ssoadmin/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ssoadmin/auth.go b/service/ssoadmin/auth.go index 8fb4b5fa983..1e646df3446 100644 --- a/service/ssoadmin/auth.go +++ b/service/ssoadmin/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/ssooidc/api_client.go b/service/ssooidc/api_client.go index 59239741a91..90addc4fc24 100644 --- a/service/ssooidc/api_client.go +++ b/service/ssooidc/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/ssooidc/auth.go b/service/ssooidc/auth.go index fe88367c4c2..40b3becb9f2 100644 --- a/service/ssooidc/auth.go +++ b/service/ssooidc/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/storagegateway/api_client.go b/service/storagegateway/api_client.go index 8b22b138be7..0718f8586d7 100644 --- a/service/storagegateway/api_client.go +++ b/service/storagegateway/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/storagegateway/auth.go b/service/storagegateway/auth.go index 10d491bc194..d269b16dcfe 100644 --- a/service/storagegateway/auth.go +++ b/service/storagegateway/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/sts/api_client.go b/service/sts/api_client.go index 32c391e56e8..2fb478f6f0a 100644 --- a/service/sts/api_client.go +++ b/service/sts/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/sts/auth.go b/service/sts/auth.go index 07d4dc55c59..9db5bfd4348 100644 --- a/service/sts/auth.go +++ b/service/sts/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { @@ -92,34 +120,12 @@ func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ "AssumeRoleWithSAML": func(params *AuthResolverParameters) []*smithyauth.Option { return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "sts") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - - return props - }(), - }, - {SchemeID: smithyauth.SchemeIDAnonymous}, } }, "AssumeRoleWithWebIdentity": func(params *AuthResolverParameters) []*smithyauth.Option { return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "sts") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - - return props - }(), - }, - {SchemeID: smithyauth.SchemeIDAnonymous}, } }, diff --git a/service/support/api_client.go b/service/support/api_client.go index f80ddc8110a..84d4e38616d 100644 --- a/service/support/api_client.go +++ b/service/support/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/support/auth.go b/service/support/auth.go index 7c10a39d1f0..f0e15a2b911 100644 --- a/service/support/auth.go +++ b/service/support/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/supportapp/api_client.go b/service/supportapp/api_client.go index a5a1b9e5b96..fe0463d45ff 100644 --- a/service/supportapp/api_client.go +++ b/service/supportapp/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/supportapp/auth.go b/service/supportapp/auth.go index 8120bd2b0f2..92a79c6d6c2 100644 --- a/service/supportapp/auth.go +++ b/service/supportapp/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/swf/api_client.go b/service/swf/api_client.go index 6675332b1e0..42ca4d3f3b2 100644 --- a/service/swf/api_client.go +++ b/service/swf/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/swf/auth.go b/service/swf/auth.go index 52dc739a43c..a65f2703925 100644 --- a/service/swf/auth.go +++ b/service/swf/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/synthetics/api_client.go b/service/synthetics/api_client.go index 66f89be32ab..e0850ffba9e 100644 --- a/service/synthetics/api_client.go +++ b/service/synthetics/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/synthetics/auth.go b/service/synthetics/auth.go index 8a905e5713e..e4c639e0d5b 100644 --- a/service/synthetics/auth.go +++ b/service/synthetics/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/textract/api_client.go b/service/textract/api_client.go index 823e28ec703..fa62ca2e721 100644 --- a/service/textract/api_client.go +++ b/service/textract/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/textract/auth.go b/service/textract/auth.go index 5e83cb38c43..84f5509736d 100644 --- a/service/textract/auth.go +++ b/service/textract/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/timestreamquery/api_client.go b/service/timestreamquery/api_client.go index 418c7191df4..b4f06539ae9 100644 --- a/service/timestreamquery/api_client.go +++ b/service/timestreamquery/api_client.go @@ -71,6 +71,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/timestreamquery/auth.go b/service/timestreamquery/auth.go index f31b7ead6d2..2465a26d10d 100644 --- a/service/timestreamquery/auth.go +++ b/service/timestreamquery/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/timestreamwrite/api_client.go b/service/timestreamwrite/api_client.go index 3a00bde6d19..639663423c1 100644 --- a/service/timestreamwrite/api_client.go +++ b/service/timestreamwrite/api_client.go @@ -71,6 +71,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/timestreamwrite/auth.go b/service/timestreamwrite/auth.go index 579ab8108f0..60a82021688 100644 --- a/service/timestreamwrite/auth.go +++ b/service/timestreamwrite/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/tnb/api_client.go b/service/tnb/api_client.go index dbcee91bed9..81b56eb0f86 100644 --- a/service/tnb/api_client.go +++ b/service/tnb/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/tnb/auth.go b/service/tnb/auth.go index 641c0d69834..1da0161e821 100644 --- a/service/tnb/auth.go +++ b/service/tnb/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/transcribe/api_client.go b/service/transcribe/api_client.go index 4c3121649c4..94798300be0 100644 --- a/service/transcribe/api_client.go +++ b/service/transcribe/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/transcribe/auth.go b/service/transcribe/auth.go index 5024b138eff..1c7d78b943b 100644 --- a/service/transcribe/auth.go +++ b/service/transcribe/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/transcribestreaming/api_client.go b/service/transcribestreaming/api_client.go index a86b97217ab..d8a53870f1c 100644 --- a/service/transcribestreaming/api_client.go +++ b/service/transcribestreaming/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/transcribestreaming/auth.go b/service/transcribestreaming/auth.go index c256b3c1e0e..2fe6c8b9f3d 100644 --- a/service/transcribestreaming/auth.go +++ b/service/transcribestreaming/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/transfer/api_client.go b/service/transfer/api_client.go index 77281e0948d..108f4195ece 100644 --- a/service/transfer/api_client.go +++ b/service/transfer/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/transfer/auth.go b/service/transfer/auth.go index a5c9d26c463..95de6b8fd2c 100644 --- a/service/transfer/auth.go +++ b/service/transfer/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/translate/api_client.go b/service/translate/api_client.go index fb1ec414002..f8d44661c3c 100644 --- a/service/translate/api_client.go +++ b/service/translate/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/translate/auth.go b/service/translate/auth.go index ddbd9c0ab02..f791a4e28e4 100644 --- a/service/translate/auth.go +++ b/service/translate/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/trustedadvisor/api_client.go b/service/trustedadvisor/api_client.go index d775a57e99f..bc539085194 100644 --- a/service/trustedadvisor/api_client.go +++ b/service/trustedadvisor/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/trustedadvisor/auth.go b/service/trustedadvisor/auth.go index 0ac9bdda9a3..9cb3a4bb1c9 100644 --- a/service/trustedadvisor/auth.go +++ b/service/trustedadvisor/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/verifiedpermissions/api_client.go b/service/verifiedpermissions/api_client.go index 028f71fa626..fbc4c73adf3 100644 --- a/service/verifiedpermissions/api_client.go +++ b/service/verifiedpermissions/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/verifiedpermissions/auth.go b/service/verifiedpermissions/auth.go index 9f0ae78eebb..540779edade 100644 --- a/service/verifiedpermissions/auth.go +++ b/service/verifiedpermissions/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/voiceid/api_client.go b/service/voiceid/api_client.go index c23c60b8d2f..8cf99027b7a 100644 --- a/service/voiceid/api_client.go +++ b/service/voiceid/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/voiceid/auth.go b/service/voiceid/auth.go index e9c4bcd8c89..c5f2ae669c6 100644 --- a/service/voiceid/auth.go +++ b/service/voiceid/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/vpclattice/api_client.go b/service/vpclattice/api_client.go index ebdb5ebb977..4a8a7042010 100644 --- a/service/vpclattice/api_client.go +++ b/service/vpclattice/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/vpclattice/auth.go b/service/vpclattice/auth.go index 083121a8be4..4fa45714d18 100644 --- a/service/vpclattice/auth.go +++ b/service/vpclattice/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/waf/api_client.go b/service/waf/api_client.go index b74b168fdc4..b182f33e812 100644 --- a/service/waf/api_client.go +++ b/service/waf/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/waf/auth.go b/service/waf/auth.go index e84dc5690dd..8d84b8a0f06 100644 --- a/service/waf/auth.go +++ b/service/waf/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/wafregional/api_client.go b/service/wafregional/api_client.go index b3b65b1947c..27a96b6fdf3 100644 --- a/service/wafregional/api_client.go +++ b/service/wafregional/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/wafregional/auth.go b/service/wafregional/auth.go index febdb84fdc8..cb5fa2387ca 100644 --- a/service/wafregional/auth.go +++ b/service/wafregional/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/wafv2/api_client.go b/service/wafv2/api_client.go index b0db49f73da..55a0ea418e5 100644 --- a/service/wafv2/api_client.go +++ b/service/wafv2/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/wafv2/auth.go b/service/wafv2/auth.go index f8ccbcc03d7..79526df359d 100644 --- a/service/wafv2/auth.go +++ b/service/wafv2/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/wellarchitected/api_client.go b/service/wellarchitected/api_client.go index cacfe4dfe67..91076a0186c 100644 --- a/service/wellarchitected/api_client.go +++ b/service/wellarchitected/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/wellarchitected/auth.go b/service/wellarchitected/auth.go index 16bbd5339a6..23a4124917a 100644 --- a/service/wellarchitected/auth.go +++ b/service/wellarchitected/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/wisdom/api_client.go b/service/wisdom/api_client.go index def3c2fec15..239a37af0b3 100644 --- a/service/wisdom/api_client.go +++ b/service/wisdom/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/wisdom/auth.go b/service/wisdom/auth.go index 08050315357..cc7e3e81155 100644 --- a/service/wisdom/auth.go +++ b/service/wisdom/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/workdocs/api_client.go b/service/workdocs/api_client.go index 6e2d5bac972..b4aa820e927 100644 --- a/service/workdocs/api_client.go +++ b/service/workdocs/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/workdocs/auth.go b/service/workdocs/auth.go index 144efcf00b4..36e28d60a8f 100644 --- a/service/workdocs/auth.go +++ b/service/workdocs/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/worklink/api_client.go b/service/worklink/api_client.go index 0d30b7d4d79..737c5a1b3d4 100644 --- a/service/worklink/api_client.go +++ b/service/worklink/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/worklink/auth.go b/service/worklink/auth.go index 2afb6ef6c0b..1dca21562bd 100644 --- a/service/worklink/auth.go +++ b/service/worklink/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/workmail/api_client.go b/service/workmail/api_client.go index c0a2c9b9814..708977a38aa 100644 --- a/service/workmail/api_client.go +++ b/service/workmail/api_client.go @@ -62,6 +62,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/workmail/auth.go b/service/workmail/auth.go index d3ea5209d1c..4a967cad3ff 100644 --- a/service/workmail/auth.go +++ b/service/workmail/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/workmailmessageflow/api_client.go b/service/workmailmessageflow/api_client.go index ed7446509f0..ef4f3708aa7 100644 --- a/service/workmailmessageflow/api_client.go +++ b/service/workmailmessageflow/api_client.go @@ -59,6 +59,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/workmailmessageflow/auth.go b/service/workmailmessageflow/auth.go index d9814e2325f..aa173cd2cdf 100644 --- a/service/workmailmessageflow/auth.go +++ b/service/workmailmessageflow/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/workspaces/api_client.go b/service/workspaces/api_client.go index b696b735f7f..75ea25bc138 100644 --- a/service/workspaces/api_client.go +++ b/service/workspaces/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/workspaces/auth.go b/service/workspaces/auth.go index 4f6700edaad..b42be4d1fd9 100644 --- a/service/workspaces/auth.go +++ b/service/workspaces/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/workspacesthinclient/api_client.go b/service/workspacesthinclient/api_client.go index 973d37a7b8b..1a0021c3fc8 100644 --- a/service/workspacesthinclient/api_client.go +++ b/service/workspacesthinclient/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/workspacesthinclient/auth.go b/service/workspacesthinclient/auth.go index 6bddbe1f6e5..58483371f89 100644 --- a/service/workspacesthinclient/auth.go +++ b/service/workspacesthinclient/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/workspacesweb/api_client.go b/service/workspacesweb/api_client.go index b49719b1780..661caa20314 100644 --- a/service/workspacesweb/api_client.go +++ b/service/workspacesweb/api_client.go @@ -63,6 +63,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/workspacesweb/auth.go b/service/workspacesweb/auth.go index ecd5bcbfaf1..df1f2dc8284 100644 --- a/service/workspacesweb/auth.go +++ b/service/workspacesweb/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct { diff --git a/service/xray/api_client.go b/service/xray/api_client.go index 1281a3b40b1..423b2780288 100644 --- a/service/xray/api_client.go +++ b/service/xray/api_client.go @@ -58,6 +58,8 @@ func New(options Options, optFns ...func(*Options)) *Client { ignoreAnonymousAuth(&options) + wrapWithAnonymousAuth(&options) + resolveAuthSchemes(&options) client := &Client{ diff --git a/service/xray/auth.go b/service/xray/auth.go index 1bfbafc95a3..2535c31d707 100644 --- a/service/xray/auth.go +++ b/service/xray/auth.go @@ -52,6 +52,34 @@ func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) } +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + // AuthResolverParameters contains the set of inputs necessary for auth scheme // resolution. type AuthResolverParameters struct {