-
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.
Merge pull request #38 from indiana-university/decrosslist
LMSA-9397 / LMSA-9398 / LMSA-9399 - decrosslisting tool
- Loading branch information
Showing
26 changed files
with
998 additions
and
269 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
57 changes: 57 additions & 0 deletions
57
src/main/java/edu/iu/uits/lms/crosslist/config/JpaRestConfig.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,57 @@ | ||
package edu.iu.uits.lms.crosslist.config; | ||
|
||
/*- | ||
* #%L | ||
* lms-lti-crosslist | ||
* %% | ||
* Copyright (C) 2015 - 2024 Indiana University | ||
* %% | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the Indiana University nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* #L% | ||
*/ | ||
|
||
import edu.iu.uits.lms.crosslist.model.DecrosslistUser; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; | ||
import org.springframework.data.rest.core.mapping.RepositoryDetectionStrategy; | ||
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
|
||
@Configuration | ||
@Slf4j | ||
public class JpaRestConfig implements RepositoryRestConfigurer { | ||
|
||
@Override | ||
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { | ||
// This is needed to allow the "ids" to be served up via the | ||
// @RepositoryRestResource annotation (by default, it is suppressed) | ||
config.exposeIdsFor(DecrosslistUser.class); | ||
|
||
RepositoryRestConfigurer.super.configureRepositoryRestConfiguration(config, cors); | ||
config.setRepositoryDetectionStrategy(RepositoryDetectionStrategy.RepositoryDetectionStrategies.ANNOTATED); | ||
} | ||
} |
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
66 changes: 66 additions & 0 deletions
66
src/main/java/edu/iu/uits/lms/crosslist/config/SwaggerConfig.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,66 @@ | ||
package edu.iu.uits.lms.crosslist.config; | ||
|
||
/*- | ||
* #%L | ||
* lms-lti-crosslist | ||
* %% | ||
* Copyright (C) 2015 - 2024 Indiana University | ||
* %% | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the Indiana University nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* #L% | ||
*/ | ||
|
||
import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; | ||
import io.swagger.v3.oas.annotations.info.Info; | ||
import io.swagger.v3.oas.annotations.security.OAuthFlow; | ||
import io.swagger.v3.oas.annotations.security.OAuthFlows; | ||
import io.swagger.v3.oas.annotations.security.OAuthScope; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.security.SecurityScheme; | ||
import org.springdoc.core.GroupedOpenApi; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
@Profile("swagger") | ||
@Configuration | ||
@OpenAPIDefinition(info = @Info(title = "Crosslist REST Endpoints", version = "${lms-lti-crosslist.version}"), | ||
security = @SecurityRequirement(name = "security_auth_crosslist")) | ||
@SecurityScheme(name = "security_auth_crosslist", type = SecuritySchemeType.OAUTH2, | ||
flows = @OAuthFlows(authorizationCode = @OAuthFlow( | ||
authorizationUrl = "${springdoc.oAuthFlow.authorizationUrl}", | ||
scopes = {@OAuthScope(name = "lms:rest")}, | ||
tokenUrl = "${springdoc.oAuthFlow.tokenUrl}"))) | ||
public class SwaggerConfig { | ||
@Bean | ||
public GroupedOpenApi groupedOpenApi() { | ||
return GroupedOpenApi.builder() | ||
.group("crosslist") | ||
.packagesToScan("edu.iu.uits.lms.crosslist.controller.rest") | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.