You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by GitBox <gi...@apache.org> on 2022/08/17 21:40:15 UTC

[GitHub] [directory-scimple] bdemers opened a new pull request, #109: Minor changes to Spring example to support support resource filtering

bdemers opened a new pull request, #109:
URL: https://github.com/apache/directory-scimple/pull/109

   And other tweaks needed to pass Okta's public Runscope tests:
   https://developer.okta.com/docs/guides/scim-provisioning-integration-test/main/
   
   NOTE: These test should be turned into an integration suite as to NOT need any 3rd party tools to run them
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


[GitHub] [directory-scimple] bdemers commented on a diff in pull request #109: Minor changes to Spring example to support support resource filtering

Posted by GitBox <gi...@apache.org>.
bdemers commented on code in PR #109:
URL: https://github.com/apache/directory-scimple/pull/109#discussion_r948453190


##########
scim-spec/scim-spec-schema/src/main/java/org/apache/directory/scim/spec/schema/ServiceProviderConfiguration.java:
##########
@@ -47,12 +47,11 @@ public class ServiceProviderConfiguration extends ScimResourceWithOptionalId {
   public static class AuthenticationSchema {
 
     public enum Type {
-      @XmlEnumValue("oauth")
-      OAUTH, @XmlEnumValue("oauth2")
-      OAUTH2, @XmlEnumValue("oauthbearertoken")
-      OAUTH_BEARER, @XmlEnumValue("httpbasic")
-      HTTP_BASIC, @XmlEnumValue("httpdigest")
-      HTTP_DIGEST;
+      @XmlEnumValue("oauth") OAUTH,
+      @XmlEnumValue("oauth2") OAUTH2,
+      @XmlEnumValue("oauthbearertoken") OAUTH_BEARER,
+      @XmlEnumValue("httpbasic") HTTP_BASIC,
+      @XmlEnumValue("httpdigest") HTTP_DIGEST;

Review Comment:
   Just reformatting because was confused when reading these values



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


[GitHub] [directory-scimple] bdemers commented on a diff in pull request #109: Minor changes to Spring example to support support resource filtering

Posted by GitBox <gi...@apache.org>.
bdemers commented on code in PR #109:
URL: https://github.com/apache/directory-scimple/pull/109#discussion_r948452687


##########
scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryScimFilterMatcher.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * 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.spec.exception.ScimResourceInvalidException;
+import org.apache.directory.scim.spec.protocol.filter.AttributeComparisonExpression;
+import org.apache.directory.scim.spec.protocol.filter.CompareOperator;
+import org.apache.directory.scim.spec.protocol.filter.FilterExpression;
+import org.apache.directory.scim.spec.protocol.search.Filter;
+import org.apache.directory.scim.spec.resources.ScimResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.ReflectionUtils;
+
+import java.lang.reflect.Field;
+
+final class InMemoryScimFilterMatcher {
+
+  private static final Logger log = LoggerFactory.getLogger(InMemoryScimFilterMatcher.class);
+
+  private InMemoryScimFilterMatcher(){}
+
+  /**
+   * Basic FilterExpression support for in-memory objects, actual implementations should translate the Filter into
+   * the appropriate query language.
+   */
+  public static boolean matches(ScimResource resource, Filter filter) {

Review Comment:
   This is a bit ugly, bit it's quick and dirty 🤮 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


[GitHub] [directory-scimple] bdemers closed pull request #109: Draft: Minor changes to Spring example to support support resource filtering

Posted by GitBox <gi...@apache.org>.
bdemers closed pull request #109: Draft: Minor changes to Spring example to support support resource filtering
URL: https://github.com/apache/directory-scimple/pull/109


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


[GitHub] [directory-scimple] bdemers commented on a diff in pull request #109: Minor changes to Spring example to support support resource filtering

Posted by GitBox <gi...@apache.org>.
bdemers commented on code in PR #109:
URL: https://github.com/apache/directory-scimple/pull/109#discussion_r948452132


##########
scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/ScimpleSpringBootApplication.java:
##########
@@ -19,12 +19,25 @@
 
 package org.apache.directory.scim.example.spring;
 
+import org.apache.directory.scim.server.configuration.ServerConfiguration;
+import org.apache.directory.scim.spec.schema.ServiceProviderConfiguration;
 import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
 
-@org.springframework.boot.autoconfigure.SpringBootApplication
-public class SpringBootApplication {
+@SpringBootApplication
+public class ScimpleSpringBootApplication {
 
   public static void main(String[] args) {
-    SpringApplication.run(SpringBootApplication.class, args);
+    SpringApplication.run(ScimpleSpringBootApplication.class, args);
+  }
+
+  @Bean
+  ServerConfiguration serverConfiguration() {
+    return new ServerConfiguration().addAuthenticationSchema(
+      new ServiceProviderConfiguration.AuthenticationSchema()
+      .setType(ServiceProviderConfiguration.AuthenticationSchema.Type.OAUTH_BEARER)
+        .setName(ServiceProviderConfiguration.AuthenticationSchema.Type.OAUTH_BEARER.name())
+        .setDescription("OAuth2 Bearer Token"));

Review Comment:
   This configuration should be injected somehow.
   NOTE: There is still no auth for this example, this is a placeholder to pass said tests (the actual values could be anything)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org