Skip to content

Commit 5bd6ab0

Browse files
committed
Fix console color under latest IntellIJ
Remove useless UsernamePasswordTokenTest.java
1 parent 8cc0606 commit 5bd6ab0

File tree

29 files changed

+128
-228
lines changed

29 files changed

+128
-228
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Version 3.11.1 (2021-01-31)
2+
3+
* [fix] Detection of color output under recent versions of IntelliJ.
4+
15
# Version 3.11.0 (2020-10-28)
26

37
* [brk] Config functions that find available ports now take a port name as argument so they can return the same port for each evaluation (example: `$availableTcpPort()` becomes `$availableTcpPort('web')`).

cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>org.seedstack.seed</groupId>
1616
<artifactId>seed</artifactId>
17-
<version>3.11.0-SNAPSHOT</version>
17+
<version>3.11.1-SNAPSHOT</version>
1818
</parent>
1919

2020
<artifactId>seed-cli</artifactId>

core/src/main/java/org/seedstack/seed/core/internal/init/ConsoleManager.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
package org.seedstack.seed.core.internal.init;
99

10-
import java.io.PrintStream;
1110
import org.fusesource.jansi.AnsiConsole;
1211
import org.fusesource.jansi.AnsiPrintStream;
1312
import org.fusesource.jansi.FilterPrintStream;
@@ -17,8 +16,14 @@
1716
import org.slf4j.Logger;
1817
import org.slf4j.LoggerFactory;
1918

19+
import java.io.PrintStream;
20+
import java.lang.management.ManagementFactory;
21+
import java.lang.management.RuntimeMXBean;
22+
import java.util.List;
23+
2024
public class ConsoleManager {
2125
private static final Logger LOGGER = LoggerFactory.getLogger(ConsoleManager.class);
26+
private static final String IDEA_RT_JAR = "idea_rt.jar";
2227
private final PrintStream savedOut = System.out;
2328
private final PrintStream savedErr = System.err;
2429

@@ -41,7 +46,7 @@ public synchronized void uninstall() {
4146
}
4247

4348
private PrintStream wrapPrintStream(final PrintStream inputStream, FileNo fileno,
44-
ApplicationConfig.ColorOutput colorOutput, boolean log) {
49+
ApplicationConfig.ColorOutput colorOutput, boolean log) {
4550
try {
4651
if (colorOutput == ApplicationConfig.ColorOutput.PASSTHROUGH) {
4752
if (log) {
@@ -128,13 +133,20 @@ private boolean isXtermColor() {
128133
}
129134

130135
private boolean isIntelliJ() {
131-
if (System.getProperty("java.class.path").contains("idea_rt.jar")) {
136+
if (System.getProperty("java.class.path").contains(IDEA_RT_JAR)) {
132137
return true;
133138
} else {
134139
try {
135140
Class.forName("com.intellij.rt.execution.application.AppMain");
136141
return true;
137142
} catch (ClassNotFoundException e) {
143+
RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
144+
List<String> jvmArgs = runtimeMXBean.getInputArguments();
145+
for (String arg : jvmArgs) {
146+
if (arg.startsWith("-agentpath") || arg.startsWith("-agentlib") || arg.startsWith("-javaagent")) {
147+
return arg.contains(IDEA_RT_JAR);
148+
}
149+
}
138150
return false;
139151
}
140152
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<groupId>org.seedstack.seed</groupId>
2121
<artifactId>seed</artifactId>
22-
<version>3.11.0-SNAPSHOT</version>
22+
<version>3.11.1-SNAPSHOT</version>
2323
<packaging>pom</packaging>
2424

2525
<properties>

rest/core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>org.seedstack.seed</groupId>
1616
<artifactId>seed-rest</artifactId>
17-
<version>3.11.0-SNAPSHOT</version>
17+
<version>3.11.1-SNAPSHOT</version>
1818
</parent>
1919

2020
<artifactId>seed-rest-core</artifactId>

rest/jersey2/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>org.seedstack.seed</groupId>
1616
<artifactId>seed-rest</artifactId>
17-
<version>3.11.0-SNAPSHOT</version>
17+
<version>3.11.1-SNAPSHOT</version>
1818
</parent>
1919

2020
<artifactId>seed-rest-jersey2</artifactId>

rest/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<parent>
1414
<groupId>org.seedstack.seed</groupId>
1515
<artifactId>seed</artifactId>
16-
<version>3.11.0-SNAPSHOT</version>
16+
<version>3.11.1-SNAPSHOT</version>
1717
</parent>
1818

1919
<artifactId>seed-rest</artifactId>

rest/specs/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<parent>
1414
<groupId>org.seedstack.seed</groupId>
1515
<artifactId>seed-rest</artifactId>
16-
<version>3.11.0-SNAPSHOT</version>
16+
<version>3.11.1-SNAPSHOT</version>
1717
</parent>
1818

1919
<artifactId>seed-rest-specs</artifactId>

security/core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>org.seedstack.seed</groupId>
1616
<artifactId>seed-security</artifactId>
17-
<version>3.11.0-SNAPSHOT</version>
17+
<version>3.11.1-SNAPSHOT</version>
1818
</parent>
1919

2020
<artifactId>seed-security-core</artifactId>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright © 2013-2020, The SeedStack authors <http://seedstack.org>
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*/
8+
package org.seedstack.seed.security.internal;
9+
10+
import org.apache.shiro.authc.UsernamePasswordToken;
11+
import org.seedstack.seed.security.AuthenticationToken;
12+
13+
public class SeedUsernamePasswordToken extends UsernamePasswordToken implements AuthenticationToken {
14+
public SeedUsernamePasswordToken(String username, char[] password, boolean rememberMe, String host) {
15+
super(username, password, rememberMe, host);
16+
}
17+
}

0 commit comments

Comments
 (0)