From dfab00d45e7855ebcdb0c5c761420a33628abb75 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Tue, 11 Jun 2024 14:32:25 -0700 Subject: [PATCH] Update mc commands Signed-off-by: Victor Chang --- .licenserc.yaml | 2 ++ src/Plugins/MinIO/StorageAdminService.cs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.licenserc.yaml b/.licenserc.yaml index aca4918..de4456a 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -2,6 +2,8 @@ header: license: spdx-id: Apache-2.0 copyright-owner: MONAI Consortium + copyright-year: '2021-2024' + paths: - 'src' diff --git a/src/Plugins/MinIO/StorageAdminService.cs b/src/Plugins/MinIO/StorageAdminService.cs index e6dfb58..880a604 100644 --- a/src/Plugins/MinIO/StorageAdminService.cs +++ b/src/Plugins/MinIO/StorageAdminService.cs @@ -1,5 +1,5 @@ /* - * Copyright 2022 MONAI Consortium + * Copyright 2022-2024 MONAI Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,7 @@ public async Task SetPolicyAsync(IdentityType policyType, List pol Guard.Against.NullOrWhiteSpace(itemName, nameof(itemName)); var policiesStr = string.Join(',', policies); - var setPolicyCmd = $"admin policy set {_serviceName} {policiesStr} {policyType.ToString().ToLower()}={itemName}"; + var setPolicyCmd = $"admin policy attach {_serviceName} {policiesStr} --{policyType.ToString().ToLower()} {itemName}"; var result = await ExecuteAsync(setPolicyCmd).ConfigureAwait(false); var expectedResult = $"Policy `{policiesStr}` is set on {policyType.ToString().ToLower()} `{itemName}`"; @@ -260,7 +260,7 @@ private async Task CreatePolicyAsync(PolicyRequest[] policyRequests, str Guard.Against.NullOrWhiteSpace(username, nameof(username)); var policyFileName = await CreatePolicyFile(policyRequests, username).ConfigureAwait(false); - var result = await ExecuteAsync($"admin policy add {_serviceName} pol_{username} {policyFileName}").ConfigureAwait(false); + var result = await ExecuteAsync($"admin policy create {_serviceName} pol_{username} {policyFileName}").ConfigureAwait(false); if (result.Any(r => r.Contains($"Added policy `pol_{username}` successfully.")) is false) { await RemoveUserAsync(username).ConfigureAwait(false);