-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
10 changed files
with
250 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
target/ | ||
build/ | ||
ajcore* | ||
|
||
.springBeans |
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
27 changes: 27 additions & 0 deletions
27
src/main/java/eu/enhan/timelord/domain/core/UserRepository.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,27 @@ | ||
/* | ||
* This file is part of Timelord. | ||
* | ||
* Timelord 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. | ||
* | ||
* Timelord 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 Affero GNU General Public License | ||
* along with Timemord. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package eu.enhan.timelord.domain.core; | ||
|
||
import org.springframework.data.neo4j.repository.GraphRepository; | ||
|
||
/** | ||
* @author Emmanuel Nhan | ||
* | ||
*/ | ||
public interface UserRepository extends GraphRepository<TimelordUser> { | ||
|
||
} |
107 changes: 107 additions & 0 deletions
107
src/main/java/eu/enhan/timelord/domain/security/TimelordUserDetails.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,107 @@ | ||
/* | ||
* This file is part of Timelord. | ||
* | ||
* Timelord 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. | ||
* | ||
* Timelord 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 Affero GNU General Public License | ||
* along with Timemord. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package eu.enhan.timelord.domain.security; | ||
|
||
import java.util.Collection; | ||
|
||
import org.springframework.security.core.GrantedAuthority; | ||
import org.springframework.security.core.userdetails.UserDetails; | ||
|
||
import eu.enhan.timelord.domain.core.TimelordUser; | ||
|
||
/** | ||
* @author Emmanuel Nhan | ||
* | ||
*/ | ||
public class TimelordUserDetails implements UserDetails { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 4750182611003623369L; | ||
|
||
private final TimelordUser user; | ||
|
||
public TimelordUserDetails(TimelordUser user) { | ||
super(); | ||
this.user = user; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.core.userdetails.UserDetails#getAuthorities() | ||
*/ | ||
@Override | ||
public Collection<? extends GrantedAuthority> getAuthorities() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.core.userdetails.UserDetails#getPassword() | ||
*/ | ||
@Override | ||
public String getPassword() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.core.userdetails.UserDetails#getUsername() | ||
*/ | ||
@Override | ||
public String getUsername() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.core.userdetails.UserDetails#isAccountNonExpired() | ||
*/ | ||
@Override | ||
public boolean isAccountNonExpired() { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.core.userdetails.UserDetails#isAccountNonLocked() | ||
*/ | ||
@Override | ||
public boolean isAccountNonLocked() { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.core.userdetails.UserDetails#isCredentialsNonExpired() | ||
*/ | ||
@Override | ||
public boolean isCredentialsNonExpired() { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.core.userdetails.UserDetails#isEnabled() | ||
*/ | ||
@Override | ||
public boolean isEnabled() { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/eu/enhan/timelord/domain/security/TimelordUserDetailsService.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,40 @@ | ||
/* | ||
* This file is part of Timelord. | ||
* | ||
* Timelord 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. | ||
* | ||
* Timelord 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 Affero GNU General Public License | ||
* along with Timemord. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package eu.enhan.timelord.domain.security; | ||
|
||
import org.springframework.security.core.userdetails.UserDetails; | ||
import org.springframework.security.core.userdetails.UserDetailsService; | ||
import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
import org.springframework.stereotype.Service; | ||
|
||
/** | ||
* @author Emmanuel Nhan | ||
* | ||
*/ | ||
@Service | ||
public class TimelordUserDetailsService implements UserDetailsService { | ||
|
||
/* (non-Javadoc) | ||
* @see org.springframework.security.core.userdetails.UserDetailsService#loadUserByUsername(java.lang.String) | ||
*/ | ||
@Override | ||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { | ||
|
||
return null; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:security="http://www.springframework.org/schema/security" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | ||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> | ||
|
||
<security:global-method-security mode="aspectj" secured-annotations="enabled" /> | ||
|
||
<security:http auto-config="true" > | ||
<security:intercept-url pattern="/admin/**" access="ROLE_ADMIN"/> | ||
<security:form-login login-page="/"/> | ||
</security:http> | ||
|
||
<security:authentication-manager> | ||
<security:authentication-provider user-service-ref="timelordUserDetailsService"> | ||
<security:password-encoder hash="sha"></security:password-encoder> | ||
</security:authentication-provider> | ||
</security:authentication-manager> | ||
|
||
</beans> |
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