You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7ccc48c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/api/command/RegisterOAuthProviderCmd.java
@@ -76,6 +79,9 @@ public class RegisterOAuthProviderCmd extends BaseCmd {
76
79
@Parameter(name = ApiConstants.TOKEN_URL, type = CommandType.STRING, description = "Token URL for OAuth finalization (only required for keycloak provider)", since = "4.23.0")
77
80
privateStringtokenUrl;
78
81
82
+
@Parameter(name = ApiConstants.ENABLED, type = CommandType.BOOLEAN, description = "OAuth provider will be enabled or disabled based on this value, defaults to true if not specified", since = "24.0.0")
83
+
privateBooleanenabled;
84
+
79
85
@Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP,
80
86
description = "Any OAuth provider details in key/value pairs using format details[i].keyname=keyvalue. Example: details[0].clientsecret=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")
81
87
protectedMapdetails;
@@ -121,6 +127,13 @@ public String getTokenUrl() {
121
127
returntokenUrl;
122
128
}
123
129
130
+
publicBooleangetEnabled() {
131
+
if (enabled == null) {
132
+
enabled = true; // default to enabled if not specified
133
+
}
134
+
returnenabled;
135
+
}
136
+
124
137
publicMapgetDetails() {
125
138
if (MapUtils.isEmpty(details)) {
126
139
returnnull;
@@ -151,6 +164,22 @@ public void execute() throws ServerApiException, ConcurrentOperationException, E
Copy file name to clipboardExpand all lines: plugins/user-authenticators/oauth2/src/test/java/org/apache/cloudstack/oauth2/OAuth2AuthManagerImplTest.java
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@
49
49
importjava.util.Map;
50
50
51
51
importstaticorg.junit.Assert.assertEquals;
52
+
importstaticorg.junit.Assert.assertFalse;
52
53
importstaticorg.junit.Assert.assertNull;
53
54
importstaticorg.junit.Assert.assertTrue;
54
55
importstaticorg.mockito.Mockito.doNothing;
@@ -120,6 +121,29 @@ public void testRegisterOauthProvider() {
Copy file name to clipboardExpand all lines: plugins/user-authenticators/oauth2/src/test/java/org/apache/cloudstack/oauth2/api/command/RegisterOAuthProviderCmdTest.java
0 commit comments