Skip to content

Commit cf5e5a1

Browse files
authored
Updated tenant creation credentials download to allow mc alias import (#1683)
Removed underscore from credentials Made credentials download output match mc alias import expected format Added URL to createServiceAccountCreds return
1 parent 7f4546e commit cf5e5a1

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

portal-ui/src/screens/Console/Common/CredentialsPrompt/CredentialsPrompt.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const CredentialsPrompt = ({
164164
</div>
165165
) : (
166166
<div className={classes.warningBlock}>
167-
<WarnIcon />
167+
<WarnIcon />
168168
<span>
169169
Write these down, as this is the only time the secret will be
170170
displayed.
@@ -194,30 +194,23 @@ const CredentialsPrompt = ({
194194
if (consoleCreds) {
195195
if (!Array.isArray(consoleCreds)) {
196196
consoleExtras = {
197-
console: [
198-
{
199197
url: consoleCreds.url,
200-
access_key: consoleCreds.accessKey,
201-
secret_key: consoleCreds.secretKey,
198+
accessKey: consoleCreds.accessKey,
199+
secretKey: consoleCreds.secretKey,
202200
api: "s3v4",
203201
path: "auto",
204-
},
205-
],
206202
};
207203
} else {
208204
const cCreds = consoleCreds.map((itemMap) => {
209205
return {
210206
url: itemMap.url,
211-
access_key: itemMap.accessKey,
212-
secret_key: itemMap.secretKey,
207+
accessKey: itemMap.accessKey,
208+
secretKey: itemMap.secretKey,
213209
api: "s3v4",
214210
path: "auto",
215211
};
216212
});
217-
218-
consoleExtras = {
219-
console: [...cCreds],
220-
};
213+
consoleExtras = cCreds[0];
221214
}
222215
}
223216

restapi/user_service_accounts.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ func createServiceAccount(ctx context.Context, userClient MinioAdmin, policy str
128128
}
129129
iamPolicy = iamp
130130
}
131-
132131
creds, err := userClient.addServiceAccount(ctx, iamPolicy, "", "", "")
133132
if err != nil {
134133
return nil, err
@@ -148,12 +147,11 @@ func createServiceAccountCreds(ctx context.Context, userClient MinioAdmin, polic
148147
}
149148
iamPolicy = iamp
150149
}
151-
152150
creds, err := userClient.addServiceAccount(ctx, iamPolicy, "", accessKey, secretKey)
153151
if err != nil {
154152
return nil, err
155153
}
156-
return &models.ServiceAccountCreds{AccessKey: creds.AccessKey, SecretKey: creds.SecretKey}, nil
154+
return &models.ServiceAccountCreds{AccessKey: creds.AccessKey, SecretKey: creds.SecretKey, URL: getMinIOServer()}, nil
157155
}
158156

159157
// getCreateServiceAccountResponse creates a service account with the defined policy for the user that
@@ -214,7 +212,7 @@ func createAUserServiceAccountCreds(ctx context.Context, userClient MinioAdmin,
214212
if err != nil {
215213
return nil, err
216214
}
217-
return &models.ServiceAccountCreds{AccessKey: creds.AccessKey, SecretKey: creds.SecretKey}, nil
215+
return &models.ServiceAccountCreds{AccessKey: creds.AccessKey, SecretKey: creds.SecretKey, URL: getMinIOServer()}, nil
218216
}
219217

220218
// getCreateServiceAccountResponse creates a service account with the defined policy for the user that

0 commit comments

Comments
 (0)