AuthSession

class pyvo.auth.AuthSession[source]

Bases: object

A requests-like session that pyvo can use to dispatch its network calls with authentication.

The user adds their credentials to the credentials object, such as adding a cookie, certificate, or password.

The network requests made by pyvo pass through here, and the URL of the request is matched against the capabilities of the service. Based on what credentials have been provided and the capabilities of the service, appropriate credentials are added to the request before it is sent.

Methods Summary

add_security_method_for_url(url, security_method)

Add a security method for a url.

delete(url, **kwargs)

Wrapper to make a HTTP DELETE request with authentication.

get(url, **kwargs)

Wrapper to make a HTTP GET request with authentication.

post(url, **kwargs)

Wrapper to make a HTTP POST request with authentication.

put(url, **kwargs)

Wrapper to make a HTTP PUT request with authentication.

update_from_capabilities(capabilities)

Update the URL to security method mapping using the capabilities provided.

Methods Documentation

add_security_method_for_url(url, security_method, exact=False)[source]

Add a security method for a url. This is additive with update_from_capabilities. This can be useful to set additional security methods that aren’t set in the capabilities for whatever reason.

Parameters:
urlstr

URL to set a security method for

security_methodstr

URI of the security method to set

exactbool

If True, match only this URL. If false, match all URLs that match this as a base URL.

delete(url, **kwargs)[source]

Wrapper to make a HTTP DELETE request with authentication.

get(url, **kwargs)[source]

Wrapper to make a HTTP GET request with authentication.

post(url, **kwargs)[source]

Wrapper to make a HTTP POST request with authentication.

put(url, **kwargs)[source]

Wrapper to make a HTTP PUT request with authentication.

update_from_capabilities(capabilities)[source]

Update the URL to security method mapping using the capabilities provided.

Parameters:
capabilitiesobject

List of Capabilities