forked from jenkinsci/oic-auth-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogoutQueryParameter.java
More file actions
36 lines (30 loc) · 1.13 KB
/
LogoutQueryParameter.java
File metadata and controls
36 lines (30 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package org.jenkinsci.plugins.oic;
import hudson.Extension;
import hudson.model.Descriptor.FormException;
import hudson.util.FormValidation;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.verb.POST;
public class LogoutQueryParameter extends AbstractQueryParameter<LogoutQueryParameter> {
@DataBoundConstructor
public LogoutQueryParameter(String key, String value) throws FormException {
super(key, value, true);
}
@Extension
public static class DescriptorImpl extends AbstractKeyValueDescribable.DescriptorImpl<LogoutQueryParameter> {
@POST
@Override
public FormValidation doCheckKey(@QueryParameter String key) {
return switch (key.trim()) {
case "id_token_hint", "state", "post_logout_redirect_uri" ->
FormValidation.error(key + " is a reserved word");
default -> FormValidation.ok();
};
}
@POST
@Override
public FormValidation doCheckValue(String value) {
return FormValidation.ok();
}
}
}