Skip to content

Commit

Permalink
Merge branch 'main' into global_acl
Browse files Browse the repository at this point in the history
  • Loading branch information
maurercw authored Feb 11, 2025
2 parents 990d4fe + a576bc9 commit dd4b1bc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<java.version>21</java.version>
<jquery.version>3.7.1</jquery.version>
<lms-canvas-rivet.version>6.2.8.1_1</lms-canvas-rivet.version>
<lms-embedded-services.version>6.1.3</lms-embedded-services.version>
<lms-team-spring-boot-it12>6.5.0</lms-team-spring-boot-it12>
<lms-embedded-services.version>6.1.4</lms-embedded-services.version>
<lms-team-spring-boot-it12>6.5.0_1</lms-team-spring-boot-it12>
<opencsv.version>5.10</opencsv.version>
<spring-cloud-starter-parent.version>2023.0.5</spring-cloud-starter-parent.version>
<springdoc-openapi-ui.version>2.5.0</springdoc-openapi-ui.version>
Expand Down Expand Up @@ -331,6 +331,7 @@
<failOnNotUptodateHeader>true</failOnNotUptodateHeader>
<excludes>
<exclude>**/canvasnotifier.properties</exclude>
<exclude>**/logback-test.xml</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
* #L%
*/

import edu.iu.uits.lms.common.it12logging.LmsFilterSecurityInterceptorObjectPostProcessor;
import edu.iu.uits.lms.common.it12logging.RestSecurityLoggingConfig;
import edu.iu.uits.lms.common.oauth.CustomJwtAuthenticationConverter;
import edu.iu.uits.lms.iuonly.services.AuthorizedUserService;
import edu.iu.uits.lms.lti.repository.DefaultInstructorRoleRepository;
Expand Down Expand Up @@ -71,9 +69,7 @@ public SecurityFilterChain restFilterChain(HttpSecurity http) throws Exception {
)
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.oauth2ResourceServer(oauth -> oauth
.jwt(jwt -> jwt.jwtAuthenticationConverter(new CustomJwtAuthenticationConverter())))
.with(new RestSecurityLoggingConfig(), log -> {
});
.jwt(jwt -> jwt.jwtAuthenticationConverter(new CustomJwtAuthenticationConverter())));
return http.build();
}

