You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by bd...@apache.org on 2026/03/17 00:12:02 UTC
(directory-scimple) branch develop updated (2c774384 -> 1aad28b3)
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
from 2c774384 Update dependency maven to v3.9.14
new 3c71cb1c Removing InMemorySelfResolverImpl, default implementation provides the same functionality
new 1aad28b3 Cleaning up examples to be consistent.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../scim/example/jersey4/JerseyApplication.java | 8 ++--
.../jersey4/extensions/LuckyNumberExtension.java | 9 ++--
.../jersey4/service/InMemoryGroupService.java | 50 +++++++++++-----------
.../jersey4/service/InMemorySelfResolverImpl.java | 37 ----------------
.../jersey4/service/InMemoryUserService.java | 37 ++++++++--------
.../scim/example/jersey/JerseyApplication.java | 8 ++--
.../jersey/extensions/LuckyNumberExtension.java | 9 ++--
.../jersey/service/InMemoryGroupService.java | 6 +--
.../jersey/service/InMemorySelfResolverImpl.java | 37 ----------------
.../jersey/service/InMemoryUserService.java | 3 +-
.../memory/extensions/LuckyNumberExtension.java | 8 ++--
.../scim/example/memory/rest/RestApplication.java | 7 ++-
.../memory/service/InMemorySelfResolverImpl.java | 37 ----------------
.../memory/service/InMemoryUserService.java | 12 +++---
.../scim/example/quarkus/QuarkusApplication.java | 6 +--
.../quarkus/extensions/LuckyNumberExtension.java | 8 ++--
.../quarkus/service/InMemoryGroupService.java | 2 +-
.../quarkus/service/InMemorySelfResolverImpl.java | 37 ----------------
.../quarkus/service/InMemoryUserService.java | 4 +-
.../spring/ScimpleSpringBootApplication.java | 11 +++--
.../spring/extensions/LuckyNumberExtension.java | 8 ++--
.../spring/service/InMemoryGroupService.java | 42 +++++++++---------
.../spring/service/InMemorySelfResolverImpl.java | 37 ----------------
.../spring/service/InMemoryUserService.java | 38 ++++++++--------
.../spring/ScimpleSpringBootApplication.java | 9 ++--
.../spring/extensions/LuckyNumberExtension.java | 8 ++--
.../spring/service/InMemoryGroupService.java | 8 ++--
.../spring/service/InMemorySelfResolverImpl.java | 37 ----------------
.../spring/service/InMemoryUserService.java | 12 +++---
.../scim/spring/it/app/InMemoryUserService.java | 2 +-
30 files changed, 150 insertions(+), 387 deletions(-)
delete mode 100644 scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemorySelfResolverImpl.java
delete mode 100644 scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemorySelfResolverImpl.java
delete mode 100644 scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemorySelfResolverImpl.java
delete mode 100644 scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemorySelfResolverImpl.java
delete mode 100644 scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemorySelfResolverImpl.java
delete mode 100644 scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemorySelfResolverImpl.java
(directory-scimple) 01/02: Removing InMemorySelfResolverImpl, default implementation provides the same functionality
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
commit 3c71cb1c1655dea4f4c550ebe4b17999bec4f0ca
Author: Brian Demers <bd...@apache.org>
AuthorDate: Tue Mar 3 15:08:40 2026 -0500
Removing InMemorySelfResolverImpl, default implementation provides the same functionality
---
.../jersey4/service/InMemorySelfResolverImpl.java | 37 ----------------------
.../jersey/service/InMemorySelfResolverImpl.java | 37 ----------------------
.../memory/service/InMemorySelfResolverImpl.java | 37 ----------------------
.../quarkus/service/InMemorySelfResolverImpl.java | 37 ----------------------
.../spring/service/InMemorySelfResolverImpl.java | 37 ----------------------
.../spring/service/InMemorySelfResolverImpl.java | 37 ----------------------
6 files changed, 222 deletions(-)
diff --git a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemorySelfResolverImpl.java b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemorySelfResolverImpl.java
deleted file mode 100644
index 20714729..00000000
--- a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemorySelfResolverImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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 org.apache.directory.scim.example.jersey4.service;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import org.apache.directory.scim.server.exception.UnableToResolveIdResourceException;
-import org.apache.directory.scim.core.repository.SelfIdResolver;
-
-import java.security.Principal;
-
-import jakarta.ws.rs.core.Response.Status;
-
-@ApplicationScoped
-public class InMemorySelfResolverImpl implements SelfIdResolver {
-
- @Override
- public String resolveToInternalId(Principal principal) throws UnableToResolveIdResourceException {
- throw new UnableToResolveIdResourceException(Status.NOT_IMPLEMENTED, "Caller Principal not available");
- }
-}
diff --git a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemorySelfResolverImpl.java b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemorySelfResolverImpl.java
deleted file mode 100644
index 23724204..00000000
--- a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemorySelfResolverImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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 org.apache.directory.scim.example.jersey.service;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import org.apache.directory.scim.server.exception.UnableToResolveIdResourceException;
-import org.apache.directory.scim.core.repository.SelfIdResolver;
-
-import java.security.Principal;
-
-import jakarta.ws.rs.core.Response.Status;
-
-@ApplicationScoped
-public class InMemorySelfResolverImpl implements SelfIdResolver {
-
- @Override
- public String resolveToInternalId(Principal principal) throws UnableToResolveIdResourceException {
- throw new UnableToResolveIdResourceException(Status.NOT_IMPLEMENTED, "Caller Principal not available");
- }
-}
diff --git a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemorySelfResolverImpl.java b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemorySelfResolverImpl.java
deleted file mode 100644
index 711a1eac..00000000
--- a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemorySelfResolverImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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 org.apache.directory.scim.example.memory.service;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import org.apache.directory.scim.server.exception.UnableToResolveIdResourceException;
-import org.apache.directory.scim.core.repository.SelfIdResolver;
-
-import java.security.Principal;
-
-import jakarta.ws.rs.core.Response.Status;
-
-@ApplicationScoped
-public class InMemorySelfResolverImpl implements SelfIdResolver {
-
- @Override
- public String resolveToInternalId(Principal principal) throws UnableToResolveIdResourceException {
- throw new UnableToResolveIdResourceException(Status.NOT_IMPLEMENTED, "Caller Principal not available");
- }
-}
diff --git a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemorySelfResolverImpl.java b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemorySelfResolverImpl.java
deleted file mode 100644
index 87ab36cf..00000000
--- a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemorySelfResolverImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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 org.apache.directory.scim.example.quarkus.service;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import org.apache.directory.scim.server.exception.UnableToResolveIdResourceException;
-import org.apache.directory.scim.core.repository.SelfIdResolver;
-
-import java.security.Principal;
-
-import jakarta.ws.rs.core.Response.Status;
-
-@ApplicationScoped
-public class InMemorySelfResolverImpl implements SelfIdResolver {
-
- @Override
- public String resolveToInternalId(Principal principal) throws UnableToResolveIdResourceException {
- throw new UnableToResolveIdResourceException(Status.NOT_IMPLEMENTED, "Caller Principal not available");
- }
-}
diff --git a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemorySelfResolverImpl.java b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemorySelfResolverImpl.java
deleted file mode 100644
index 4e08395b..00000000
--- a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemorySelfResolverImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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 org.apache.directory.scim.example.spring.service;
-
-import org.apache.directory.scim.core.repository.SelfIdResolver;
-import org.apache.directory.scim.server.exception.UnableToResolveIdResourceException;
-
-import java.security.Principal;
-
-import jakarta.ws.rs.core.Response.Status;
-import org.springframework.stereotype.Service;
-
-@Service
-public class InMemorySelfResolverImpl implements SelfIdResolver {
-
- @Override
- public String resolveToInternalId(Principal principal) throws UnableToResolveIdResourceException {
- throw new UnableToResolveIdResourceException(Status.NOT_IMPLEMENTED, "Caller Principal not available");
- }
-}
diff --git a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemorySelfResolverImpl.java b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemorySelfResolverImpl.java
deleted file mode 100644
index 4e08395b..00000000
--- a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemorySelfResolverImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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 org.apache.directory.scim.example.spring.service;
-
-import org.apache.directory.scim.core.repository.SelfIdResolver;
-import org.apache.directory.scim.server.exception.UnableToResolveIdResourceException;
-
-import java.security.Principal;
-
-import jakarta.ws.rs.core.Response.Status;
-import org.springframework.stereotype.Service;
-
-@Service
-public class InMemorySelfResolverImpl implements SelfIdResolver {
-
- @Override
- public String resolveToInternalId(Principal principal) throws UnableToResolveIdResourceException {
- throw new UnableToResolveIdResourceException(Status.NOT_IMPLEMENTED, "Caller Principal not available");
- }
-}
(directory-scimple) 02/02: Cleaning up examples to be consistent.
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
commit 1aad28b3898eefaafd707f4e8a2950a63dea239f
Author: Brian Demers <bd...@apache.org>
AuthorDate: Tue Mar 3 15:44:22 2026 -0500
Cleaning up examples to be consistent.
- javadoc tweaks
- formatting
- header formatting
---
.../scim/example/jersey4/JerseyApplication.java | 8 ++--
.../jersey4/extensions/LuckyNumberExtension.java | 9 ++--
.../jersey4/service/InMemoryGroupService.java | 50 +++++++++++-----------
.../jersey4/service/InMemoryUserService.java | 37 ++++++++--------
.../scim/example/jersey/JerseyApplication.java | 8 ++--
.../jersey/extensions/LuckyNumberExtension.java | 9 ++--
.../jersey/service/InMemoryGroupService.java | 6 +--
.../jersey/service/InMemoryUserService.java | 3 +-
.../memory/extensions/LuckyNumberExtension.java | 8 ++--
.../scim/example/memory/rest/RestApplication.java | 7 ++-
.../memory/service/InMemoryUserService.java | 12 +++---
.../scim/example/quarkus/QuarkusApplication.java | 6 +--
.../quarkus/extensions/LuckyNumberExtension.java | 8 ++--
.../quarkus/service/InMemoryGroupService.java | 2 +-
.../quarkus/service/InMemoryUserService.java | 4 +-
.../spring/ScimpleSpringBootApplication.java | 11 +++--
.../spring/extensions/LuckyNumberExtension.java | 8 ++--
.../spring/service/InMemoryGroupService.java | 42 +++++++++---------
.../spring/service/InMemoryUserService.java | 38 ++++++++--------
.../spring/ScimpleSpringBootApplication.java | 9 ++--
.../spring/extensions/LuckyNumberExtension.java | 8 ++--
.../spring/service/InMemoryGroupService.java | 8 ++--
.../spring/service/InMemoryUserService.java | 12 +++---
.../scim/spring/it/app/InMemoryUserService.java | 2 +-
24 files changed, 150 insertions(+), 165 deletions(-)
diff --git a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/JerseyApplication.java b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/JerseyApplication.java
index 4720e837..5e06cc76 100644
--- a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/JerseyApplication.java
+++ b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/JerseyApplication.java
@@ -44,7 +44,7 @@ import static org.apache.directory.scim.spec.schema.ServiceProviderConfiguration
public class JerseyApplication extends Application {
private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(JerseyApplication.class);
-
+
@Override
public Set<Class<?>> getClasses() {
return ScimResourceHelper.scimpleFeatureAndResourceClasses();
@@ -53,11 +53,11 @@ public class JerseyApplication extends Application {
@Produces
ServerConfiguration serverConfiguration() {
return new ServerConfiguration()
- // Set any unique configuration bits
.setId("scimple-jersey4-example")
.setDocumentationUri("https://github.com/apache/directory-scimple")
- // set the auth scheme too
- .addAuthenticationSchema(oauthBearer());
+ // Informational only, returned by /ServiceProviderConfig.
+ // This does not enforce authentication. Use oauthBearer() or httpBasic() as appropriate.
+ .addAuthenticationSchema(oauthBearer());
}
public static void main(String[] args) {
diff --git a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/extensions/LuckyNumberExtension.java b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/extensions/LuckyNumberExtension.java
index 8ebe1aae..2bc0277b 100644
--- a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/extensions/LuckyNumberExtension.java
+++ b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/extensions/LuckyNumberExtension.java
@@ -31,24 +31,24 @@ import org.apache.directory.scim.spec.schema.Schema;
/**
* Allows a User's lucky number to be passed as part of the User's entry via
* the SCIM protocol.
- *
+ *
* @author Chris Harm <crh5255@psu.edu>
*/
@XmlRootElement( name = "LuckyNumberExtension", namespace = "http://www.psu.edu/schemas/psu-scim" )
@XmlAccessorType(XmlAccessType.NONE)
@ScimExtensionType(id = LuckyNumberExtension.SCHEMA_URN, description="Lucky Numbers", name="LuckyNumbers", required=true)
public class LuckyNumberExtension implements ScimExtension {
-
+
public static final String SCHEMA_URN = "urn:mem:params:scim:schemas:extension:LuckyNumberExtension";
@ScimAttribute(returned=Schema.Attribute.Returned.DEFAULT, required=true)
@XmlElement
private long luckyNumber;
-
+
/**
* Provides the URN associated with this extension which, as defined by the
* SCIM specification is the extension's unique identifier.
- *
+ *
* @return The extension's URN.
*/
@Override
@@ -56,7 +56,6 @@ public class LuckyNumberExtension implements ScimExtension {
return SCHEMA_URN;
}
-
public long getLuckyNumber() {
return this.luckyNumber;
}
diff --git a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemoryGroupService.java b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemoryGroupService.java
index 92f20205..ad1bdab8 100644
--- a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemoryGroupService.java
+++ b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemoryGroupService.java
@@ -1,21 +1,21 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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 org.apache.directory.scim.example.jersey4.service;
@@ -41,16 +41,16 @@ import org.apache.directory.scim.spec.resources.ScimExtension;
import org.apache.directory.scim.spec.resources.ScimGroup;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
@Named
@ApplicationScoped
public class InMemoryGroupService implements Repository<ScimGroup> {
- private final Map<String, ScimGroup> groups = new HashMap<>();
+ private final Map<String, ScimGroup> groups = new ConcurrentHashMap<>();
private SchemaRegistry schemaRegistry;
@@ -89,7 +89,7 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
// check to make sure the group doesn't already exist
boolean existingGroupFound = groups.values().stream()
- .anyMatch(group -> resource.getExternalId().equals(group.getExternalId()));
+ .anyMatch(group -> resource.getExternalId().equals(group.getExternalId()));
if (existingGroupFound) {
// HTTP leaking into data layer
throw new UnableToCreateResourceException(Response.Status.CONFLICT, "Group '" + resource.getExternalId() + "' already exists.");
@@ -105,7 +105,6 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
if (!groups.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
groups.put(id, resource);
return resource;
}
@@ -115,7 +114,6 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
if (!groups.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
ScimGroup resource = patchHandler.apply(get(id, requestContext), patchOperations);
groups.put(id, resource);
return resource;
@@ -139,10 +137,10 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
long startIndex = requestContext.getPageRequest().map(PageRequest::getStartIndex).map(it -> it - 1).orElse(0);
List<ScimGroup> result = groups.values().stream()
- .skip(startIndex)
- .limit(count)
- .filter(FilterExpressions.inMemory(filter, schemaRegistry.getSchema(ScimGroup.SCHEMA_URI)))
- .toList();
+ .skip(startIndex)
+ .limit(count)
+ .filter(FilterExpressions.inMemory(filter, schemaRegistry.getSchema(ScimGroup.SCHEMA_URI)))
+ .toList();
return new FilterResponse<>(result, result.size());
}
diff --git a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemoryUserService.java b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemoryUserService.java
index 25662e91..8c664945 100644
--- a/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemoryUserService.java
+++ b/scim-server-examples/scim-server-jersey-4/src/main/java/org/apache/directory/scim/example/jersey4/service/InMemoryUserService.java
@@ -1,21 +1,21 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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 org.apache.directory.scim.example.jersey4.service;
@@ -50,7 +50,7 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
/**
- * Creates a singleton (effectively) Repository<ScimUser> with a memory-based
+ * Creates a singleton (effectively) {@code Repository<ScimUser>} with a memory-based
* persistence layer.
*
* @author Chris Harm <crh5255@psu.edu>
@@ -156,7 +156,6 @@ public class InMemoryUserService implements Repository<ScimUser> {
return resource;
}
-
/**
* @see Repository#get(java.lang.String, ScimRequestContext)
*/
diff --git a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/JerseyApplication.java b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/JerseyApplication.java
index aa012fa0..3c03b8d2 100644
--- a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/JerseyApplication.java
+++ b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/JerseyApplication.java
@@ -44,7 +44,7 @@ import static org.apache.directory.scim.spec.schema.ServiceProviderConfiguration
public class JerseyApplication extends Application {
private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(JerseyApplication.class);
-
+
@Override
public Set<Class<?>> getClasses() {
return ScimResourceHelper.scimpleFeatureAndResourceClasses();
@@ -53,11 +53,11 @@ public class JerseyApplication extends Application {
@Produces
ServerConfiguration serverConfiguration() {
return new ServerConfiguration()
- // Set any unique configuration bits
.setId("scimple-jersey-example")
.setDocumentationUri("https://github.com/apache/directory-scimple")
- // set the auth scheme too
- .addAuthenticationSchema(oauthBearer());
+ // Informational only, returned by /ServiceProviderConfig.
+ // This does not enforce authentication. Use oauthBearer() or httpBasic() as appropriate.
+ .addAuthenticationSchema(oauthBearer());
}
public static void main(String[] args) {
diff --git a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/extensions/LuckyNumberExtension.java b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/extensions/LuckyNumberExtension.java
index 0a7503b5..e95bc00d 100644
--- a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/extensions/LuckyNumberExtension.java
+++ b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/extensions/LuckyNumberExtension.java
@@ -31,24 +31,24 @@ import org.apache.directory.scim.spec.schema.Schema;
/**
* Allows a User's lucky number to be passed as part of the User's entry via
* the SCIM protocol.
- *
+ *
* @author Chris Harm <crh5255@psu.edu>
*/
@XmlRootElement( name = "LuckyNumberExtension", namespace = "http://www.psu.edu/schemas/psu-scim" )
@XmlAccessorType(XmlAccessType.NONE)
@ScimExtensionType(id = LuckyNumberExtension.SCHEMA_URN, description="Lucky Numbers", name="LuckyNumbers", required=true)
public class LuckyNumberExtension implements ScimExtension {
-
+
public static final String SCHEMA_URN = "urn:mem:params:scim:schemas:extension:LuckyNumberExtension";
@ScimAttribute(returned=Schema.Attribute.Returned.DEFAULT, required=true)
@XmlElement
private long luckyNumber;
-
+
/**
* Provides the URN associated with this extension which, as defined by the
* SCIM specification is the extension's unique identifier.
- *
+ *
* @return The extension's URN.
*/
@Override
@@ -56,7 +56,6 @@ public class LuckyNumberExtension implements ScimExtension {
return SCHEMA_URN;
}
-
public long getLuckyNumber() {
return this.luckyNumber;
}
diff --git a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java
index 5d6895bb..1a34ea4c 100644
--- a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java
+++ b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java
@@ -41,16 +41,16 @@ import org.apache.directory.scim.spec.resources.ScimExtension;
import org.apache.directory.scim.spec.resources.ScimGroup;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
@Named
@ApplicationScoped
public class InMemoryGroupService implements Repository<ScimGroup> {
- private final Map<String, ScimGroup> groups = new HashMap<>();
+ private final Map<String, ScimGroup> groups = new ConcurrentHashMap<>();
private SchemaRegistry schemaRegistry;
@@ -105,7 +105,6 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
if (!groups.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
groups.put(id, resource);
return resource;
}
@@ -115,7 +114,6 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
if (!groups.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
ScimGroup resource = patchHandler.apply(get(id, requestContext), patchOperations);
groups.put(id, resource);
return resource;
diff --git a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryUserService.java b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryUserService.java
index 0d7a9bee..dbb4b699 100644
--- a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryUserService.java
+++ b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryUserService.java
@@ -50,7 +50,7 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
/**
- * Creates a singleton (effectively) Repository<ScimUser> with a memory-based
+ * Creates a singleton (effectively) {@code Repository<ScimUser>} with a memory-based
* persistence layer.
*
* @author Chris Harm <crh5255@psu.edu>
@@ -156,7 +156,6 @@ public class InMemoryUserService implements Repository<ScimUser> {
return resource;
}
-
/**
* @see Repository#get(java.lang.String, ScimRequestContext)
*/
diff --git a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/extensions/LuckyNumberExtension.java b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/extensions/LuckyNumberExtension.java
index 3dc3e683..4c656025 100644
--- a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/extensions/LuckyNumberExtension.java
+++ b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/extensions/LuckyNumberExtension.java
@@ -31,24 +31,24 @@ import org.apache.directory.scim.spec.schema.Schema;
/**
* Allows a User's lucky number to be passed as part of the User's entry via
* the SCIM protocol.
- *
+ *
* @author Chris Harm <crh5255@psu.edu>
*/
@XmlRootElement( name = "LuckyNumberExtension", namespace = "http://www.psu.edu/schemas/psu-scim" )
@XmlAccessorType(XmlAccessType.NONE)
@ScimExtensionType(id = LuckyNumberExtension.SCHEMA_URN, description="Lucky Numbers", name="LuckyNumbers", required=true)
public class LuckyNumberExtension implements ScimExtension {
-
+
public static final String SCHEMA_URN = "urn:mem:params:scim:schemas:extension:LuckyNumberExtension";
@ScimAttribute(returned=Schema.Attribute.Returned.DEFAULT, required=true)
@XmlElement
private long luckyNumber;
-
+
/**
* Provides the URN associated with this extension which, as defined by the
* SCIM specification is the extension's unique identifier.
- *
+ *
* @return The extension's URN.
*/
@Override
diff --git a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/rest/RestApplication.java b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/rest/RestApplication.java
index 40fff0a0..f3abda9a 100644
--- a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/rest/RestApplication.java
+++ b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/rest/RestApplication.java
@@ -28,7 +28,7 @@ import org.apache.directory.scim.server.rest.ScimResourceHelper;
import java.util.Set;
-import static org.apache.directory.scim.spec.schema.ServiceProviderConfiguration.AuthenticationSchema.httpBasic;
+import static org.apache.directory.scim.spec.schema.ServiceProviderConfiguration.AuthenticationSchema.oauthBearer;
@ApplicationPath("v2")
public class RestApplication extends Application {
@@ -37,7 +37,10 @@ public class RestApplication extends Application {
ServerConfiguration serverConfiguration() {
return new ServerConfiguration()
.setId("scimple-in-memory-example")
- .addAuthenticationSchema(httpBasic());
+ .setDocumentationUri("https://github.com/apache/directory-scimple")
+ // Informational only, returned by /ServiceProviderConfig.
+ // This does not enforce authentication. Use oauthBearer() or httpBasic() as appropriate.
+ .addAuthenticationSchema(oauthBearer());
}
@Override
diff --git a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemoryUserService.java b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemoryUserService.java
index 7f4ad502..1f63bdb7 100644
--- a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemoryUserService.java
+++ b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemoryUserService.java
@@ -50,9 +50,9 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
/**
- * Creates a singleton (effectively) Repository<ScimUser> with a memory-based
+ * Creates a singleton (effectively) {@code Repository<ScimUser>} with a memory-based
* persistence layer.
- *
+ *
* @author Chris Harm <crh5255@psu.edu>
*/
@Named
@@ -88,18 +88,18 @@ public class InMemoryUserService implements Repository<ScimUser> {
user.setUserName(DEFAULT_USER_EXTERNAL_ID);
user.setDisplayName(DEFAULT_USER_DISPLAY_NAME);
user.setName(new Name()
- .setGivenName("Tester")
- .setFamilyName("McTest"));
+ .setGivenName("Tester")
+ .setFamilyName("McTest"));
Email email = new Email();
email.setDisplay(DEFAULT_USER_EMAIL_VALUE);
email.setValue(DEFAULT_USER_EMAIL_VALUE);
email.setType(DEFAULT_USER_EMAIL_TYPE);
email.setPrimary(true);
user.setEmails(List.of(email));
-
+
LuckyNumberExtension luckyNumberExtension = new LuckyNumberExtension();
luckyNumberExtension.setLuckyNumber(DEFAULT_USER_LUCKY_NUMBER);
-
+
user.addExtension(luckyNumberExtension);
EnterpriseExtension enterpriseExtension = new EnterpriseExtension();
diff --git a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/QuarkusApplication.java b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/QuarkusApplication.java
index 7be3d9f9..df16047c 100644
--- a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/QuarkusApplication.java
+++ b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/QuarkusApplication.java
@@ -43,11 +43,11 @@ public class QuarkusApplication extends Application {
@Produces
ServerConfiguration serverConfiguration() {
return new ServerConfiguration()
- // Set any unique configuration bits
.setId("scimple-quarkus-example")
.setDocumentationUri("https://github.com/apache/directory-scimple")
- // set the auth scheme too
- .addAuthenticationSchema(oauthBearer());
+ // Informational only, returned by /ServiceProviderConfig.
+ // This does not enforce authentication. Use oauthBearer() or httpBasic() as appropriate.
+ .addAuthenticationSchema(oauthBearer());
}
}
diff --git a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/extensions/LuckyNumberExtension.java b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/extensions/LuckyNumberExtension.java
index 73244321..be8d1b42 100644
--- a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/extensions/LuckyNumberExtension.java
+++ b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/extensions/LuckyNumberExtension.java
@@ -31,24 +31,24 @@ import org.apache.directory.scim.spec.schema.Schema;
/**
* Allows a User's lucky number to be passed as part of the User's entry via
* the SCIM protocol.
- *
+ *
* @author Chris Harm <crh5255@psu.edu>
*/
@XmlRootElement( name = "LuckyNumberExtension", namespace = "http://www.psu.edu/schemas/psu-scim" )
@XmlAccessorType(XmlAccessType.NONE)
@ScimExtensionType(id = LuckyNumberExtension.SCHEMA_URN, description="Lucky Numbers", name="LuckyNumbers", required=true)
public class LuckyNumberExtension implements ScimExtension {
-
+
public static final String SCHEMA_URN = "urn:mem:params:scim:schemas:extension:LuckyNumberExtension";
@ScimAttribute(returned=Schema.Attribute.Returned.DEFAULT, required=true)
@XmlElement
private long luckyNumber;
-
+
/**
* Provides the URN associated with this extension which, as defined by the
* SCIM specification is the extension's unique identifier.
- *
+ *
* @return The extension's URN.
*/
@Override
diff --git a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemoryGroupService.java b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemoryGroupService.java
index 5ad98356..13c26e97 100644
--- a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemoryGroupService.java
+++ b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemoryGroupService.java
@@ -120,7 +120,7 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
}
@Override
- public ScimGroup get(String id, ScimRequestContext requestContext) throws ResourceException {
+ public ScimGroup get(String id, ScimRequestContext requestContext) {
return groups.get(id);
}
diff --git a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemoryUserService.java b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemoryUserService.java
index 4bb2e7c3..182205ac 100644
--- a/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemoryUserService.java
+++ b/scim-server-examples/scim-server-quarkus/src/main/java/org/apache/directory/scim/example/quarkus/service/InMemoryUserService.java
@@ -50,7 +50,7 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
/**
- * Creates a singleton (effectively) Repository<ScimUser> with a memory-based
+ * Creates a singleton (effectively) {@code Repository<ScimUser>} with a memory-based
* persistence layer.
*
* @author Chris Harm <crh5255@psu.edu>
@@ -178,7 +178,7 @@ public class InMemoryUserService implements Repository<ScimUser> {
* @see Repository#find(Filter, ScimRequestContext)
*/
@Override
- public FilterResponse<ScimUser> find(Filter filter, ScimRequestContext requestContext) {
+ public FilterResponse<ScimUser> find(Filter filter, ScimRequestContext requestContext) {
long count = requestContext.getPageRequest().map(PageRequest::getCount).orElse(users.size());
long startIndex = requestContext.getPageRequest().map(PageRequest::getStartIndex).map(it -> it - 1).orElse(0);
diff --git a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java
index 897cd2a8..30fadeee 100644
--- a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java
+++ b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java
@@ -24,7 +24,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
-import static org.apache.directory.scim.spec.schema.ServiceProviderConfiguration.AuthenticationSchema.httpBasic;
+import static org.apache.directory.scim.spec.schema.ServiceProviderConfiguration.AuthenticationSchema.oauthBearer;
@SpringBootApplication
public class ScimpleSpringBootApplication {
@@ -35,12 +35,11 @@ public class ScimpleSpringBootApplication {
@Bean
ServerConfiguration serverConfiguration() {
- // Set any unique configuration bits
return new ServerConfiguration()
- .setId("scimple-spring-boot-example")
+ .setId("scimple-spring-boot-4-example")
.setDocumentationUri("https://github.com/apache/directory-scimple")
-
- // set the auth scheme
- .addAuthenticationSchema(httpBasic());
+ // Informational only, returned by /ServiceProviderConfig.
+ // This does not enforce authentication. Use oauthBearer() or httpBasic() as appropriate.
+ .addAuthenticationSchema(oauthBearer());
}
}
diff --git a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/extensions/LuckyNumberExtension.java b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/extensions/LuckyNumberExtension.java
index 3678c867..caf111b8 100644
--- a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/extensions/LuckyNumberExtension.java
+++ b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/extensions/LuckyNumberExtension.java
@@ -31,24 +31,24 @@ import org.apache.directory.scim.spec.schema.Schema;
/**
* Allows a User's lucky number to be passed as part of the User's entry via
* the SCIM protocol.
- *
+ *
* @author Chris Harm <crh5255@psu.edu>
*/
@XmlRootElement( name = "LuckyNumberExtension", namespace = "http://www.psu.edu/schemas/psu-scim" )
@XmlAccessorType(XmlAccessType.NONE)
@ScimExtensionType(id = LuckyNumberExtension.SCHEMA_URN, description="Lucky Numbers", name="LuckyNumbers", required=true)
public class LuckyNumberExtension implements ScimExtension {
-
+
public static final String SCHEMA_URN = "urn:mem:params:scim:schemas:extension:LuckyNumberExtension";
@ScimAttribute(returned=Schema.Attribute.Returned.DEFAULT, required=true)
@XmlElement
private long luckyNumber;
-
+
/**
* Provides the URN associated with this extension which, as defined by the
* SCIM specification is the extension's unique identifier.
- *
+ *
* @return The extension's URN.
*/
@Override
diff --git a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
index a545f0e7..7afe668f 100644
--- a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
+++ b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
@@ -1,21 +1,21 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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 org.apache.directory.scim.example.spring.service;
@@ -39,15 +39,15 @@ import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
@Service
public class InMemoryGroupService implements Repository<ScimGroup> {
- private final Map<String, ScimGroup> groups = new HashMap<>();
+ private final Map<String, ScimGroup> groups = new ConcurrentHashMap<>();
private final SchemaRegistry schemaRegistry;
@@ -99,7 +99,6 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
if (!groups.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
groups.put(id, resource);
return resource;
}
@@ -109,7 +108,6 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
if (!groups.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
ScimGroup resource = patchHandler.apply(get(id, requestContext), patchOperations);
groups.put(id, resource);
return resource;
@@ -121,7 +119,7 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
}
@Override
- public void delete(String id) throws ResourceNotFoundException {
+ public void delete(String id) throws ResourceException {
if (groups.remove(id) == null) {
throw new ResourceNotFoundException(id);
}
diff --git a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryUserService.java b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryUserService.java
index db262f02..38247410 100644
--- a/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryUserService.java
+++ b/scim-server-examples/scim-server-spring-boot-4/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryUserService.java
@@ -1,21 +1,21 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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 org.apache.directory.scim.example.spring.service;
@@ -48,7 +48,7 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
/**
- * Creates a singleton (effectively) Provider<User> with a memory-based
+ * Creates a singleton (effectively) {@code Repository<ScimUser>} with a memory-based
* persistence layer.
*
* @author Chris Harm <crh5255@psu.edu>
@@ -136,7 +136,6 @@ public class InMemoryUserService implements Repository<ScimUser> {
if (!users.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
users.put(id, resource);
return resource;
}
@@ -146,7 +145,6 @@ public class InMemoryUserService implements Repository<ScimUser> {
if (!users.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
ScimUser resource = patchHandler.apply(get(id, requestContext), patchOperations);
users.put(id, resource);
return resource;
diff --git a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java
index 897cd2a8..ba87b8df 100644
--- a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java
+++ b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java
@@ -24,7 +24,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
-import static org.apache.directory.scim.spec.schema.ServiceProviderConfiguration.AuthenticationSchema.httpBasic;
+import static org.apache.directory.scim.spec.schema.ServiceProviderConfiguration.AuthenticationSchema.oauthBearer;
@SpringBootApplication
public class ScimpleSpringBootApplication {
@@ -35,12 +35,11 @@ public class ScimpleSpringBootApplication {
@Bean
ServerConfiguration serverConfiguration() {
- // Set any unique configuration bits
return new ServerConfiguration()
.setId("scimple-spring-boot-example")
.setDocumentationUri("https://github.com/apache/directory-scimple")
-
- // set the auth scheme
- .addAuthenticationSchema(httpBasic());
+ // Informational only, returned by /ServiceProviderConfig.
+ // This does not enforce authentication. Use oauthBearer() or httpBasic() as appropriate.
+ .addAuthenticationSchema(oauthBearer());
}
}
diff --git a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/extensions/LuckyNumberExtension.java b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/extensions/LuckyNumberExtension.java
index 3678c867..caf111b8 100644
--- a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/extensions/LuckyNumberExtension.java
+++ b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/extensions/LuckyNumberExtension.java
@@ -31,24 +31,24 @@ import org.apache.directory.scim.spec.schema.Schema;
/**
* Allows a User's lucky number to be passed as part of the User's entry via
* the SCIM protocol.
- *
+ *
* @author Chris Harm <crh5255@psu.edu>
*/
@XmlRootElement( name = "LuckyNumberExtension", namespace = "http://www.psu.edu/schemas/psu-scim" )
@XmlAccessorType(XmlAccessType.NONE)
@ScimExtensionType(id = LuckyNumberExtension.SCHEMA_URN, description="Lucky Numbers", name="LuckyNumbers", required=true)
public class LuckyNumberExtension implements ScimExtension {
-
+
public static final String SCHEMA_URN = "urn:mem:params:scim:schemas:extension:LuckyNumberExtension";
@ScimAttribute(returned=Schema.Attribute.Returned.DEFAULT, required=true)
@XmlElement
private long luckyNumber;
-
+
/**
* Provides the URN associated with this extension which, as defined by the
* SCIM specification is the extension's unique identifier.
- *
+ *
* @return The extension's URN.
*/
@Override
diff --git a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
index ebc5dade..7afe668f 100644
--- a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
+++ b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
@@ -39,15 +39,15 @@ import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
@Service
public class InMemoryGroupService implements Repository<ScimGroup> {
- private final Map<String, ScimGroup> groups = new HashMap<>();
+ private final Map<String, ScimGroup> groups = new ConcurrentHashMap<>();
private final SchemaRegistry schemaRegistry;
@@ -99,7 +99,6 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
if (!groups.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
groups.put(id, resource);
return resource;
}
@@ -109,7 +108,6 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
if (!groups.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
ScimGroup resource = patchHandler.apply(get(id, requestContext), patchOperations);
groups.put(id, resource);
return resource;
@@ -121,7 +119,7 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
}
@Override
- public void delete(String id) throws ResourceNotFoundException {
+ public void delete(String id) throws ResourceException {
if (groups.remove(id) == null) {
throw new ResourceNotFoundException(id);
}
diff --git a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryUserService.java b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryUserService.java
index 300a1c44..38247410 100644
--- a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryUserService.java
+++ b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryUserService.java
@@ -48,9 +48,9 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
/**
- * Creates a singleton (effectively) Provider<User> with a memory-based
+ * Creates a singleton (effectively) {@code Repository<ScimUser>} with a memory-based
* persistence layer.
- *
+ *
* @author Chris Harm <crh5255@psu.edu>
*/
@Service
@@ -82,15 +82,15 @@ public class InMemoryUserService implements Repository<ScimUser> {
user.setUserName(DEFAULT_USER_EXTERNAL_ID);
user.setDisplayName(DEFAULT_USER_DISPLAY_NAME);
user.setName(new Name()
- .setGivenName("Tester")
- .setFamilyName("McTest"));
+ .setGivenName("Tester")
+ .setFamilyName("McTest"));
Email email = new Email();
email.setDisplay(DEFAULT_USER_EMAIL_VALUE);
email.setValue(DEFAULT_USER_EMAIL_VALUE);
email.setType(DEFAULT_USER_EMAIL_TYPE);
email.setPrimary(true);
user.setEmails(List.of(email));
-
+
LuckyNumberExtension luckyNumberExtension = new LuckyNumberExtension();
luckyNumberExtension.setLuckyNumber(DEFAULT_USER_LUCKY_NUMBER);
@@ -136,7 +136,6 @@ public class InMemoryUserService implements Repository<ScimUser> {
if (!users.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
users.put(id, resource);
return resource;
}
@@ -146,7 +145,6 @@ public class InMemoryUserService implements Repository<ScimUser> {
if (!users.containsKey(id)) {
throw new ResourceNotFoundException(id);
}
-
ScimUser resource = patchHandler.apply(get(id, requestContext), patchOperations);
users.put(id, resource);
return resource;
diff --git a/support/spring-boot/src/test/java/org/apache/directory/scim/spring/it/app/InMemoryUserService.java b/support/spring-boot/src/test/java/org/apache/directory/scim/spring/it/app/InMemoryUserService.java
index 6ed4a550..358ebda3 100644
--- a/support/spring-boot/src/test/java/org/apache/directory/scim/spring/it/app/InMemoryUserService.java
+++ b/support/spring-boot/src/test/java/org/apache/directory/scim/spring/it/app/InMemoryUserService.java
@@ -46,7 +46,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
- * Creates a singleton (effectively) Provider<User> with a memory-based
+ * Creates a singleton (effectively) {@code Repository<ScimUser>} with a memory-based
* persistence layer.
*
* @author Chris Harm <crh5255@psu.edu>