- Adding methods to the AuthorityProvider to authorize the downloading of content.
This commit is contained in:
Matt Gilman 2014-12-23 09:46:35 -05:00
parent e67eb4f53b
commit 71ab084d39
1 changed files with 8 additions and 0 deletions

View File

@ -22,12 +22,15 @@ import org.apache.nifi.cluster.authorization.protocol.message.ProtocolMessage;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.nifi.authorization.Authority;
import org.apache.nifi.authorization.AuthorityProvider;
import org.apache.nifi.authorization.AuthorityProviderConfigurationContext;
import org.apache.nifi.authorization.AuthorityProviderInitializationContext;
import org.apache.nifi.authorization.DownloadAuthorization;
import org.apache.nifi.authorization.annotation.AuthorityProviderContext;
import org.apache.nifi.authorization.exception.AuthorityAccessException;
import org.apache.nifi.authorization.exception.IdentityAlreadyExistsException;
@ -282,6 +285,11 @@ public class NodeAuthorizationProvider implements AuthorityProvider, Application
throw new AuthorityAccessException("Nodes are not allowed to ungroup.");
}
@Override
public DownloadAuthorization authorizeDownload(List<String> dnChain, Map<String, String> attributes) throws UnknownIdentityException, AuthorityAccessException {
return DownloadAuthorization.approved();
}
@Override
public String getGroupForUser(String dn) throws UnknownIdentityException, AuthorityAccessException {
// create message