Skip to content

Commit

Permalink
Used allowed domains from config
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyakubanov committed Oct 17, 2024
1 parent c6ea53c commit 85a2d9b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,14 @@ interface AmazonQuicksightConstants
* @var string
*/
public const DEFAULT_DATA_SOURCE_VPC_CONNECTION_ARN = 'AMAZON_QUICKSIGHT:DEFAULT_DATA_SOURCE_VPC_CONNECTION_ARN';

/**
* Specification:
* - The list of domains allowed for generating embed URLs.
*
* @api
*
* @var string
*/
public const GENERATE_EMBED_URL_ALLOWED_DOMAINS = 'AMAZON_QUICKSIGHT:GENERATE_EMBED_URL_ALLOWED_DOMAINS';
}
13 changes: 13 additions & 0 deletions src/SprykerEco/Zed/AmazonQuicksight/AmazonQuicksightConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,4 +505,17 @@ public function getDefaultDataSourceVpcConnectionArn(): string
{
return $this->get(AmazonQuicksightConstants::DEFAULT_DATA_SOURCE_VPC_CONNECTION_ARN);
}

/**
* Specification:
* - Returns list of domains allowed for generating embed URLs.
*
* @api
*
* @return list<string>
*/
public function getGenerateEmbedUrlAllowedDomains(): array
{
return $this->get(AmazonQuicksightConstants::GENERATE_EMBED_URL_ALLOWED_DOMAINS, []);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ protected function createQuicksightUserRegisterRequestTransfer(): QuicksightUser
protected function createQuicksightGenerateEmbedUrlRequestTransfer(): QuicksightGenerateEmbedUrlRequestTransfer
{
return (new QuicksightGenerateEmbedUrlRequestTransfer())
->addAllowedDomain('https://backoffice.eu.scos2-suitens.cloud.spryker.toys/')
->setAllowedDomains($this->amazonQuicksightConfig->getGenerateEmbedUrlAllowedDomains())
->setAwsAccountId($this->amazonQuicksightConfig->getAwsAccountId())
->setExperienceConfiguration((new QuicksightExperienceConfigurationTransfer())->setQuickSightConsole(
(new QuicksightConsoleTransfer())->setInitialPath(
Expand Down

0 comments on commit 85a2d9b

Please sign in to comment.