Updates the authorization model for batches and adds support for non-authorized, small batches#1406
Updates the authorization model for batches and adds support for non-authorized, small batches#1406matsduf wants to merge 28 commits into
Conversation
The purpose of the update is, firstly, to move away from authorization
of batch creation by using username/password created through RPC API
to using a token configured in the configuration file. Secondly, to
support the creation of small batches without authorization. In the
latter case using undelated data etc will not be supported.
* Updates configuration/backend.md:
* Updates table of contents
* Deprecates "enable_add_batch_job"
* Deprecates "enable_add_api_user"
* Redefines "enable_batch_create" to replace "enable_add_batch_job"
* Defines "enable_batch_create" and "enable_add_batch_job" to be
conflicting.
* Removes experimental "enable_user_create"
* Defines "batch_create_token" for a token to authorize batch creation.
* Defines "batch_create_max_length_non_auth" to set to number of
domains in batches created without token.
* Editorial updates.
* Updates rpcapi-reference.md
* Updates table of contents
* Defines data type "Token"
* Defines method "conf_batch_create_max_size_non_auth"
* Deprecates methods "add_api_user" and "add_batch_job"
* Redefines method "batch_create" to replace "add_batch_job"
* Removes experimental "user_create"
* Editorial updates
9231d6e to
1bf0947
Compare
Co-authored-by: Marc van der Wal <103426270+marc-vanderwal@users.noreply.github.com>
|
Renames some methods and keys. No change of logic. |
Co-authored-by: Mattias Päivärinta <mattias@paivarinta.se>
Co-authored-by: Mattias Päivärinta <mattias@paivarinta.se>
Co-authored-by: Marc van der Wal <103426270+marc-vanderwal@users.noreply.github.com>
Co-authored-by: Marc van der Wal <103426270+marc-vanderwal@users.noreply.github.com>
| Multiple `batch_api_key` is supported. All configured keys will be equal in | ||
| authorization. For each key `batch_api_key` is repeated on a new line in the | ||
| configuration file with the "Batch API Key" as value. |
There was a problem hiding this comment.
So does that mean that something like this will work?
[RPCAPI]
batch_api_key = "NotSoSecret"
batch_api_key = "NotSoSecretEither"
batch_api_key = "LikewiseNotASecret"There was a problem hiding this comment.
Do think the language should be clarified? Do you think it is a good or bad idea?
There was a problem hiding this comment.
I think it’s a good idea because it helps avoid having shared secrets between more than two components.
Yes, maybe you could add an example like the one I gave in my previous comment in the text to make the syntax clearer.
There was a problem hiding this comment.
@marc-vanderwal, I like examples because it helps to understand. In that file we do not have much examples, but we have several examples in the zonemaster-backend:share/config.ini file. Do you agree that it would be better to put your examples in the ini file? It will be updated in an upcoming PR.
There was a problem hiding this comment.
I think it’s best to have this example both in the documentation and in the example configuration file. The syntax is a bit unorthodox because configuration keys are usually unique within a file. It should be crystal clear for users that yes, you can have multiple batch_api_key variables and that it makes all API keys work, not just the first or last one.
There was a problem hiding this comment.
Updated as suggested.
|
|
||
| ### API method: `get_batch_job_result` | ||
|
|
||
| *Deprecated. To be removed with release v2025.2* Replaced by |
There was a problem hiding this comment.
| *Deprecated. To be removed with release v2025.2* Replaced by | |
| *Deprecated. To be removed with release v2026.2* Replaced by |
There was a problem hiding this comment.
Already removed. I have to rebase the PR.
| #### `"result"` | ||
|
|
||
| An object with the following properties: | ||
|
|
||
| * `"batch_id"`: A [*hash batch id*][Hash batch id]. | ||
|
|
There was a problem hiding this comment.
It is confusing with the example. do we get
"result": "B-c45a3f8256c4a155"
or
"result": { "batch_id": "B-c45a3f8256c4a155" }
There was a problem hiding this comment.
Updates the specification. It should use the same model as "start_domain_test" and "add_batch_job".
Co-authored-by: MichaelTimbert <110017095+MichaelTimbert@users.noreply.github.com>
MichaelTimbert
left a comment
There was a problem hiding this comment.
Look good for me.
Purpose
This PR, firstly, moves away from authorization of batch creation by using username/password created through RPC API to using a token configured in the configuration file. Secondly, is supports the creation of small batches without authorization. In the latter case using undelegated data etc will not be supported.
When small batches without authorization can be created, that function is to be added to GUI.
When the changes in this PR are approved the following changes are to be created:
Context
How to test this PR
Review the changes.