Merge branch 'master' into codex/build-presigned-url-upload-api
This commit is contained in:
@@ -75,8 +75,9 @@ class ConsoleApiController extends AbstractController
|
||||
|
||||
public function credentialDetail(int $id, Request $request): JsonResponse
|
||||
{
|
||||
if ($resp = $this->checkAuth($request)) {
|
||||
return $resp;
|
||||
$authResp = $this->checkAuth($request);
|
||||
if ($authResp !== null) {
|
||||
return $authResp;
|
||||
}
|
||||
$credential = $this->entityManager->getRepository(S3Credential::class)->find($id);
|
||||
|
||||
@@ -130,8 +131,9 @@ class ConsoleApiController extends AbstractController
|
||||
// Buckets Management
|
||||
public function buckets(Request $request): JsonResponse
|
||||
{
|
||||
if ($resp = $this->checkAuth($request)) {
|
||||
return $resp;
|
||||
$authResp = $this->checkAuth($request);
|
||||
if ($authResp !== null) {
|
||||
return $authResp;
|
||||
}
|
||||
if ($request->getMethod() === 'GET') {
|
||||
$buckets = $this->entityManager->getRepository(S3Bucket::class)->findAll();
|
||||
@@ -195,8 +197,9 @@ class ConsoleApiController extends AbstractController
|
||||
|
||||
public function bucketDetail(string $name, Request $request): JsonResponse
|
||||
{
|
||||
if ($resp = $this->checkAuth($request)) {
|
||||
return $resp;
|
||||
$authResp = $this->checkAuth($request);
|
||||
if ($authResp !== null) {
|
||||
return $authResp;
|
||||
}
|
||||
$bucket = $this->s3Service->findBucketByName($name);
|
||||
|
||||
@@ -245,8 +248,9 @@ class ConsoleApiController extends AbstractController
|
||||
// Objects Management
|
||||
public function objects(string $bucketName, Request $request): JsonResponse
|
||||
{
|
||||
if ($resp = $this->checkAuth($request)) {
|
||||
return $resp;
|
||||
$authResp = $this->checkAuth($request);
|
||||
if ($authResp !== null) {
|
||||
return $authResp;
|
||||
}
|
||||
$bucket = $this->s3Service->findBucketByName($bucketName);
|
||||
|
||||
@@ -294,8 +298,9 @@ class ConsoleApiController extends AbstractController
|
||||
|
||||
public function objectDetail(string $bucketName, string $objectKey, Request $request): JsonResponse
|
||||
{
|
||||
if ($resp = $this->checkAuth($request)) {
|
||||
return $resp;
|
||||
$authResp = $this->checkAuth($request);
|
||||
if ($authResp !== null) {
|
||||
return $authResp;
|
||||
}
|
||||
$bucket = $this->s3Service->findBucketByName($bucketName);
|
||||
|
||||
@@ -370,8 +375,9 @@ class ConsoleApiController extends AbstractController
|
||||
// Multipart Uploads
|
||||
public function multipartUploads(string $bucketName, Request $request): JsonResponse
|
||||
{
|
||||
if ($resp = $this->checkAuth($request)) {
|
||||
return $resp;
|
||||
$authResp = $this->checkAuth($request);
|
||||
if ($authResp !== null) {
|
||||
return $authResp;
|
||||
}
|
||||
$bucket = $this->s3Service->findBucketByName($bucketName);
|
||||
|
||||
@@ -403,8 +409,9 @@ class ConsoleApiController extends AbstractController
|
||||
// Presigned URLs
|
||||
public function presignedUrls(Request $request): JsonResponse
|
||||
{
|
||||
if ($resp = $this->checkAuth($request)) {
|
||||
return $resp;
|
||||
$authResp = $this->checkAuth($request);
|
||||
if ($authResp !== null) {
|
||||
return $authResp;
|
||||
}
|
||||
if ($request->getMethod() === 'GET') {
|
||||
$urls = $this->entityManager->getRepository(\App\Entity\S3PresignedUrl::class)
|
||||
@@ -460,8 +467,9 @@ class ConsoleApiController extends AbstractController
|
||||
// Statistics
|
||||
public function stats(Request $request): JsonResponse
|
||||
{
|
||||
if ($resp = $this->checkAuth($request)) {
|
||||
return $resp;
|
||||
$authResp = $this->checkAuth($request);
|
||||
if ($authResp !== null) {
|
||||
return $authResp;
|
||||
}
|
||||
$credentialCount = $this->entityManager->getRepository(S3Credential::class)->count([]);
|
||||
$bucketCount = $this->entityManager->getRepository(S3Bucket::class)->count([]);
|
||||
|
||||
Reference in New Issue
Block a user