diff --git a/src/client/core/OpenAPI.ts b/src/client/core/OpenAPI.ts index 4ca423bb8eabf49428e80e3347468cfd4b0f976a..d4685b40c43ec9045eb8008e86d7d595b6828c85 100644 --- a/src/client/core/OpenAPI.ts +++ b/src/client/core/OpenAPI.ts @@ -19,7 +19,7 @@ export type OpenAPIConfig = { }; export const OpenAPI: OpenAPIConfig = { - BASE: import.meta.env.VITE_API_BASE_URL != null ? import.meta.env.VITE_API_BASE_URL : 'http://localhost:9999/api', + BASE: '/api', VERSION: '1.0.0', WITH_CREDENTIALS: false, CREDENTIALS: 'include', diff --git a/src/client/models/BucketOut.ts b/src/client/models/BucketOut.ts index d3c68512a9a8cee4ca8681ee5fa4af98fe7a8268..b1bb787caad5293581621f9c75369b4b0341989e 100644 --- a/src/client/models/BucketOut.ts +++ b/src/client/models/BucketOut.ts @@ -19,7 +19,7 @@ export type BucketOut = { */ created_at: string; /** - * Username of the owner + * UID of the owner */ owner: string; }; diff --git a/src/client/models/BucketPermission.ts b/src/client/models/BucketPermission.ts index 78679591d26554041688efc915bbc8c1a3d1e113..32d7d000b828a75b2d788852c027ce5e81ba704b 100644 --- a/src/client/models/BucketPermission.ts +++ b/src/client/models/BucketPermission.ts @@ -25,9 +25,9 @@ export type BucketPermission = { */ permission?: (PermissionEnum | string); /** - * Name of User + * UID of the grantee */ - username: string; + uid: string; /** * Name of Bucket */ diff --git a/src/client/models/S3Key.ts b/src/client/models/S3Key.ts index 5b3d7909c65cfa03f76252074b0b68bebd41826c..5a1aa255ea54281fb45ae5a32d09d459ef1bac29 100644 --- a/src/client/models/S3Key.ts +++ b/src/client/models/S3Key.ts @@ -7,7 +7,7 @@ */ export type S3Key = { /** - * Username of the user of that access key + * UID of the user of that access key */ user: string; /** diff --git a/src/client/models/User.ts b/src/client/models/User.ts index 58137cd888487ba4aff980746431f0e8c35e943c..0af7691e6489e47f4e623a0b7bc84848bacd6dfe 100644 --- a/src/client/models/User.ts +++ b/src/client/models/User.ts @@ -10,10 +10,6 @@ export type User = { * ID of the user */ uid: string; - /** - * Username of the user - */ - username: string; /** * Full Name of the user */ diff --git a/src/client/services/BucketPermissionsService.ts b/src/client/services/BucketPermissionsService.ts index 871549bd7b3a928aa0332c178ca5d6e70f3da0b1..5fbf147d725a4d4d68d19dd5bc8fed0c2b3c4e43 100644 --- a/src/client/services/BucketPermissionsService.ts +++ b/src/client/services/BucketPermissionsService.ts @@ -17,20 +17,20 @@ export class BucketPermissionsService { * The owner of the bucket and the grantee of the permission can view it. * * @param bucketName Name of bucket - * @param username Username of a user + * @param uid UID of a user * @returns BucketPermission Successful Response * @throws ApiError */ public static bucketPermissionsGetPermissionForBucket( bucketName: string, - username: string, + uid: string, ): CancelablePromise<BucketPermission> { return __request(OpenAPI, { method: 'GET', - url: '/permissions/bucket/{bucket_name}/user/{username}', + url: '/permissions/bucket/{bucket_name}/user/{uid}', path: { 'bucket_name': bucketName, - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -45,22 +45,22 @@ export class BucketPermissionsService { * Update a bucket permission * Update a permission for a bucket and user. * - * @param username Username of a user + * @param uid UID of a user * @param bucketName Name of bucket * @param requestBody * @returns BucketPermission Successful Response * @throws ApiError */ public static bucketPermissionsUpdatePermission( - username: string, + uid: string, bucketName: string, requestBody: BucketPermissionParameters, ): CancelablePromise<BucketPermission> { return __request(OpenAPI, { method: 'PUT', - url: '/permissions/bucket/{bucket_name}/user/{username}', + url: '/permissions/bucket/{bucket_name}/user/{uid}', path: { - 'username': username, + 'uid': uid, 'bucket_name': bucketName, }, body: requestBody, @@ -81,20 +81,20 @@ export class BucketPermissionsService { * The owner of the bucket and the grantee of the permission can delete it. * * @param bucketName Name of bucket - * @param username Username of a user + * @param uid UID of a user * @returns void * @throws ApiError */ public static bucketPermissionsDeletePermissionForBucket( bucketName: string, - username: string, + uid: string, ): CancelablePromise<void> { return __request(OpenAPI, { method: 'DELETE', - url: '/permissions/bucket/{bucket_name}/user/{username}', + url: '/permissions/bucket/{bucket_name}/user/{uid}', path: { 'bucket_name': bucketName, - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -135,18 +135,18 @@ export class BucketPermissionsService { * Get all permissions for a user. * List all the bucket permissions for the given user. * - * @param username Username of a user + * @param uid UID of a user * @returns BucketPermission Successful Response * @throws ApiError */ public static bucketPermissionsListPermissionsPerUser( - username: string, + uid: string, ): CancelablePromise<Array<BucketPermission>> { return __request(OpenAPI, { method: 'GET', - url: '/permissions/user/{username}', + url: '/permissions/user/{uid}', path: { - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, diff --git a/src/client/services/KeyService.ts b/src/client/services/KeyService.ts index 6f6957867d3e7369fecd3a3dbd1463849a3159a3..26e68c0300da2bbd1a25b544ba4a4666854bec33 100644 --- a/src/client/services/KeyService.ts +++ b/src/client/services/KeyService.ts @@ -13,18 +13,18 @@ export class KeyService { * Get the S3 Access keys from a user * Get all the S3 Access keys for a specific user. * - * @param username Username of a user + * @param uid UID of a user * @returns S3Key Successful Response * @throws ApiError */ public static keyGetUserKeys( - username: string, + uid: string, ): CancelablePromise<Array<S3Key>> { return __request(OpenAPI, { method: 'GET', - url: '/users/{username}/keys', + url: '/users/{uid}/keys', path: { - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -39,18 +39,18 @@ export class KeyService { * Create a Access key for a user * Create a S3 Access key for a specific user. * - * @param username Username of a user + * @param uid UID of a user * @returns S3Key Successful Response * @throws ApiError */ public static keyCreateUserKey( - username: string, + uid: string, ): CancelablePromise<S3Key> { return __request(OpenAPI, { method: 'POST', - url: '/users/{username}/keys', + url: '/users/{uid}/keys', path: { - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -66,20 +66,20 @@ export class KeyService { * Get a specific S3 Access Key for a specific user. * * @param accessId ID of the S3 access key - * @param username Username of a user + * @param uid UID of a user * @returns S3Key Successful Response * @throws ApiError */ public static keyGetUserKey( accessId: string, - username: string, + uid: string, ): CancelablePromise<S3Key> { return __request(OpenAPI, { method: 'GET', - url: '/users/{username}/keys/{access_id}', + url: '/users/{uid}/keys/{access_id}', path: { 'access_id': accessId, - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -95,20 +95,20 @@ export class KeyService { * Delete a specific S3 Access key for a specific user. * * @param accessId ID of the S3 access key - * @param username Username of a user + * @param uid UID of a user * @returns void * @throws ApiError */ public static keyDeleteUserKey( accessId: string, - username: string, + uid: string, ): CancelablePromise<void> { return __request(OpenAPI, { method: 'DELETE', - url: '/users/{username}/keys/{access_id}', + url: '/users/{uid}/keys/{access_id}', path: { 'access_id': accessId, - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, diff --git a/src/client/services/UserService.ts b/src/client/services/UserService.ts index fd37cb612103acb573849874d4fa6e620372f0d0..8a1467587f2d38417615706cfcfbe9039695900b 100644 --- a/src/client/services/UserService.ts +++ b/src/client/services/UserService.ts @@ -30,21 +30,21 @@ export class UserService { } /** - * Get a user by its username - * Return the user with the specific username. A user can only view himself. + * Get a user by its uid + * Return the user with the specific uid. A user can only view himself. * - * @param username Username of a user + * @param uid UID of a user * @returns User Successful Response * @throws ApiError */ public static userGetUser( - username: string, + uid: string, ): CancelablePromise<User> { return __request(OpenAPI, { method: 'GET', - url: '/users/{username}', + url: '/users/{uid}', path: { - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -59,18 +59,18 @@ export class UserService { * Get the S3 Access keys from a user * Get all the S3 Access keys for a specific user. * - * @param username Username of a user + * @param uid UID of a user * @returns S3Key Successful Response * @throws ApiError */ public static keyGetUserKeys( - username: string, + uid: string, ): CancelablePromise<Array<S3Key>> { return __request(OpenAPI, { method: 'GET', - url: '/users/{username}/keys', + url: '/users/{uid}/keys', path: { - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -85,18 +85,18 @@ export class UserService { * Create a Access key for a user * Create a S3 Access key for a specific user. * - * @param username Username of a user + * @param uid UID of a user * @returns S3Key Successful Response * @throws ApiError */ public static keyCreateUserKey( - username: string, + uid: string, ): CancelablePromise<S3Key> { return __request(OpenAPI, { method: 'POST', - url: '/users/{username}/keys', + url: '/users/{uid}/keys', path: { - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -112,20 +112,20 @@ export class UserService { * Get a specific S3 Access Key for a specific user. * * @param accessId ID of the S3 access key - * @param username Username of a user + * @param uid UID of a user * @returns S3Key Successful Response * @throws ApiError */ public static keyGetUserKey( accessId: string, - username: string, + uid: string, ): CancelablePromise<S3Key> { return __request(OpenAPI, { method: 'GET', - url: '/users/{username}/keys/{access_id}', + url: '/users/{uid}/keys/{access_id}', path: { 'access_id': accessId, - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, @@ -141,20 +141,20 @@ export class UserService { * Delete a specific S3 Access key for a specific user. * * @param accessId ID of the S3 access key - * @param username Username of a user + * @param uid UID of a user * @returns void * @throws ApiError */ public static keyDeleteUserKey( accessId: string, - username: string, + uid: string, ): CancelablePromise<void> { return __request(OpenAPI, { method: 'DELETE', - url: '/users/{username}/keys/{access_id}', + url: '/users/{uid}/keys/{access_id}', path: { 'access_id': accessId, - 'username': username, + 'uid': uid, }, errors: { 400: `Error decoding JWT Token`, diff --git a/src/components/CreateBucketComponent.vue b/src/components/CreateBucketComponent.vue index c0c21851da35146133157d3ee7a5820857b56246..da0a5065a02a4f3fccfa16f8e57976f0c732ed7d 100644 --- a/src/components/CreateBucketComponent.vue +++ b/src/components/CreateBucketComponent.vue @@ -1,9 +1,11 @@ <script setup lang="ts"> import { BucketService } from "@/client"; import type { BucketIn } from "@/client"; -import { reactive, ref } from "vue"; +import { reactive } from "vue"; +/* import { onMounted } from "vue"; import { Modal } from "bootstrap"; +*/ const emit = defineEmits(["bucketCreated"]); const bucket = reactive({ name: "", description: "" } as BucketIn); @@ -16,18 +18,21 @@ const formState = reactive({ bucketNameTaken: boolean; loading: boolean; }); -let theModal: Modal | null = null; -const modal = ref(null as Element | null); defineProps<{ modalid: string; modallabel: string; }>(); +/* +let theModal: Modal | null = null; +const modal = ref(null as Element | null); + onMounted(() => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion theModal = Modal.getOrCreateInstance(modal.value!); }); + */ function createBucket() { formState.validated = true; @@ -39,7 +44,7 @@ function createBucket() { BucketService.bucketCreateBucket(bucket) .then((createdBucket) => { emit("bucketCreated", createdBucket); - console.log(theModal); + //console.log(theModal); //theModal?.hide(); bucket.name = ""; bucket.description = "";