Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
automatic project update
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubois committed Feb 21, 2017
1 parent 57f894f commit 975d1aa
Show file tree
Hide file tree
Showing 16 changed files with 168 additions and 180 deletions.
2 changes: 1 addition & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"en"
],
"serverPort": 8080,
"jhipsterVersion": "4.0.5",
"jhipsterVersion": "4.0.6",
"enableSocialSignIn": false,
"jwtSecretKey": "042e7d536354d3cdfab490925c55022efcb42bae",
"useSass": false,
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# jhipsterJwtSampleApplication
This application was generated using JHipster 4.0.4, you can find documentation and help at [https://jhipster.github.io/documentation-archive/v4.0.4](https://jhipster.github.io/documentation-archive/v4.0.4).
This application was generated using JHipster 4.0.6, you can find documentation and help at [https://jhipster.github.io/documentation-archive/v4.0.6](https://jhipster.github.io/documentation-archive/v4.0.6).

## Development

Expand Down Expand Up @@ -96,13 +96,13 @@ For more information refer to [Using Docker and Docker-Compose][], this page als
To set up a CI environment, consult the [Setting up Continuous Integration][] page.

[JHipster Homepage and latest documentation]: https://jhipster.github.io
[JHipster 4.0.4 archive]: https://jhipster.github.io/documentation-archive/v4.0.4
[JHipster 4.0.6 archive]: https://jhipster.github.io/documentation-archive/v4.0.6

[Using JHipster in development]: https://jhipster.github.io/documentation-archive/v4.0.4/development/
[Using Docker and Docker-Compose]: https://jhipster.github.io/documentation-archive/v4.0.4/docker-compose
[Using JHipster in production]: https://jhipster.github.io/documentation-archive/v4.0.4/production/
[Running tests page]: https://jhipster.github.io/documentation-archive/v4.0.4/running-tests/
[Setting up Continuous Integration]: https://jhipster.github.io/documentation-archive/v4.0.4/setting-up-ci/
[Using JHipster in development]: https://jhipster.github.io/documentation-archive/v4.0.6/development/
[Using Docker and Docker-Compose]: https://jhipster.github.io/documentation-archive/v4.0.6/docker-compose
[Using JHipster in production]: https://jhipster.github.io/documentation-archive/v4.0.6/production/
[Running tests page]: https://jhipster.github.io/documentation-archive/v4.0.6/running-tests/
[Setting up Continuous Integration]: https://jhipster.github.io/documentation-archive/v4.0.6/setting-up-ci/

[Gatling]: http://gatling.io/
[Node.js]: https://nodejs.org/
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated on 2017-02-17 using generator-jhipster 4.0.5
// Generated on 2017-02-21 using generator-jhipster 4.0.6
'use strict';

var gulp = require('gulp'),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"eslint-config-angular": "0.5.0",
"eslint-plugin-angular": "1.3.1",
"event-stream": "3.3.4",
"generator-jhipster": "4.0.5",
"generator-jhipster": "4.0.6",
"gulp": "3.9.1",
"gulp-angular-filesort": "1.1.1",
"gulp-angular-templatecache": "2.0.0",
Expand Down
75 changes: 31 additions & 44 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>1.4.4.RELEASE</version>
<version>1.5.1.RELEASE</version>
<relativePath />
</parent>

Expand All @@ -16,45 +16,51 @@
<name>Jhipster Jwt Sample Application</name>

<prerequisites>
<maven>3.0.0</maven>
<maven>${maven.version}</maven>
</prerequisites>

<properties>
<argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
<assertj-core.version>3.5.2</assertj-core.version>
<awaitility.version>1.7.0</awaitility.version>
<assertj.version>3.6.2</assertj.version>
<awaitility.version>2.0.0</awaitility.version>
<commons-io.version>2.5</commons-io.version>
<commons-lang.version>3.4</commons-lang.version>
<commons-lang.version>3.5</commons-lang.version>
<docker-maven-plugin.version>0.4.13</docker-maven-plugin.version>
<frontend-maven-plugin.version>1.3</frontend-maven-plugin.version>
<gatling-maven-plugin.version>2.2.0</gatling-maven-plugin.version>
<gatling.version>2.2.0</gatling.version>
<hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<hibernate.version>5.2.4.Final</hibernate.version>
<hikaricp.version>2.4.6</hikaricp.version>
<gatling.version>2.2.3</gatling.version>
<gatling-maven-plugin.version>2.2.1</gatling-maven-plugin.version>
<hibernate.version>5.2.7.Final</hibernate.version>
<hikaricp.version>2.6.0</hikaricp.version>
<jacoco-maven-plugin.version>0.7.9</jacoco-maven-plugin.version>
<java.version>1.8</java.version>
<javassist.version>3.21.0-GA</javassist.version>
<jcache.version>1.0.0</jcache.version>
<jhipster.server.version>1.0.2</jhipster.server.version>
<jzlib.version>1.1.3</jzlib.version>
<jhipster.server.version>1.0.4</jhipster.server.version>
<jjwt.version>0.7.0</jjwt.version>
<liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>
<liquibase-slf4j.version>2.0.0</liquibase-slf4j.version>
<liquibase.version>3.5.3</liquibase.version>
<logstash-logback-encoder.version>4.7</logstash-logback-encoder.version>
<logstash-logback-encoder.version>4.8</logstash-logback-encoder.version>
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
<mapstruct.version>1.1.0.Final</mapstruct.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
<maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.version>3.0.0</maven.version>
<metrics-spring.version>3.1.3</metrics-spring.version>
<node.version>v6.9.5</node.version>
<!-- These remain empty unless the corresponding profile is active -->
<profile.no-liquibase />
<profile.swagger />
<prometheus-simpleclient.version>0.0.20</prometheus-simpleclient.version>
<!-- Sonar properties -->
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
<run.addResources>false</run.addResources>
<scala-maven-plugin.version>3.2.2</scala-maven-plugin.version>
<scala.version>2.12.1</scala.version>
<sonar-maven-plugin.version>3.2</sonar-maven-plugin.version>

<sonar.exclusions>src/main/webapp/content/**/*.*, src/main/webapp/bower_components/**/*.*, src/main/webapp/i18n/*.js, target/www/**/*.*</sonar.exclusions>
Expand Down Expand Up @@ -89,7 +95,8 @@
<!-- Spring properties -->
<springfox.version>2.6.1</springfox.version>
<undertow.version>1.4.10.Final</undertow.version>
<yarn.version>v0.19.1</yarn.version>
<validation-api.version>1.1.0.Final</validation-api.version>
<yarn.version>v0.20.3</yarn.version>
</properties>


Expand All @@ -108,11 +115,6 @@
<artifactId>metrics-annotation</artifactId>
<version>${dropwizard-metrics.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-healthchecks</artifactId>
<version>${dropwizard-metrics.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-json</artifactId>
Expand All @@ -131,12 +133,6 @@
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-servlets</artifactId>
<exclusions>
<exclusion>
<artifactId>metrics-healthchecks</artifactId>
<groupId>io.dropwizard.metrics</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
Expand All @@ -145,7 +141,6 @@
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hppc</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
Expand All @@ -154,14 +149,13 @@
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>com.jayway.awaitility</groupId>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
Expand Down Expand Up @@ -242,12 +236,11 @@
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jzlib</artifactId>
<version>1.1.2</version>
<version>${jzlib.version}</version>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>${jcache.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
Expand All @@ -256,7 +249,6 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -275,7 +267,6 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
Expand Down Expand Up @@ -443,7 +434,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
Expand Down Expand Up @@ -477,8 +468,8 @@
<configuration>
<rules>
<requireMavenVersion>
<message>You are running an older version of Maven. JHipster requires at least Maven 3.0</message>
<version>[3.0.0,)</version>
<message>You are running an older version of Maven. JHipster requires at least Maven ${maven.version}</message>
<version>[${maven.version},)</version>
</requireMavenVersion>
<requireJavaVersion>
<message>You are running an older version of Java. JHipster requires at least JDK ${java.version}</message>
Expand Down Expand Up @@ -588,7 +579,7 @@
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.2-GA</version>
<version>${javassist.version}</version>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
Expand All @@ -603,7 +594,7 @@
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<version>${validation-api.version}</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -622,7 +613,7 @@
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.10</version>
<version>${docker-maven-plugin.version}</version>
<configuration>
<imageName>jhipsterjwtsampleapplication</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
Expand Down Expand Up @@ -750,7 +741,6 @@
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<configuration>
<filesets>
<fileset>
Expand Down Expand Up @@ -904,7 +894,7 @@
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<version>${scala-maven-plugin.version}</version>
<executions>
<execution>
<id>compile</id>
Expand All @@ -926,7 +916,7 @@
<configuration>
<recompileMode>incremental</recompileMode>
<verbose>true</verbose>
<scalaVersion>2.11.7</scalaVersion>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -955,9 +945,6 @@
Profile for monitoring the application with Prometheus.
-->
<id>prometheus</id>
<properties>
<prometheus-simpleclient.version>0.0.18</prometheus-simpleclient.version>
</properties>
<dependencies>
<dependency>
<groupId>io.prometheus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public final class Constants {
public static final String LOGIN_REGEX = "^[_'.@A-Za-z0-9-]*$";

public static final String SYSTEM_ACCOUNT = "system";
public static final String ANONYMOUS_USER = "anonymoususer";

private Constants() {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.jhipster.sample.repository;

import io.github.jhipster.sample.config.Constants;
import io.github.jhipster.sample.config.audit.AuditEventConverter;
import io.github.jhipster.sample.domain.PersistentAuditEvent;

Expand All @@ -23,8 +24,6 @@ public class CustomAuditEventRepository implements AuditEventRepository {

private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";

private static final String ANONYMOUS_USER = "anonymoususer";

private final PersistenceAuditEventRepository persistenceAuditEventRepository;

private final AuditEventConverter auditEventConverter;
Expand Down Expand Up @@ -68,7 +67,7 @@ public List<AuditEvent> find(String principal, Date after, String type) {
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void add(AuditEvent event) {
if (!AUTHORIZATION_FAILURE.equals(event.getType()) &&
!ANONYMOUS_USER.equals(event.getPrincipal())) {
!Constants.ANONYMOUS_USER.equals(event.getPrincipal())) {

PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
persistentAuditEvent.setPrincipal(event.getPrincipal());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.github.jhipster.sample.domain.User;

import java.time.ZonedDateTime;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;

Expand All @@ -29,4 +31,6 @@ public interface UserRepository extends JpaRepository<User, Long> {

@EntityGraph(attributePaths = "authorities")
Optional<User> findOneWithAuthoritiesByLogin(String login);

Page<User> findAllByLoginNot(Pageable pageable, String login);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.github.jhipster.sample.domain.Authority;
import io.github.jhipster.sample.domain.User;
import io.github.jhipster.sample.repository.AuthorityRepository;
import io.github.jhipster.sample.config.Constants;
import io.github.jhipster.sample.repository.UserRepository;
import io.github.jhipster.sample.security.AuthoritiesConstants;
import io.github.jhipster.sample.security.SecurityUtils;
Expand Down Expand Up @@ -190,7 +191,7 @@ public void changePassword(String password) {

@Transactional(readOnly = true)
public Page<UserDTO> getAllManagedUsers(Pageable pageable) {
return userRepository.findAll(pageable).map(UserDTO::new);
return userRepository.findAllByLoginNot(pageable, Constants.ANONYMOUS_USER).map(UserDTO::new);
}

@Transactional(readOnly = true)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spring:
hibernate.cache.region.factory_class: io.github.jhipster.config.jcache.SpringCacheRegionFactory
cache:
jcache:
config: config/ehcache/ehcache-dev.xml
config: config/ehcache/ehcache-prod.xml
mail:
host: localhost
port: 25
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# ===================================================================

management:
security:
roles: ADMIN
context-path: /management
health:
mail:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,8 @@
}

function onSuccess(data, headers) {
//hide anonymous user from user management: it's a required user for Spring Security
var hiddenUsersSize = 0;
for (var i in data) {
if (data[i]['login'] === 'anonymoususer') {
data.splice(i, 1);
hiddenUsersSize++;
}
}
vm.links = ParseLinks.parse(headers('link'));
vm.totalItems = headers('X-Total-Count') - hiddenUsersSize;
vm.totalItems = headers('X-Total-Count');
vm.queryCount = vm.totalItems;
vm.page = pagingParams.page;
vm.users = data;
Expand Down
Loading

0 comments on commit 975d1aa

Please sign in to comment.