Expand All @@ -83,9 +79,7 @@ public SecurityFilterChain appFilterChain(HttpSecurity http) throws Exception {
http.securityMatcher(WELL_KNOWN_ALL, "/error", "/app/**")
.authorizeHttpRequests(authz -> authz
.requestMatchers(WELL_KNOWN_ALL, "/error").permitAll()
.requestMatchers("/**").hasAuthority(BASE_USER_AUTHORITY)
.withObjectPostProcessor(new LmsFilterSecurityInterceptorObjectPostProcessor())
)
.requestMatchers("/**").hasAuthority(BASE_USER_AUTHORITY))
.headers(headers -> headers
.contentSecurityPolicy(csp -> csp.policyDirectives("style-src 'self' 'unsafe-inline'; form-action 'self'; frame-ancestors 'self' https://*.instructure.com"))
.referrerPolicy(referrer -> referrer
Expand Down Expand Up @@ -116,8 +110,7 @@ public SecurityFilterChain catchallFilterChain(HttpSecurity http) throws Excepti
.grantedAuthoritiesMapper(new CustomRoleMapper(defaultInstructorRoleRepository, authorizedUserService)));

http.securityMatcher("/**")
.authorizeHttpRequests((authz) -> authz.anyRequest().authenticated()
.withObjectPostProcessor(new LmsFilterSecurityInterceptorObjectPostProcessor()))
.authorizeHttpRequests((authz) -> authz.anyRequest().authenticated())
.headers(headers -> headers
.contentSecurityPolicy(csp ->
csp.policyDirectives("style-src 'self' 'unsafe-inline'; form-action 'self'; frame-ancestors 'self' https://*.instructure.com"))
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@
<h1 id="cnTitle" class="rvt-ts-32 rvt-m-bottom-xs">Canvas Notifier</h1>

<form id="createNotifyForm" th:object="${canvasNotifierFormModel}" th:action="@{|/app/preview|}" method="post" enctype="multipart/form-data">
<p aria-hidden="true" class="req-instruction">All fields marked with <span th:replace="fragments :: reqAsterisk" /> are required</p>
<p aria-hidden="true" class="req-instruction">All fields marked with <span th:replace="~{fragments :: reqAsterisk}" /> are required</p>
<div class="rvt-grid">
<div class="rvt-grid__item" th:with="senderError=${canvasNotifierFormModel.fieldErrorsMap != null && canvasNotifierFormModel.fieldErrorsMap.containsKey('sender')},
subjectError=${canvasNotifierFormModel.fieldErrorsMap != null && canvasNotifierFormModel.fieldErrorsMap.containsKey('subject')},
bodyError=${canvasNotifierFormModel.fieldErrorsMap != null && canvasNotifierFormModel.fieldErrorsMap.containsKey('body')},
attachError=${canvasNotifierFormModel.fieldErrorsMap != null && canvasNotifierFormModel.fieldErrorsMap.containsKey('attachment')}">

<label class="cnLabel" for="senderUserId">Sender's Username <span th:replace="fragments :: reqAsterisk"></span></label>
<label class="cnLabel" for="senderUserId">Sender's Username <span th:replace="~{fragments :: reqAsterisk}"></span></label>
<div>
<select id="senderUserId" th:field="*{selectedSenderCanvasId}" class="rvt-select"
th:classappend="${senderError} ? rvt-validation-danger"
Expand All @@ -86,7 +86,7 @@ <h1 id="cnTitle" class="rvt-ts-32 rvt-m-bottom-xs">Canvas Notifier</h1>
<div th:replace="fragments :: field-error('state-message', 'You must choose a sender.')" />
</div>

<label for="msgSubject" class="cnLabel rvt-m-top-md rvt-label">Message Subject <span th:replace="fragments :: reqAsterisk"></span></label>
<label for="msgSubject" class="cnLabel rvt-m-top-md rvt-label">Message Subject <span th:replace="~{fragments :: reqAsterisk}"></span></label>
<input id="msgSubject" th:field="*{subject}" type="text" class="rvt-text-input"
th:classappend="${subjectError} ? rvt-validation-danger"
th:attr="aria-required='true', aria-describedby=${subjectError} ? 'messageSubject', aria-invalid=${subjectError} ? 'true'" />
Expand All @@ -95,7 +95,7 @@ <h1 id="cnTitle" class="rvt-ts-32 rvt-m-bottom-xs">Canvas Notifier</h1>
<div th:replace="fragments :: field-error('messageSubject', 'You must enter a subject.')" />
</div>

<label for="msgBody" class="cnLabel rvt-m-top-md rvt-label">Message Body <span th:replace="fragments :: reqAsterisk"></span></label>
<label for="msgBody" class="cnLabel rvt-m-top-md rvt-label">Message Body <span th:replace="~{fragments :: reqAsterisk}"></span></label>
<textarea type="text" id="msgBody" th:field="*{body}" class="rvt-textarea"
th:classappend="${bodyError} ? rvt-validation-danger"
th:attr="aria-required='true', aria-describedby=${bodyError} ? 'description-message', aria-invalid=${bodyError} ? 'true'"></textarea>
Expand All @@ -104,7 +104,7 @@ <h1 id="cnTitle" class="rvt-ts-32 rvt-m-bottom-xs">Canvas Notifier</h1>
<div th:replace="fragments :: field-error('description-message', 'You must enter a message.')" />
</div>

<p class="recipients">Recipients <span th:replace="fragments :: reqAsterisk"></span></p>
<p class="recipients">Recipients <span th:replace="~{fragments :: reqAsterisk}"></span></p>
<div class="rvt-file" data-rvt-file-input="cnAttachment">
<input type="file" data-rvt-file-input-button="cnAttachment" id="cnAttachment" name="cnAttachment" aria-required="true"
aria-describedby="cnAttachmentDescription" th:attrappend="aria-describedby=${attachError} ? ' ' + csvMessage"
Expand Down
16 changes: 16 additions & 0 deletions src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>

<logger name="edu.iu.uits.lms" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE" />
</logger>
</configuration>

0 comments on commit dd4b1bc

Please sign in to comment.