Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration: document the 'credentials' option #4035

Merged
merged 5 commits into from
Feb 15, 2024

Conversation

andreyaksenov
Copy link
Contributor

@andreyaksenov andreyaksenov commented Feb 8, 2024

New/updated topics

New reference sections

Changes not directly related to this PR

Given that a privilege is a container for a permission and a corresponding object, it is necessary to clarify terminology in the existing Access control topic and related admin functions. So, privilege is changed to permission where applicable:

Topic:

Reference - Updated signatures and descriptions:

@andreyaksenov andreyaksenov linked an issue Feb 8, 2024 that may be closed by this pull request
@andreyaksenov andreyaksenov force-pushed the access-control-configuration branch 3 times, most recently from ea999ec to 9138851 Compare February 8, 2024 09:49
@andreyaksenov andreyaksenov linked an issue Feb 8, 2024 that may be closed by this pull request
@andreyaksenov andreyaksenov force-pushed the access-control-configuration branch 10 times, most recently from 949cf7d to 1750c3d Compare February 9, 2024 07:56
@andreyaksenov andreyaksenov changed the title Config credentials: sample Configuration: Create the Credentials topic Feb 9, 2024
@andreyaksenov andreyaksenov changed the title Configuration: Create the Credentials topic Configuration: document the 'credentials' option Feb 9, 2024
@andreyaksenov andreyaksenov force-pushed the access-control-configuration branch 13 times, most recently from 707582d to 232d204 Compare February 12, 2024 14:21
@andreyaksenov andreyaksenov force-pushed the access-control-configuration branch 16 times, most recently from 328befc to cc629f0 Compare February 13, 2024 09:05
@andreyaksenov andreyaksenov force-pushed the access-control-configuration branch from cc629f0 to 377fe57 Compare February 13, 2024 09:17
Copy link

@Lord-KA Lord-KA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patchset! See my 6 comments on the privileges/permissions patch below.

doc/book/admin/access_control.rst Show resolved Hide resolved
doc/book/admin/access_control.rst Outdated Show resolved Hide resolved
doc/book/admin/access_control.rst Outdated Show resolved Hide resolved
doc/book/admin/access_control.rst Outdated Show resolved Hide resolved
doc/book/admin/access_control.rst Outdated Show resolved Hide resolved
@Totktonada Totktonada removed their request for review February 13, 2024 11:38
Copy link

@Lord-KA Lord-KA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credentials part of the patchset looks good, LGTM. See my only proposal below.

Comment on lines +663 to +664
credentials.roles.*
~~~~~~~~~~~~~~~~~~~
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I would prefer to have user section before role, because it has the primary meaning.

@andreyaksenov andreyaksenov requested review from p7nov and removed request for ImeevMA February 14, 2024 14:09
Copy link
Contributor

@p7nov p7nov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, just some minor comments from my side.

@@ -395,18 +395,15 @@ Access control
~~~~~~~~~~~~~~

The ``credentials`` section allows you to create users and grant them the specified privileges.
In the example below, there are two users:
In the example below, a password for the built-in 'admin' user is set:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the example below, a password for the built-in 'admin' user is set:
In the example below, a password for the built-in ``admin`` user is set:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omg, here is a new dbadmin user is created, fixed:

image

You can read more about the main concepts of Tarantool access control system in the :ref:`authentication` section.

This topic describes how to create users and grant them the specified privileges in the :ref:`credentials <configuration_reference_credentials>` section of a YAML configuration.
This might be used to create specific users used in communications between Tarantool instances.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used to create users used - needs rephrasing.
Also, specific and specified seem redundant in sentences of this paragraphs. It's better to keep short.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I get it right, these replication and sharding users are necessary in case of a sharded cluster (which is the main use case of Tarantool 3.0). If it's true, I'd expect a stronger wording expressing this, not just might be used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Al right, the last comment on this paragraph =)
The only example made me think that this section is only for such technical users, while regular users are created from the Lua console. Maybe a bit more explicit explanation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to remove the second sentence at all:

This topic describes how to create users and grant them the specified privileges in the :ref:`credentials <configuration_reference_credentials>` section of a YAML configuration.
For example, you can define users with the ``replication`` and ``sharding`` roles to maintain :ref:`replication <replication-master_replica_configuring_credentials>` and sharding in a Tarantool cluster.

:end-at: [ writers_space_reader ]
:dedent:

Apart from assigning a role to a user, you can grant specific privileges directly using :ref:`credentials.users.\<username\>.privileges <configuration_reference_credentials_users_name_privileges>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: intro part Apart from assigning a role to a user doesn't seem to add meaning, so I'd drop it to keep short. Up to you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea: maybe make separate headings Granting roles and Granting privileges to make the right ToC more explicit?


.. confval:: <user_or_role_name>.privileges.permissions

Permissions assigned to this user or a user with this role.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreyaksenov andreyaksenov merged commit 1f7a33a into latest Feb 15, 2024
1 check passed
@andreyaksenov andreyaksenov deleted the access-control-configuration branch February 15, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config.context: define cluster config parts in env/file [Config] Document the 'credentials' option
3 participants