bird-house / birdy

Birdy provides a command-line tool to work with Web Processing Services.
http://birdy.readthedocs.io/en/latest/
Apache License 2.0
8 stars 3 forks source link

Update authentication mechanism #222

Open huard opened 1 year ago

huard commented 1 year ago

Description

In owslib, the use of "username", "password", "verify", and "cert" is deprecated. Use the "auth" keyword during class instantiation. These keywords will be removed in a future release.

Environment

huard commented 1 year ago

@fmigneault I don't see any test for the auth mechanism in the WPSClient. Do you where this is used so I can make sure I'm not breaking anything while fixing this?

fmigneault commented 1 year ago

@huard I'm not sure about birdy. I've not been using it. However, in Weaver I'm passing around the headers (https://github.com/crim-ca/weaver/blob/master/weaver/wps/utils.py#L262-L275) instead of relying on auth because it only supports basic auth with username/password, while Magpie uses cookies. If anything, owslib should allow a custom auth handler similar to what requests does to support any kind of auth method.

fmigneault commented 1 year ago

Looks like this is what is already being done here also: https://github.com/bird-house/birdy/blob/7398c8adc7264f31b9f7664998b3932cb6d89be8/birdy/client/base.py#L107-L131

huard commented 1 year ago

Yep, this is exactly the bit of code that I want to test.

If anything, owslib should allow a custom auth handler similar to what requests does to support any kind of auth method.

I think that's what the auth_delegate parameter does, and I'd like to test it.

fmigneault commented 1 year ago

You could try registering a duplicate WPS in Magpie, and make it protected except for a certain user. Then, use https://github.com/Ouranosinc/requests-magpie to pass the auth parameter to WPSClient. If the GetCapabilities resolves when using the correct user, and blocked otherwise, that would make a good validation test.