Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OpenID plugin shouldn'd require global read access for authenticating users
- Loading branch information
Showing
4 changed files
with
94 additions
and
24 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/main/java/hudson/plugins/openid/StaticResourceServer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package hudson.plugins.openid; | ||
|
||
import hudson.Extension; | ||
import hudson.model.UnprotectedRootAction; | ||
import jenkins.model.Jenkins; | ||
import org.kohsuke.stapler.StaplerRequest; | ||
import org.kohsuke.stapler.StaplerResponse; | ||
|
||
import javax.servlet.ServletException; | ||
import java.io.IOException; | ||
|
||
/** | ||
* Serve static resources even when the user doesn't have read access, as in prior to the login. | ||
* | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
@Extension | ||
public class StaticResourceServer implements UnprotectedRootAction { | ||
public String getIconFileName() { | ||
return null; | ||
} | ||
|
||
public String getDisplayName() { | ||
return null; | ||
} | ||
|
||
public String getUrlName() { | ||
return "openid-assets"; | ||
} | ||
|
||
// serve static resources | ||
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { | ||
Jenkins.getInstance().getPlugin("openid").doDynamic(req,rsp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters