Skip to content

Commit d8010b4

Browse files
committed
Merge branch '841-user-admin-spaces' into 2.x
2 parents 180cbe0 + c35868f commit d8010b4

File tree

12 files changed

+1296
-19
lines changed

12 files changed

+1296
-19
lines changed

cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/useradmin/DefaultUserAdmin.java

Lines changed: 264 additions & 4 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2013-2017 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.operations.useradmin;
18+
19+
/**
20+
* The space roles of users
21+
*/
22+
public enum SpaceRole {
23+
24+
/**
25+
* User is an Auditor for the space
26+
*/
27+
AUDITOR,
28+
29+
/**
30+
* User is a Developer for the space
31+
*/
32+
DEVELOPER,
33+
34+
/**
35+
* User is a Manager for the space
36+
*/
37+
MANAGER
38+
39+
}

cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/useradmin/UserAdmin.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,28 @@ public interface UserAdmin {
3939
*/
4040
Mono<Void> delete(DeleteUserRequest request);
4141

42+
/**
43+
* List space users
44+
*
45+
* @param request the list space users request
46+
* @return the Space Users
47+
*/
48+
Mono<SpaceUsers> listSpaceUsers(ListSpaceUsersRequest request);
49+
50+
/**
51+
* Assign a space role to a user
52+
*
53+
* @param request the set space user request
54+
* @return completion indicator
55+
*/
56+
Mono<Void> setSpaceRole(SetSpaceRoleRequest request);
57+
58+
/**
59+
* Remove a space role from a user
60+
*
61+
* @param request the unset space user request
62+
* @return completion indicator
63+
*/
64+
Mono<Void> unsetSpaceRole(UnsetSpaceRoleRequest request);
65+
4266
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2013-2018 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.operations.useradmin;
18+
19+
import org.immutables.value.Value;
20+
21+
/**
22+
* The request options for the list space users operation
23+
*/
24+
@Value.Immutable
25+
abstract class _ListSpaceUsersRequest {
26+
27+
/**
28+
* Organization name to list
29+
*/
30+
abstract String getOrganizationName();
31+
32+
/**
33+
* Space name to list
34+
*/
35+
abstract String getSpaceName();
36+
37+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2013-2018 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.operations.useradmin;
18+
19+
import org.immutables.value.Value;
20+
21+
/**
22+
* The request options for the set space role operation
23+
*/
24+
@Value.Immutable
25+
abstract class _SetSpaceRoleRequest {
26+
27+
/**
28+
* Organization name
29+
*/
30+
abstract String getOrganizationName();
31+
32+
/**
33+
* Space name
34+
*/
35+
abstract String getSpaceName();
36+
37+
/**
38+
* Role
39+
*/
40+
abstract SpaceRole getSpaceRole();
41+
42+
/**
43+
* Username
44+
*/
45+
abstract String getUsername();
46+
47+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2013-2018 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.operations.useradmin;
18+
19+
import org.immutables.value.Value;
20+
21+
import java.util.List;
22+
23+
/**
24+
* The users for a space
25+
*/
26+
@Value.Immutable
27+
abstract class _SpaceUsers {
28+
29+
/**
30+
* The space's auditors
31+
*/
32+
abstract List<String> getAuditors();
33+
34+
/**
35+
* The space's developers
36+
*/
37+
abstract List<String> getDevelopers();
38+
39+
/**
40+
* The space's managers
41+
*/
42+
abstract List<String> getManagers();
43+
44+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2013-2018 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.operations.useradmin;
18+
19+
import org.immutables.value.Value;
20+
21+
/**
22+
* The request options for the unset space role operation
23+
*/
24+
@Value.Immutable
25+
abstract class _UnsetSpaceRoleRequest {
26+
27+
/**
28+
* Organization name
29+
*/
30+
abstract String getOrganizationName();
31+
32+
/**
33+
* Space name
34+
*/
35+
abstract String getSpaceName();
36+
37+
/**
38+
* Role
39+
*/
40+
abstract SpaceRole getSpaceRole();
41+
42+
/**
43+
* Username
44+
*/
45+
abstract String getUsername();
46+
47+
}

0 commit comments

Comments
 (0)