Skip to content

Commit

Permalink
Fix minor problems with the new security module (#452)
Browse files Browse the repository at this point in the history
- The API documentation was missing
- The documentation for it is written like a section and distorts
the menu. The sections are converted to subsections.
- The code sample was missing a new line, and was resulting in error.
- The documentation at the client constructor had a wrong module name
- Removed the `security` folder and moved everything to `security` module
to match with the style of the rest of the code base.
  • Loading branch information
mdumandag committed Aug 19, 2021
1 parent a6da8ef commit c6149ab
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/api/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ API Documentation
partition
predicate
proxy/modules
security
serialization
sql
transaction
Expand Down
4 changes: 4 additions & 0 deletions docs/api/security.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Security
========

.. automodule:: hazelcast.security
5 changes: 3 additions & 2 deletions docs/securing_client_connection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ and ``ssl_keyfile`` on top of the other TLS/SSL configurations. See the
section for the details of these options.

Username/Password Authentication
================================
--------------------------------

You can protect your cluster using a username and password pair.
In order to use it, enable it in member configuration:
Expand Down Expand Up @@ -293,7 +293,7 @@ Check out the documentation on `Password Credentials
of the Hazelcast Documentation.

Token-Based Authentication
==========================
--------------------------

Python client supports token-based authentication via token providers.
A token provider is a class derived from :class:`hazelcast.security.TokenProvider`.
Expand All @@ -316,6 +316,7 @@ In order to use token based authentication, first define in the member configura
Using :class:`hazelcast.security.BasicTokenProvider` you can pass the given token the member:

.. code:: python
token_provider = BasicTokenProvider("MY-SECRET")
client = hazelcast.HazelcastClient(
token_provider=token_provider
Expand Down
5 changes: 3 additions & 2 deletions hazelcast/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,9 @@ class SomeClassSerializer(StreamSerializer):
successful replicas. By default, set to ``False`` (do not fail).
creds_username (str): Username for credentials authentication (Enterprise feature).
creds_password (str): Password for credentials authentication (Enterprise feature).
token_provider (hazelcast.token_provider.TokenProvider): Token provider for custom authentication (Enterprise feature).
Note that token_provider setting has priority over credentials settings.
token_provider (hazelcast.security.TokenProvider): Token provider for
custom authentication (Enterprise feature). Note that token_provider
setting has priority over credentials settings.
"""

_CLIENT_ID = AtomicInteger()
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion hazelcast/security/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/unit/token_provider_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from hazelcast.security.token_provider import BasicTokenProvider
from hazelcast.security import BasicTokenProvider


class BasicTokenProviderTestCase(unittest.TestCase):
Expand Down

0 comments on commit c6149ab

Please sign in to comment.