Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30b42e9
commit 06d287a
Showing
32 changed files
with
1,315 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...curity/src/main/java/org/neo4j/server/security/enterprise/auth/plugin/PluginAuthInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.server.security.enterprise.auth.plugin; | ||
|
||
import org.apache.shiro.authz.Permission; | ||
import org.apache.shiro.subject.PrincipalCollection; | ||
import org.apache.shiro.subject.SimplePrincipalCollection; | ||
|
||
import java.util.Collection; | ||
|
||
import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthInfo; | ||
|
||
public class PluginAuthInfo implements org.apache.shiro.authc.AuthenticationInfo, org.apache.shiro.authz.AuthorizationInfo | ||
{ | ||
private final AuthInfo authInfo; | ||
private final String realmName; | ||
|
||
public static PluginAuthInfo create( AuthInfo authInfo, String realmName ) | ||
{ | ||
return new PluginAuthInfo( authInfo, realmName ); | ||
} | ||
|
||
private PluginAuthInfo( AuthInfo authInfo, String realmName ) | ||
{ | ||
this.authInfo = authInfo; | ||
this.realmName = realmName; | ||
} | ||
|
||
@Override | ||
public PrincipalCollection getPrincipals() | ||
{ | ||
return new SimplePrincipalCollection( this.authInfo.getPrincipal(), realmName ); | ||
} | ||
|
||
@Override | ||
public Object getCredentials() | ||
{ | ||
return this.authInfo.getCredentials(); | ||
} | ||
|
||
@Override | ||
public Collection<String> getRoles() | ||
{ | ||
return this.authInfo.getRoles(); | ||
} | ||
|
||
@Override | ||
public Collection<String> getStringPermissions() | ||
{ | ||
return null; | ||
} | ||
|
||
@Override | ||
public Collection<Permission> getObjectPermissions() | ||
{ | ||
return null; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
.../main/java/org/neo4j/server/security/enterprise/auth/plugin/PluginAuthenticationInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.server.security.enterprise.auth.plugin; | ||
|
||
import org.apache.shiro.subject.PrincipalCollection; | ||
import org.apache.shiro.subject.SimplePrincipalCollection; | ||
|
||
import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthenticationInfo; | ||
|
||
public class PluginAuthenticationInfo implements org.apache.shiro.authc.AuthenticationInfo | ||
{ | ||
private final AuthenticationInfo authenticationInfo; | ||
private final String realmName; | ||
|
||
public static PluginAuthenticationInfo create( AuthenticationInfo authenticationInfo, String realmName ) | ||
{ | ||
return new PluginAuthenticationInfo( authenticationInfo, realmName ); | ||
} | ||
|
||
private PluginAuthenticationInfo( AuthenticationInfo authenticationInfo, String realmName ) | ||
{ | ||
this.authenticationInfo = authenticationInfo; | ||
this.realmName = realmName; | ||
} | ||
|
||
@Override | ||
public PrincipalCollection getPrincipals() | ||
{ | ||
|
||
return new SimplePrincipalCollection( this.authenticationInfo.getPrincipal(), realmName ); | ||
} | ||
|
||
@Override | ||
public Object getCredentials() | ||
{ | ||
return this.authenticationInfo.getCredentials(); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
...c/main/java/org/neo4j/server/security/enterprise/auth/plugin/PluginAuthorizationInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.server.security.enterprise.auth.plugin; | ||
|
||
import org.apache.shiro.authz.Permission; | ||
|
||
import java.util.Collection; | ||
|
||
import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthorizationInfo; | ||
|
||
public class PluginAuthorizationInfo implements org.apache.shiro.authz.AuthorizationInfo | ||
{ | ||
private final AuthorizationInfo authorizationInfo; | ||
|
||
public static PluginAuthorizationInfo create( AuthorizationInfo authorizationInfo ) | ||
{ | ||
return new PluginAuthorizationInfo( authorizationInfo ); | ||
} | ||
|
||
private PluginAuthorizationInfo( AuthorizationInfo authorizationInfo ) | ||
{ | ||
this.authorizationInfo = authorizationInfo; | ||
} | ||
|
||
@Override | ||
public Collection<String> getRoles() | ||
{ | ||
return this.authorizationInfo.getRoles(); | ||
} | ||
|
||
@Override | ||
public Collection<String> getStringPermissions() | ||
{ | ||
return null; | ||
} | ||
|
||
@Override | ||
public Collection<Permission> getObjectPermissions() | ||
{ | ||
return null; | ||
} | ||
} |
Oops, something went wrong.