Skip to content

Commit

Permalink
Merge pull request #37 from icgood/v1
Browse files Browse the repository at this point in the history
Set version 1.0.0
  • Loading branch information
icgood committed Nov 6, 2022
2 parents d97efec + 1c197f9 commit 354183c
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install build tools
Expand All @@ -42,9 +42,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install build tools
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
- name: Install build tools
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build and publish
Expand All @@ -31,9 +31,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install build tools
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ a [`ServerCredentials`][2] object, we can access information from the
attempt:

```python
from pysasl.creds.server import ServerCredentials
from pysasl.identity import ClearIdentity, HashedIdentity

print('Authenticated as:', result.authcid)
print('Authorization ID:', result.authzid)
result: ServerCredentials = ...

print('Authenticating as:', result.authcid)
print('Authorizing as:', result.authzid)

# To compare to a known cleartext password...
identity = ClearIdentity('myuser', 's3kr3t')
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [] # type: ignore
exclude_patterns: list[str] = []


# -- Options for HTML output -------------------------------------------------
Expand Down
15 changes: 15 additions & 0 deletions doc/source/pysasl.creds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,36 @@
``pysasl.creds`` Package
========================

``pysasl.creds`` Module
-----------------------

.. automodule:: pysasl.creds
:members:

``pysasl.creds.server`` Module
------------------------------

.. automodule:: pysasl.creds.server
:members:
:show-inheritance:

``pysasl.creds.client`` Module
------------------------------

.. automodule:: pysasl.creds.client
:members:
:show-inheritance:

``pysasl.creds.plain`` Module
-----------------------------

.. automodule:: pysasl.creds.plain
:members:
:show-inheritance:

``pysasl.creds.external`` Module
--------------------------------

.. automodule:: pysasl.creds.external
:members:
:show-inheritance:
18 changes: 18 additions & 0 deletions doc/source/pysasl.mechanism.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,38 @@
``pysasl.mechanism`` Package
============================

``pysasl.mechanism`` Module
---------------------------

.. automodule:: pysasl.mechanism
:members:

``pysasl.mechanism.plain`` Module
---------------------------------

.. automodule:: pysasl.mechanism.plain
:members:

``pysasl.mechanism.login`` Module
---------------------------------

.. automodule:: pysasl.mechanism.login
:members:

``pysasl.mechanism.crammd5`` Module
-----------------------------------

.. automodule:: pysasl.mechanism.crammd5
:members:

``pysasl.mechanism.oauth`` Module
---------------------------------

.. automodule:: pysasl.mechanism.oauth
:members:

``pysasl.mechanism.external`` Module
------------------------------------

.. automodule:: pysasl.mechanism.external
:members:
18 changes: 11 additions & 7 deletions pysasl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .config import default_config, SASLConfig
from .mechanism import Mechanism, ServerMechanism, ClientMechanism

__all__ = ['__version__', 'SASLConfig', 'SASLAuth']
__all__ = ['__version__', 'SASLAuth']

#: The pysasl package version.
__version__: str = pkg_resources.require(__package__)[0].version
Expand Down Expand Up @@ -81,17 +81,22 @@ def _get_builtin_mechanisms(cls, config: SASLConfig) \

@property
def server_mechanisms(self) -> Sequence[ServerMechanism]:
"""List of available :class:`ServerMechanism` objects."""
"""List of available :class:`~pysasl.mechanism.ServerMechanism`
objects.
"""
return list(self._server_mechanisms.values())

@property
def client_mechanisms(self) -> Sequence[ClientMechanism]:
"""List of available :class:`ClientMechanism` objects."""
"""List of available :class:`~pysasl.mechanism.ClientMechanism`
objects.
"""
return list(self._client_mechanisms.values())

def get_server(self, name: bytes) -> Optional[ServerMechanism]:
"""Like :meth:`.get`, but only mechanisms inheriting
:class:`ServerMechanism` will be returned.
"""Get a :class:`~pysasl.mechanism.ClientMechanism` by name.
Args:
name: The SASL mechanism name.
Expand All @@ -103,8 +108,7 @@ def get_server(self, name: bytes) -> Optional[ServerMechanism]:
return self._server_mechanisms.get(name.upper())

def get_client(self, name: bytes) -> Optional[ClientMechanism]:
"""Like :meth:`.get`, but only mechanisms inheriting
:class:`ClientMechanism` will be returned.
"""Get a :class:`~pysasl.mechanism.ClientMechanism` by name.
Args:
name: The SASL mechanism name.
Expand Down
7 changes: 4 additions & 3 deletions pysasl/mechanism/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ def server_attempt(self, responses: Sequence[ChallengeResponse]) \
from the client and issues challenges until it has everything needed to
verify the credentials.
If a challenge is necessary, a :class:`ServerChallenge` exception will
be raised. The response to this challenge must then be added to
*responses* in the next call to :meth:`.server_attempt`.
If a challenge is necessary, a
:class:`~pysasl.mechanism.ServerChallenge` exception will be raised.
The response to this challenge must then be added to *responses* in the
next call to :meth:`.server_attempt`.
Args:
responses: The challenge-response exchanges thus far.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
license = fh.read()

setup(name='pysasl',
version='1.0.0.rc8',
version='1.0.0',
author='Ian Good',
author_email='ian@icgood.net',
description='Pure Python SASL client and server library.',
Expand Down

0 comments on commit 354183c

Please sign in to comment.