-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intercept OGC requests with basic auth by default #330
Conversation
Much love! LGTM. Please merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just some minor indentation things you might want to address at some time.
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
/** | ||
* | ||
*/ | ||
@Value("${geoserver.username}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
|
||
/** | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
Just a general question: Would it be meaningful to introduce a base implementation for OwsInterceptions? Like class WmsRequestInterceptor extends OwsRequestInterception implements WpsRequestInterceptorInterface {} whereas |
Thanks for your comments. The whole formatting of these files was a crazy mix. I fixed that. Thanks for the hint @chrismayer Regarding your idea to introduce a new base implementation: Yes. I think this would be possible here, but currently i don't see a real need as this will mainly change the class hierarchy. But feel free to open a PR ;-) I'll merge now |
This is a solution for #315 to add basic auth credentials (based on geoserver properties) for each OGC request within the interceptor. In case the geoserver or certain services are not protected, this will not break anything.
The main class is
BasicAuthHeaderRequest.java
(extending ourMutableHttpServletRequest
), which will actually add the basic auth header. The credentials can be passed in the constructor, which may also be helpful in project solutions with more specific requirements.The new classes in the
de.terrestris.shogun2.util.interceptor.impl
package are default implementations for shogun2 and use the credentials from thegeoserver.user
andgeoserver.password
properties. They can be seen as a demo on how to use theBasicAuthHeaderRequest
class.The webapp archetype has also been adapted to make use of the new default implementations.