Skip to content

Commit

Permalink
support cert auth when talking to the API
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jan 10, 2025
1 parent 5278e0d commit a3fdea8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apypie/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class Api(object):
:param uri: base URL of the server
:param username: username to access the API
:param password: password to access the API
:param client_cert: client cert to access the API
:param client_key: client key to access the API
:param api_version: version of the API. Defaults to `1`
:param language: prefered locale for the API description
:param apidoc_cache_base_dir: base directory for building apidoc_cache_dir. Defaults to `~/.cache/apipie_bindings`.
Expand Down Expand Up @@ -80,6 +82,9 @@ def __init__(self, **kwargs):
if kwargs.get('username') and kwargs.get('password'):
self._session.auth = (kwargs['username'], kwargs['password'])

if kwargs.get('client_cert') and kwargs.get('client_key'):
self._session.cert = (kwargs['client_cert'], kwargs['client_key'])

Check warning on line 86 in apypie/api.py

View check run for this annotation

Codecov / codecov/patch

apypie/api.py#L86

Added line #L86 was not covered by tests

self._apidoc = None

@property
Expand Down

0 comments on commit a3fdea8

Please sign in to comment.