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.messagerouter.msgrtr.nsa.cambria.security.impl;
24 import javax.servlet.http.HttpServletRequest;
26 import org.onap.dmaap.messagerouter.msgrtr.nsa.cambria.beans.DMaaPContext;
27 import org.onap.dmaap.messagerouter.msgrtr.nsa.cambria.security.DMaaPAuthenticator;
29 import com.att.nsa.security.NsaApiKey;
30 import com.att.nsa.security.authenticators.MechIdAuthenticator;
31 //import com.att.nsa.security.db.NsaApiDb;
32 import com.att.eelf.configuration.EELFLogger;
33 import com.att.eelf.configuration.EELFManager;
36 * An authenticator for AT&T MechIds.
42 public class DMaaPMechIdAuthenticator <K extends NsaApiKey> implements DMaaPAuthenticator<K> {
45 * This is not yet implemented. by refault its returing false
46 * @param req HttpServletRequest
49 public boolean qualify (HttpServletRequest req) {
50 // we haven't implemented anything here yet, so there's no qualifying request
54 * This metod authenticate the mech id
56 * @return APIkey or null
58 public K isAuthentic (HttpServletRequest req) {
59 final String remoteAddr = req.getRemoteAddr();
60 authLog ( "MechId auth is not yet implemented.", remoteAddr );
64 private static void authLog ( String msg, String remoteAddr )
66 log.info ( "AUTH-LOG(" + remoteAddr + "): " + msg );
69 // private final NsaApiDb<K> fDb;
70 //private static final Logger log = Logger.getLogger( MechIdAuthenticator.class.toString());
71 private static final EELFLogger log = EELFManager.getInstance().getLogger(MechIdAuthenticator.class);
73 * Curently its not yet implemented returning null
74 * @param ctx DMaaP context
75 * @return APIkey or null
78 public K authenticate(DMaaPContext ctx) {
79 // TODO Auto-generated method stub
83 public void addAuthenticator(DMaaPAuthenticator<K> a) {
84 // TODO Auto-generated method stub