This repository has been archived by the owner on Jul 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added implementation and test for only asking for consent once
- Loading branch information
Showing
24 changed files
with
456 additions
and
341 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
1 change: 1 addition & 0 deletions
1
apis-authorization-server-war/src/main/webapp/WEB-INF/jsp/userconsent_denied.jsp
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 @@ | ||
<img src="/client/img/dead-end-sign.jpg"/> |
Binary file added
BIN
+62.3 KB
apis-authorization-server-war/src/main/webapp/client/img/dead-end-sign.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions
79
...horization-server-war/src/test/java/org/surfnet/oaaas/config/TestSpringConfiguration.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,79 @@ | ||
/* | ||
* Copyright 2012 SURFnet bv, The Netherlands | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.surfnet.oaaas.config; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.apache.openjpa.persistence.PersistenceProviderImpl; | ||
import org.apache.tomcat.jdbc.pool.DataSource; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.ImportResource; | ||
import org.springframework.context.annotation.PropertySource; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.orm.jpa.JpaTransactionManager; | ||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; | ||
import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
import org.surfnet.oaaas.repository.ExceptionTranslator; | ||
import org.surfnet.oaaas.repository.OpenJPAExceptionTranslator; | ||
|
||
@Configuration | ||
@PropertySource("classpath:apis.application.test.properties") | ||
/* | ||
* The component scan can be used to add packages and exclusions to the default | ||
* package | ||
*/ | ||
@ImportResource("classpath:spring-repositories.xml") | ||
@EnableTransactionManagement | ||
public class TestSpringConfiguration { | ||
|
||
private static final String PERSISTENCE_UNIT_NAME = "oaaas"; | ||
private static final Class<PersistenceProviderImpl> PERSISTENCE_PROVIDER_CLASS = PersistenceProviderImpl.class; | ||
|
||
@Inject | ||
Environment env; | ||
|
||
@Bean | ||
public javax.sql.DataSource dataSource() { | ||
DataSource dataSource = new DataSource(); | ||
dataSource.setDriverClassName(env.getProperty("jdbc.driverClassName")); | ||
dataSource.setUrl(env.getProperty("jdbc.url")); | ||
dataSource.setUsername(env.getProperty("jdbc.username")); | ||
dataSource.setPassword(env.getProperty("jdbc.password")); | ||
return dataSource; | ||
} | ||
|
||
@Bean | ||
public JpaTransactionManager transactionManager() { | ||
return new JpaTransactionManager(); | ||
} | ||
|
||
@Bean | ||
public LocalContainerEntityManagerFactoryBean entityManagerFactory() { | ||
final LocalContainerEntityManagerFactoryBean emfBean = new LocalContainerEntityManagerFactoryBean(); | ||
emfBean.setDataSource(dataSource()); | ||
emfBean.setPersistenceUnitName(PERSISTENCE_UNIT_NAME); | ||
emfBean.setPersistenceProviderClass(PERSISTENCE_PROVIDER_CLASS); | ||
return emfBean; | ||
} | ||
|
||
@Bean | ||
public ExceptionTranslator exceptionTranslator() { | ||
return new OpenJPAExceptionTranslator(); | ||
} | ||
|
||
} |
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
23 changes: 23 additions & 0 deletions
23
apis-authorization-server-war/src/test/resources/apis.application.test.properties
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,23 @@ | ||
# | ||
# Copyright 2012 SURFnet bv, The Netherlands | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# The database settings | ||
jdbc.driverClassName=org.hsqldb.jdbcDriver | ||
#jdbc.url=jdbc:hsqldb:hsq://localhost/xdb | ||
#jdbc.url=jdbc:hsqldb:hsql//localhost/target/db;ifexists=false | ||
jdbc.url=jdbc:hsqldb:file:target/db;hsqldb.lock_file=false | ||
jdbc.username=sa | ||
jdbc.password= |
Oops, something went wrong.