-
Notifications
You must be signed in to change notification settings - Fork 43
Docs for roles/role_cfg #4221
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
Docs for roles/role_cfg #4221
Conversation
1ea3af2
to
1609842
Compare
b9c3af8
to
12b4c1c
Compare
0bcfb08
to
8564127
Compare
c8cd763
to
6359787
Compare
6359787
to
349a2e8
Compare
ea06e5e
to
92ff4ba
Compare
798140c
to
2910993
Compare
d07d3e2
to
adb540a
Compare
a84584e
to
b90eb99
Compare
b90eb99
to
5f8c589
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the decent work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition, I finally understood what are these application roles :)
One general question: should we maybe provide more cross-links to doc pages where built-in roles and module roles are explained or used? I mean, you say there are built-in roles
, and the reader wonders What built-in roles? Is there a list? How to use them?
doc/concepts/configuration.rst
Outdated
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
An application role is a Lua module that implements specific functions or logic. | ||
You can enable or turn off a particular role for certain instances in a configuration without restarting these instances. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"enable or turn off" sounds inconsistent. Let's use one word for the two states (enable/disable
or turn on/off
)
Loading an application | ||
********************** | ||
This section describes how to enable and configure roles. | ||
To learn how to develop custom roles, see :ref:`application_roles`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You write about custom roles, but there there is no explanation of non custom roles. Maybe add a sentence about them to the first paragraph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, updated the intro of this section to tell a bit about different types of roles.
As the most of configuration options, roles and their configurations can be defined at :ref:`different levels <configuration_scopes>`. | ||
Given that the ``roles`` option has the ``array`` type and ``roles_cfg`` has the ``map`` type, there are some specifics of applying the configuration: | ||
|
||
- For ``roles``, an instance's role takes precedence over roles defined at another level. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- For ``roles``, an instance's role takes precedence over roles defined at another level. | |
- For ``roles``, an instance's role overwrites all roles defined at another levels. |
Nit: overwrites
seems a more straightforward verb to explain that other roles are discarded.
doc/how-to/app/app_roles.rst
Outdated
|
||
Roles can be divided into the following groups: | ||
|
||
- Roles provided by Tarantool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Roles provided by Tarantool. | |
- Tarantool's built-in roles. |
Nit: this sounds more natural to me (if this wording is correct in our terminology).
- A role is a container for privileges that can be granted to users. Learn more in :ref:`access_control_concepts_roles`. | ||
- A role of a replica set in regard to sharding. Learn more in :ref:`vshard_config_sharding_roles`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- A role is a container for privileges that can be granted to users. Learn more in :ref:`access_control_concepts_roles`. | |
- A role of a replica set in regard to sharding. Learn more in :ref:`vshard_config_sharding_roles`. | |
- A user role is a container for privileges that can be granted to users. Learn more in :ref:`access_control_concepts_roles`. | |
- A sharding role of a replica set in regard to sharding. Learn more in :ref:`vshard_config_sharding_roles`. |
Just an idea, to decrease readers' confusion a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A user role
Sounds better but a role can also has a role :) So, it's better to keep it as is.
A sharding role of a replica set in regard to sharding.
sharding
meets two times in this case and add some confusion.
doc/how-to/app/app_roles.rst
Outdated
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To validate a role's configuration, you need to define the :ref:`validate([cfg]) <roles_api_reference_validate>` function. | ||
The ``cfg`` argument allows you to get access to the provided :ref:`role's configuration <roles_create_custom_role_config>` and check its validity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ``cfg`` argument allows you to get access to the provided :ref:`role's configuration <roles_create_custom_role_config>` and check its validity. | |
The ``cfg`` argument provides access to the :ref:`role's configuration <roles_create_custom_role_config>` and check its validity. |
Seems shorter and easier to read
|
||
.. _roles_create_space: | ||
|
||
Specifics of creating spaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifics of creating spaces | |
Creating spaces in roles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This applies to creating spaces for applications in general. So, I'm going to move this section outside this topic at some moment.
|
||
.. _roles_life_cycle_stopping_roles: | ||
|
||
2) *Stopping roles* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Spotting removed roles
or smth like that? the current wording surprised me and took some time to understand which roles we're talking about
For roles that :ref:`depend <roles_create_custom_role_dependencies>` on each other, their ``validate()``, ``apply()``, and ``stop()`` functions are executed taking into account the dependencies. | ||
Suppose, there are two independent roles (``role1``, ``role2``) and three roles that depend on each other as follows: | ||
|
||
.. code-block:: none |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a verbal explanation? It's unclear to me now.
|
||
.. data:: dependencies | ||
|
||
(Optional) Define a role's dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Optional) Define a role's dependencies. | |
(Optional) Role's dependencies. |
Nit: IMO, verbs are not needed in option/parameter/variable descriptions in references.
b9a535c
to
d5cf730
Compare
It's a good idea. AFAIK, Tarantool provides only one role for now. For roles provided by external modules, this question goes beyond roles. Currently, I know two external modules that provide its own roles: CRUD and expirationd (and the docs gives a link to CRUD as an example). At the same time, any information for these modules are missing in our docs. I'll create an issue to think how to deal with this. |
Docs for roles.
sharded_cluster_crud
sample to using built-in CRUD roles.hello world
role without config.hello world
role with config.Configuration
topic:app
with roles: Enabling and configuring rolesTT_APP_CFG
example toTT_ROLES_CFG
: Environment variables | MapConfiguration options overview
section. Existing topics already cover this info.Developing applications with Tarantool
.roles
/roles_cfg
options: rolesapp
options: app