Skip to content
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

Merged
merged 3 commits into from
Dec 14, 2018

Conversation

buehner
Copy link
Member

@buehner buehner commented Dec 7, 2018

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 our MutableHttpServletRequest), 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 the geoserver.user and geoserver.password properties. They can be seen as a demo on how to use the BasicAuthHeaderRequest class.

The webapp archetype has also been adapted to make use of the new default implementations.

@marcjansen
Copy link
Member

Much love! LGTM. Please merge.

Copy link
Collaborator

@chrismayer chrismayer left a 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.


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

/**
*
*/
@Value("${geoserver.username}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation


/**
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

@chrismayer
Copy link
Collaborator

chrismayer commented Dec 10, 2018

Just a general question: Would it be meaningful to introduce a base implementation for OwsInterceptions? Like

class WmsRequestInterceptor extends OwsRequestInterception implements WpsRequestInterceptorInterface {}

whereas OwsRequestInterception could have common functionality like a common interceptGetCapabilities method.

@buehner
Copy link
Member Author

buehner commented Dec 14, 2018

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

@buehner buehner merged commit ed7af89 into terrestris:master Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants