You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2019/01/16 02:11:49 UTC

[brooklyn-server] 09/49: adding new GoogleOauthSecurityProvider

This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit e3eaf3e41e83b9e475314dd01a6b16e70628ed6d
Author: Juan Cabrerizo <ju...@cloudsoft.io>
AuthorDate: Wed Nov 28 11:58:13 2018 +0000

    adding new GoogleOauthSecurityProvider
---
 .../provider/GoogleOauthSecurityProvider.java      | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/GoogleOauthSecurityProvider.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/GoogleOauthSecurityProvider.java
new file mode 100644
index 0000000..f3942a6
--- /dev/null
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/provider/GoogleOauthSecurityProvider.java
@@ -0,0 +1,48 @@
+/*
+ * 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.brooklyn.rest.security.provider;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpSession;
+
+/** provider who allows everyone */
+public class GoogleOauthSecurityProvider implements SecurityProvider {
+
+    public static final Logger LOG = LoggerFactory.getLogger(GoogleOauthSecurityProvider.class);
+
+    @Override
+    public boolean isAuthenticated(HttpSession session) {
+        LOG.info("isAuthenticated");
+        return true;
+    }
+
+    @Override
+    public boolean authenticate(HttpSession session, String user, String password) {
+        LOG.info("authenticate");
+        return true;
+    }
+
+    @Override
+    public boolean logout(HttpSession session) {
+        LOG.info("logout");
+        return true;
+    }
+}