[
https://issues.apache.org/jira/browse/EAGLE-582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15564811#comment-15564811
]
ASF GitHub Bot commented on EAGLE-582:
--------------------------------------
Github user anyway1021 commented on a diff in the pull request:
https://github.com/apache/incubator-eagle/pull/468#discussion_r82739733
--- Diff:
eagle-server/src/main/java/org/apache/eagle/server/authentication/AuthenticationRegister.java
---
@@ -0,0 +1,68 @@
+/*
+ * 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.eagle.server.authentication;
+
+import io.dropwizard.auth.basic.BasicAuthProvider;
+import io.dropwizard.setup.Environment;
+import org.apache.eagle.server.ServerConfig;
+import org.apache.eagle.server.authentication.principal.User;
+
+import java.security.Principal;
+
+public class AuthenticationRegister<P extends Principal> {
+ private ServerConfig serverConfig = null;
+ private Environment environment = null;
+ private Class<P> principalClass = null;
+
+ public AuthenticationRegister(ServerConfig serverConfig, Environment
environment, Class<P> principalClass) {
+ this.serverConfig = serverConfig;
+ this.environment = environment;
+ this.principalClass = principalClass;
+ }
+
+ public void register() {
+ AuthenticationMode<User> mode =
AuthenticationModeIdentifier.initiate(serverConfig.getConfig(),
environment).identify();
+
+ // the registration way in the following single statement is just
for dropwizard 0.7.1
--- End diff --
done
> register simple Basic Authentication to server application
> ----------------------------------------------------------
>
> Key: EAGLE-582
> URL: https://issues.apache.org/jira/browse/EAGLE-582
> Project: Eagle
> Issue Type: Sub-task
> Affects Versions: v0.5.0
> Reporter: Michael Wu
> Assignee: Michael Wu
> Fix For: v0.5.0
>
>
> simple basic authentication with just some expected username-password pairs
> configured for the application.
> This is one of the sub-tasks of ticket EAGLE-433, to successfully register a
> simple Basic Authentication authenticator to the server application.
> With this check-in, when the server is up, any access to rest api method that
> has a @Auth annotation on it's User field will require correct credentials.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)