Skip to content

Commit

Permalink
fixed merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Jan 25, 2019
2 parents aaaf521 + 2e320de commit efdf0db
Show file tree
Hide file tree
Showing 26 changed files with 3,377 additions and 2,657 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.internet2.tier.shibboleth.admin.ui.security.model.User;
import edu.internet2.tier.shibboleth.admin.ui.security.repository.UserRepository;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ResourceBundleMessageSource;
Expand Down Expand Up @@ -72,6 +73,6 @@ public String[] getSystemAdminEmailAddresses() {
logger.warn("No users with ROLE_ADMIN were found! Check your configuration!");
systemAdmins = new HashSet<>();
}
return systemAdmins.stream().map(User::getEmailAddress).distinct().toArray(String[]::new);
return systemAdmins.stream().filter(user -> StringUtils.isNotBlank(user.getEmailAddress())).map(User::getEmailAddress).distinct().toArray(String[]::new);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,7 @@
"certificateFile": {
"title": "label.certificate-file",
"description": "tooltip.certificate-file",
"type": "string",
"default": ""
"type": "string"
}
},
"anyOf": [
Expand Down
1 change: 1 addition & 0 deletions backend/src/main/resources/i18n/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ message.org-incomplete=These three fields must all be entered if any single fiel
message.type-required=Missing required property: Type
message.match-required=Missing required property: Match
message.value-required=Missing required property: Value
message.required=Missing required property.

message.conflict=Conflict
message.data-version-contention=Data Version Contention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
user = persistedUser.get();
}
if (user.getRole().equals(ROLE_NONE)) {
((HttpServletResponse) response).sendRedirect("/static.html");
((HttpServletResponse) response).sendRedirect("/unsecured/error.html");
} else {
chain.doFilter(request, response); // else, user is in the system already, carry on
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ protected void configure(HttpSecurity http) throws Exception {

@Configuration
@Order(1)
public static class StaticSecurityConfiguration extends WebSecurityConfigurerAdapter {
public static class UnsecuredSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.antMatcher("/static.html").authorizeRequests().antMatchers("/static.html").permitAll();
http.antMatcher("/unsecured/**/*").authorizeRequests().antMatchers("/unsecured/**/*").permitAll();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AddNewUserFilterTests extends Specification {
1 * roleRepository.save(_)
1 * userRepository.save(_)
1 * emailService.sendNewUserMail('newUser')
1 * response.sendRedirect("/static.html")
1 * response.sendRedirect("/unsecured/error.html")
}

def "existing users are not redirected"() {
Expand Down
20 changes: 20 additions & 0 deletions ui/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const fs = require('fs-extra');

fs.ensureDir('./dist/unsecured').then(function () {
try {
fs.copySync('./src/error.html', './dist/unsecured/error.html')
console.log('copy error page success!')
} catch (err) {
console.error(err)
}

try {
fs.copySync('./node_modules/font-awesome/fonts', './dist/unsecured');
console.log('copy fonts success!')
} catch (err) {
console.log(err);
}
});



Loading

0 comments on commit efdf0db

Please sign in to comment.