1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ============LICENSE_END=========================================================
19 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21 *******************************************************************************/
22 package org.onap.dmaap.dmf.mr.security.impl;
24 import javax.servlet.http.HttpServletRequest;
26 import org.onap.dmaap.dmf.mr.beans.DMaaPContext;
27 import org.onap.dmaap.dmf.mr.security.DMaaPAuthenticator;
29 import com.att.eelf.configuration.EELFLogger;
30 import com.att.eelf.configuration.EELFManager;
31 import com.att.nsa.security.NsaApiKey;
32 import com.att.nsa.security.authenticators.MechIdAuthenticator;
35 * An authenticator for AT&T MechIds.
41 public class DMaaPMechIdAuthenticator <K extends NsaApiKey> implements DMaaPAuthenticator<K> {
44 * This is not yet implemented. by refault its returing false
45 * @param req HttpServletRequest
48 public boolean qualify (HttpServletRequest req) {
49 // we haven't implemented anything here yet, so there's no qualifying request
53 * This metod authenticate the mech id
55 * @return APIkey or null
57 public K isAuthentic (HttpServletRequest req) {
58 final String remoteAddr = req.getRemoteAddr();
59 authLog ( "MechId auth is not yet implemented.", remoteAddr );
63 private static void authLog ( String msg, String remoteAddr )
65 log.info ( "AUTH-LOG(" + remoteAddr + "): " + msg );
69 //private static final Logger log = Logger.getLogger( MechIdAuthenticator.class.toString());
70 private static final EELFLogger log = EELFManager.getInstance().getLogger(MechIdAuthenticator.class);
72 * Curently its not yet implemented returning null
73 * @param ctx DMaaP context
74 * @return APIkey or null
77 public K authenticate(DMaaPContext ctx) {
78 // TODO Auto-generated method stub
82 public void addAuthenticator(DMaaPAuthenticator<K> a) {
83 // TODO Auto-generated method stub