This repository has been archived by the owner on Dec 12, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Openid-connect-new-OAuthPolicy-fields'
- Loading branch information
Showing
12 changed files
with
968 additions
and
6 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
api/src/main/java/com/stormpath/sdk/oauth/OAuthPolicies.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2013 Stormpath, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.stormpath.sdk.oauth; | ||
|
||
import com.stormpath.sdk.lang.Classes; | ||
|
||
/** | ||
* @since 1.6.0 | ||
*/ | ||
public final class OAuthPolicies { | ||
|
||
public static OAuthPolicyOptions options() { | ||
return (OAuthPolicyOptions) Classes.newInstance("com.stormpath.sdk.impl.oauth.DefaultOAuthPolicyOptions"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
api/src/main/java/com/stormpath/sdk/oauth/OAuthPolicyOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2017 Stormpath, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.stormpath.sdk.oauth; | ||
|
||
import com.stormpath.sdk.query.Options; | ||
|
||
/** | ||
* @since 1.6.0 | ||
*/ | ||
public interface OAuthPolicyOptions<T> extends Options { | ||
|
||
/** | ||
* Ensures that when retrieving an OAuthPolicy, the OAuthPolicy's assigned {@link OAuthPolicy#getScopes()} scopes} | ||
* are also retrieved in the same request. This enhances performance by leveraging a single request | ||
* to retrieve multiple related resources you know you will use. | ||
* | ||
* @return this instance for method chaining. | ||
*/ | ||
T withScopes(); | ||
|
||
/** | ||
* Ensures that when retrieving an OAuthPolicy, the OAuthPolicy's assigned {@link OAuthPolicy#getScopes()} scopes} | ||
* are also retrieved in the same request. This enhances performance by leveraging a single request | ||
* to retrieve multiple related resources you know you will use. | ||
* | ||
* @param limit defines the maximum quantity of items to be retrieved when expanding this Collection Resource. Min:1, Max: 100. The default value is 25. | ||
* @return this instance for method chaining. | ||
*/ | ||
T withScopes(int limit); | ||
|
||
/** | ||
* Ensures that when retrieving an OAuthPolicy, the OAuthPolicy's assigned {@link OAuthPolicy#getScopes()} scopes} | ||
* are also retrieved in the same request. This enhances performance by leveraging a single request | ||
* to retrieve multiple related resources you know you will use. | ||
* | ||
* @param limit defines the maximum quantity of items to be retrieved when expanding this Collection Resource. Min:1, Max: 100. The default value is 25. | ||
* @param offset the zero-based starting index in the entire collection of the first item to return. Default is 0 | ||
* @return this instance for method chaining. | ||
*/ | ||
T withScopes(int limit, int offset); | ||
} |
108 changes: 108 additions & 0 deletions
108
api/src/main/java/com/stormpath/sdk/oauth/openidconnect/Scope.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* Copyright 2017 Stormpath, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.stormpath.sdk.oauth.openidconnect; | ||
|
||
import com.stormpath.sdk.oauth.OAuthPolicy; | ||
import com.stormpath.sdk.resource.Auditable; | ||
import com.stormpath.sdk.resource.Deletable; | ||
import com.stormpath.sdk.resource.Resource; | ||
import com.stormpath.sdk.resource.Saveable; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* A Scope resource is used to configure different openid connect scopes | ||
* with an {@link OAuthPolicy OAuthPolicy} | ||
* | ||
* @since 1.6.0 | ||
*/ | ||
public interface Scope extends Resource, Saveable, Deletable, Auditable { | ||
/** | ||
* Returns the scope's name. | ||
* | ||
* @return the scope's name. | ||
*/ | ||
String getName(); | ||
|
||
/** | ||
* Sets the scope's name. | ||
* @param name the scope's name. | ||
* | ||
* @return this instance for method chaining. | ||
*/ | ||
Scope setName(String name); | ||
|
||
/** | ||
* Returns the scope's friendly name. | ||
* | ||
* @return the scope's friendly name. | ||
*/ | ||
String getFriendlyName(); | ||
|
||
/** | ||
* Sets the scope's friendly name. | ||
* | ||
* @param name the scope's friendly name. | ||
* @return this instance for method chaining. | ||
*/ | ||
Scope setFriendlyName(String name); | ||
|
||
/** | ||
* Returns the scope's description. | ||
* | ||
* @return the scope's description. | ||
*/ | ||
String getDescription(); | ||
|
||
/** | ||
* Sets the scope's description. | ||
* @param description the scope's description. | ||
* | ||
* @return this instance for method chaining. | ||
*/ | ||
Scope setDescription(String description); | ||
|
||
|
||
/** | ||
* Returns the scope's attribute mappings. | ||
* | ||
* @return the scope's attribute mappings. | ||
*/ | ||
Map<String, String> getAttributeMappings(); | ||
|
||
/** | ||
* Sets the scope's attribute mappings. | ||
* @param attributeMappings the scope's attribute mappings. | ||
* | ||
* @return this instance for method chaining. | ||
*/ | ||
Scope setAttributeMappings(Map<String, String> attributeMappings); | ||
|
||
/** | ||
* Returns the {@link OAuthPolicy} associated with this scope. | ||
* | ||
* @return the {@link OAuthPolicy} associated with this scope. | ||
*/ | ||
OAuthPolicy getOAuthPolicy(); | ||
|
||
/** | ||
* Sets the {@link OAuthPolicy} associated with this scope. | ||
* @param oAuthPolicy the {@link OAuthPolicy} associated with this scope. | ||
* | ||
* @return this instance for method chaining. | ||
*/ | ||
Scope setOAuthPolicy(OAuthPolicy oAuthPolicy); | ||
} |
26 changes: 26 additions & 0 deletions
26
api/src/main/java/com/stormpath/sdk/oauth/openidconnect/ScopeList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2017 Stormpath, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.stormpath.sdk.oauth.openidconnect; | ||
|
||
import com.stormpath.sdk.resource.CollectionResource; | ||
|
||
/** | ||
* A {@link CollectionResource} containing {@link Scope} instances. | ||
* | ||
* @since 1.6.0 | ||
*/ | ||
public interface ScopeList extends CollectionResource<Scope> { | ||
} |
Oops, something went wrong.