2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.aaa.shiro.idm;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ForwardingObject;
12 import java.util.List;
13 import org.opendaylight.aaa.api.AuthenticationException;
14 import org.opendaylight.aaa.api.Claim;
15 import org.opendaylight.aaa.api.ClaimCache;
16 import org.opendaylight.aaa.api.CredentialAuth;
17 import org.opendaylight.aaa.api.IDMStoreException;
18 import org.opendaylight.aaa.api.IIDMStore;
19 import org.opendaylight.aaa.api.IdMService;
20 import org.opendaylight.aaa.api.PasswordCredentialAuth;
21 import org.opendaylight.aaa.api.PasswordCredentials;
22 import org.opendaylight.aaa.api.password.service.PasswordHashService;
23 import org.osgi.service.component.annotations.Activate;
24 import org.osgi.service.component.annotations.Component;
25 import org.osgi.service.component.annotations.Deactivate;
26 import org.osgi.service.component.annotations.Reference;
29 @Component(immediate = true, property = "type=default",
30 service = { CredentialAuth.class, PasswordCredentialAuth.class, IdMService.class, ClaimCache.class })
31 public class OSGIIdmLightProxy extends ForwardingObject implements PasswordCredentialAuth, IdMService, ClaimCache {
37 PasswordHashService passwordHashService;
39 private IdmLightProxy delegate;
43 delegate = new IdmLightProxy(iidmStore, passwordHashService);
52 protected IdmLightProxy delegate() {
62 public List<String> listDomains(String userId) {
63 return delegate().listDomains(userId);
67 public List<String> listRoles(String userId, String domainName) {
68 return delegate().listRoles(userId, domainName);
72 public List<String> listUserIDs() throws IDMStoreException {
73 return delegate().listUserIDs();
77 public Claim authenticate(PasswordCredentials cred) throws AuthenticationException {
78 return delegate().authenticate(cred);