Skip to content

Commit 5c2854f

Browse files
authored
Add {add,update,delete,list}ServiceAccount and getServiceAccountInfo Admin APIs (#1505)
1 parent bff98b7 commit 5c2854f

File tree

5 files changed

+404
-12
lines changed

5 files changed

+404
-12
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage,
3+
* (C) 2021 MinIO, Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package io.minio.admin;
19+
20+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21+
import com.fasterxml.jackson.annotation.JsonProperty;
22+
import io.minio.credentials.Credentials;
23+
24+
/**
25+
* add service account response.
26+
*
27+
* <p>* @see <a href=
28+
* "https://github.com/minio/madmin-go/blob/main/user-commands.go#L388">user-commands.go</a>
29+
*/
30+
@JsonIgnoreProperties(ignoreUnknown = true)
31+
public class AddServiceAccountResp {
32+
@JsonProperty("credentials")
33+
private Credentials credentials;
34+
35+
public Credentials credentials() {
36+
return credentials;
37+
}
38+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage,
3+
* (C) 2021 MinIO, Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package io.minio.admin;
19+
20+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21+
import com.fasterxml.jackson.annotation.JsonProperty;
22+
23+
/**
24+
* service account info.
25+
*
26+
* <p>* @see <a href=
27+
* "https://github.com/minio/madmin-go/blob/main/user-commands.go#L535">user-commands.go</a>
28+
*/
29+
@JsonIgnoreProperties(ignoreUnknown = true)
30+
public class GetServiceAccountInfoResp {
31+
@JsonProperty("parentUser")
32+
private String parentUser;
33+
34+
@JsonProperty("accountStatus")
35+
private String accountStatus;
36+
37+
@JsonProperty("impliedPolicy")
38+
private boolean impliedPolicy;
39+
40+
@JsonProperty("policy")
41+
private String policy;
42+
43+
@JsonProperty("name")
44+
private String name;
45+
46+
@JsonProperty("description")
47+
private String description;
48+
49+
@JsonProperty("expiration")
50+
private String expiration;
51+
52+
public String parentUser() {
53+
return parentUser;
54+
}
55+
56+
public String accountStatus() {
57+
return accountStatus;
58+
}
59+
60+
public boolean impliedPolicy() {
61+
return impliedPolicy;
62+
}
63+
64+
public String description() {
65+
return description;
66+
}
67+
68+
public String name() {
69+
return name;
70+
}
71+
72+
public String expiration() {
73+
return expiration;
74+
}
75+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage,
3+
* (C) 2021 MinIO, Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package io.minio.admin;
19+
20+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21+
import com.fasterxml.jackson.annotation.JsonProperty;
22+
import java.util.List;
23+
24+
/** list service account response. */
25+
@JsonIgnoreProperties(ignoreUnknown = true)
26+
public class ListServiceAccountResp {
27+
@JsonProperty("accounts")
28+
private List<ListServiceAccountInfo> accounts;
29+
30+
public List<ListServiceAccountInfo> accounts() {
31+
return accounts;
32+
}
33+
34+
public static class ListServiceAccountInfo {
35+
@JsonProperty("accessKey")
36+
private String accessKey;
37+
38+
@JsonProperty("expiration")
39+
private String expiration;
40+
41+
public String expiration() {
42+
return expiration;
43+
}
44+
45+
public String accessKey() {
46+
return accessKey;
47+
}
48+
}
49+
}

0 commit comments

Comments
 (0)