Skip to content

Commit

Permalink
Merge pull request #240 from keboola/martinj-ct-992-allow-file-storag…
Browse files Browse the repository at this point in the history
…e-registration-for-standard-user

CT-992 allow file storage registration for standard user
  • Loading branch information
martinjandl committed Apr 5, 2024
2 parents 9fffc83 + 3ef50a4 commit c154953
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -3533,6 +3533,8 @@ Each type of storage has its own endpoint.

### Create new AWS S3 Storage [POST]

Superuser credentials are not required for storage registration

New S3 file Storage will be registered. Provided AWS credentials are verified and required permissions are validated.
The Storage region is automatically detected.

Expand Down Expand Up @@ -3580,6 +3582,8 @@ Only storage owned by **keboola** can be set as default.

### Create new Google Cloud Storage [POST]

Superuser credentials are not required for storage registration

Will register new Google Cloud Storage for using inside KBC. Connection wil be verified during registraion.

+ Request (application/json)
Expand Down Expand Up @@ -3612,6 +3616,8 @@ Returns all registered Google Cloud Storages.

### Create new Azure Blob Storage [POST]

Superuser credentials are not required for storage registration

Will register new Azure Blob Storage for using inside KBC. Connection wil be verified during registraion.

+ Request (application/json)
Expand Down
14 changes: 14 additions & 0 deletions tests/FileStorageGcsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,18 @@ public function testCrossProviderStorageCredentialsRotateGcsS3()
$this->expectExceptionMessage(sprintf('AWS S3 file storage "%d" not found', $storage['id']));
$this->client->rotateS3FileStorageCredentials($storage['id'], self::ROTATE_S3_OPTIONS);
}

public function testNonSuperAdminFileStorageGcsCreate(): void
{
$storage = $this->normalUserClient->createGcsFileStorage($this->getGcsDefaultOptions());

$credentials = $storage['gcsCredentials'];
$this->assertArrayNotHasKey('private_key', $credentials);
$this->assertSame($this->getExpectedGcsCredentialsWithoutPk(), $credentials);
$this->assertSame('keboola', $storage['owner']);
$this->assertSame(TEST_GCS_REGION, $storage['region']);
$this->assertSame($storage['provider'], 'gcp');
$this->assertFalse($storage['isDefault']);
$this->assertStringEndsWith('_' . $storage['id'] . '_GCS', $storage['gcsSnowflakeIntegrationName']);
}
}

0 comments on commit c154953

Please sign in to comment.