Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Builds shiro-core and shiro-web jars and attaches them to a GitHub release
# on push of a v*-alauda tag.
name: Release Alauda-fork jars

on:
workflow_dispatch: {}
push:
tags:
- 'v*-alauda'

permissions:
contents: write

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin

- name: Build shiro-core and shiro-web (skip tests, skip rat)
run: |
mvn -B -ntp -pl core,web -am \
-DskipTests -Drat.skip=true \
-Dinvoker.skip=true \
package

- name: Collect release artifacts
id: collect
run: |
mkdir -p release-artifacts
cp core/target/shiro-core-*.jar release-artifacts/
cp web/target/shiro-web-*.jar release-artifacts/
ls -l release-artifacts/

- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: release-artifacts/*.jar
generate_release_notes: true
fail_on_unmatched_files: true
2 changes: 1 addition & 1 deletion all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>shiro-root</artifactId>
<groupId>org.apache.shiro</groupId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion config/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-config</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion config/ogdl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-config</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<artifactId>shiro-config</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ public Subject login(Subject subject, AuthenticationToken token) throws Authenti
throw ae; //propagate
}

Session existingSession = subject.getSession(false);
if (existingSession != null) {
existingSession.stop();
}

Subject loggedIn = createSubject(token, info, subject);

onSuccessfulLogin(token, info, loggedIn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.ldap.LdapContext;
import javax.naming.ldap.Rdn;
import java.util.*;


Expand Down Expand Up @@ -162,7 +163,7 @@ protected Set<String> getRoleNamesForUser(String username, LdapContext ldapConte
SearchControls searchCtls = new SearchControls();
searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);

String userPrincipalName = username;
String userPrincipalName = Rdn.escapeValue(username);
if (principalSuffix != null && !userPrincipalName.toLowerCase(Locale.ROOT).endsWith(principalSuffix.toLowerCase(Locale.ROOT))) {
userPrincipalName += principalSuffix;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import javax.naming.AuthenticationNotSupportedException;
import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;
import javax.naming.ldap.Rdn;

/**
* An LDAP {@link org.apache.shiro.realm.Realm Realm} implementation utilizing Sun's/Oracle's
Expand Down Expand Up @@ -239,11 +240,12 @@ protected String getUserDn(String principal) throws IllegalArgumentException, Il

int prefixLength = prefix != null ? prefix.length() : 0;
int suffixLength = suffix != null ? suffix.length() : 0;
StringBuilder sb = new StringBuilder(prefixLength + principal.length() + suffixLength);
String sanitizedPrincipal = Rdn.escapeValue(principal);
StringBuilder sb = new StringBuilder(prefixLength + sanitizedPrincipal.length() + suffixLength);
if (prefixLength > 0) {
sb.append(prefix);
}
sb.append(principal);
sb.append(sanitizedPrincipal);
if (suffixLength > 0) {
sb.append(suffix);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
*/
public class DefaultSessionManager extends AbstractValidatingSessionManager implements CacheManagerAware {

public static final String SECURE_COOKIE_DISABLED = "org.apache.shiro.cookie.secure.disabled";

//TODO - complete JavaDoc

private static final Logger log = LoggerFactory.getLogger(DefaultSessionManager.class);
Expand Down
2 changes: 1 addition & 1 deletion crypto/cipher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-crypto</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion crypto/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-crypto</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion crypto/hash/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-crypto</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion crypto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<artifactId>shiro-crypto</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/guice3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.integrationtests</groupId>
<artifactId>shiro-integration-tests</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<artifactId>shiro-its-guice3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/guice4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.integrationtests</groupId>
<artifactId>shiro-integration-tests</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<artifactId>shiro-its-guice4</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<groupId>org.apache.shiro.integrationtests</groupId>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.integrationtests</groupId>
<artifactId>shiro-integration-tests</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<artifactId>shiro-its-support</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion lang/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<packaging>pom</packaging>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>

<name>Apache Shiro</name>
<url>https://shiro.apache.org/</url>
Expand Down
2 changes: 1 addition & 1 deletion samples/aspectj/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-root</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/quickstart-guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/servlet-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/spring-boot-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<artifactId>samples-spring-boot-web</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion samples/spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<artifactId>samples-spring-boot</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion samples/spring-hibernate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/spring-mvc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/web-jakarta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.shiro.samples</groupId>
<artifactId>shiro-samples</artifactId>
<version>1.13.1-alauda</version>
<version>1.13.2-alauda</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Loading
Loading