Skip to content

Commit

Permalink
Merge pull request #4 from guusdk/remove-unneeded-authfilter
Browse files Browse the repository at this point in the history
Remove unneeded authfilter & release
  • Loading branch information
akrherz authored May 23, 2023
2 parents a904975 + aafa6f9 commit b2820e2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
5 changes: 5 additions & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ <h1>
Random Avatar Plugin Changelog
</h1>

<p><b>1.1.0</b> -- May 23, 2023</p>
<ul>
<li>Remove unused exclusion to authentication filter</li>
</ul>

<p><b>1.0.0</b> -- March 29, 2019</p>
<ul>
<li>Initial release.</li>
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<description>${project.description}</description>
<author>Guus der Kinderen</author>
<version>${project.version}</version>
<date>03/29/2018</date>
<date>2023-05-23</date>
<minServerVersion>4.1.5</minServerVersion>
<minJavaVersion>1.8</minJavaVersion>
</plugin>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.igniterealtime.openfire.plugins</groupId>
<artifactId>randomavatar</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>

<name>Random Avatar Generator Plugin</name>
<description>Generates semi-random avatar images.</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 Ignite Realtime Foundation. All rights reserved.
* Copyright (C) 2019-2023 Ignite Realtime Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,6 @@
import org.eclipse.jetty.apache.jsp.JettyJasperInitializer;
import org.eclipse.jetty.plus.annotation.ContainerInitializer;
import org.eclipse.jetty.webapp.WebAppContext;
import org.jivesoftware.admin.AuthCheckFilter;
import org.jivesoftware.openfire.container.Plugin;
import org.jivesoftware.openfire.container.PluginManager;
import org.jivesoftware.openfire.http.HttpBindManager;
Expand All @@ -45,24 +44,13 @@ public class RandomAvatarPlugin implements Plugin

private static final Logger Log = LoggerFactory.getLogger( RandomAvatarServlet.class );

private final String[] publicResources = new String[]
{
CONTEXT_ROOT + "/*"
};

private WebAppContext context = null;

@Override
public void initializePlugin( PluginManager manager, File pluginDirectory )
{
Log.debug( "Plugin initialization started." );

Log.debug( "Excluding all public resources from the Authorization-Check filter." );
for ( final String publicResource : publicResources )
{
AuthCheckFilter.addExclude( publicResource );
}

Log.debug( "Adding the Webchat sources to the same context as the one that's providing the BOSH interface." );
context = new WebAppContext( null, pluginDirectory.getPath() + File.separator + "classes/", "/" + CONTEXT_ROOT );
context.setClassLoader( this.getClass().getClassLoader() );
Expand Down Expand Up @@ -91,12 +79,6 @@ public void destroyPlugin()
context = null;
}

for ( final String publicResource : publicResources )
{
Log.debug( "Removing Authorization-Check filter exemptions." );
AuthCheckFilter.removeExclude( publicResource );
}

Log.debug( "Plugin finished started." );
}
}

0 comments on commit b2820e2

Please sign in to comment.