Skip to content

Commit 996c87c

Browse files
zzacharoSebastian Witowski
authored andcommitted
docs: add documentation for cli commands
1 parent 9eac1bd commit 996c87c

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

invenio_base/__init__.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,80 @@ def index():
174174
`Flask <http://flask.pocoo.org/docs/dev/cli/>`_ documentation for further
175175
information.
176176
177+
178+
Listing all entrypoints of an Invenio instance
179+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180+
The ``instance entrypoints`` subcommand helps you list all entrypoints of your
181+
Invenio application:
182+
183+
.. code-block:: console
184+
185+
$ inveniomanage instance entrypoints
186+
187+
The output of the command will be in the below format:
188+
189+
.. code-block:: console
190+
191+
<entrypoint_group_name>
192+
<entrypoint>
193+
194+
195+
You can also restrict the output of the command to list all entrypoints for a
196+
specific entrypoint group by passing the name via the `-e` option:
197+
198+
.. code-block:: console
199+
200+
$ inveniomanage instance entrypoints -e <entrypoint_group_name>
201+
202+
For further details about the available options run the `help` command:
203+
204+
.. code-block:: console
205+
206+
$ inveniomanage instance entrypoints --help
207+
...
208+
209+
210+
Migrating the application's old secret key
211+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
212+
The ``instance migrate_secret_key`` subcommand helps you migrate your
213+
application's old secret key:
214+
215+
.. code-block:: console
216+
217+
$ inveniomanage instance migrate_secret_key --old-key <old_key>
218+
219+
The purpose of this command is to provide the administrator the capability to
220+
change the Invenio application's secret_key and migrate that change in all
221+
database's EncryptedType properties through an entrypoint group called
222+
`invenio_base.secret_key'`. There you can specify your migration function that
223+
will receive the old secret_key that can be used to decrypt the old properties
224+
and encrypt them again with the application's new secret_key.
225+
226+
You can register your migration function as shown below in your package's
227+
entrypoints in the setup.py:
228+
229+
.. code-block:: console
230+
231+
entrypoints= {
232+
'invenio_base.secret_key': [
233+
'<entrypoint_name> = <entrypoint_function>'
234+
]
235+
}
236+
237+
Also you can see an example of use in `invenio_oauthclient
238+
<https://github.com/inveniosoftware/invenio-oauthclient>`_
239+
package's setup.py.
240+
241+
.. note::
242+
You should change your application's `secret_key` in the config before calling
243+
the migration command.
244+
245+
For further details about the available options run the `help` command:
246+
247+
.. code-block:: console
248+
249+
$ inveniomanage instance migrate_secret_key --help
250+
...
177251
"""
178252

179253
from __future__ import absolute_import, print_function

0 commit comments

Comments
 (0)