Support user consent flow (#1293)
* Introduce user consent flow * Add permissions to confirmation management * rename from consent to confirmation * Reformat code. Remove unused imports. Change and add permission checks when configuring auto-confirmation. * Do not include null values for DDI confirmation base endpoint * fix confirmation required checkbox id * Remove unused import. Fix consume/produce type of new API's. * Change term processing to proceeding when activating user consent flow * Align formatting and extend integration test cases for DMF and DDI. * Extend DMF test cases to consider auto-confirmation * Refactor action management to fix problem of handling action status updates on closed actions. * remove unsupported validation * use new confirmation api for DMF. Extend test cases., * Remove unnecessary fields. * Extend API documentation for DDI and MGMT API. * adapt ddi api docs adoc file * Fixed the duplicate migration version for db files * fix method to support confirmation * Fixed PR comments * Addressed PR comments * Fixed after merge compilation issue * Fixed after merge compilation issue * Fix failing tests in MgmtRolloutResourceTest * Fixed the permissions issue reflected by integration tests * Added back the missing line of code lost during merge * Fix the failing test on Jenkins Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io> Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io> Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io> Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com> Co-authored-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>
This commit is contained in:
@@ -299,9 +299,237 @@ include::{snippets}/rootcontroller/post-basedeployment-action-feedback/request-f
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/409.adoc[]
|
||||
include::../errors/410.adoc[]
|
||||
include::../errors/415.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
== GET /{tenant}/controller/v1/{controllerid}/confirmationBase
|
||||
|
||||
=== Implementation notes
|
||||
|
||||
Core resource for confirmation related operations. While active actions awaiting confirmation will be referenced, the current auto-confirmation status will be shown. In case auto-confirmation is active, details like the initiator, remark and date of activation (as unix timestamp) will be provided. Reference links to switch the auto-confirmation state are exposed as well.
|
||||
|
||||
=== Resource to request confirmation specific information for the controller
|
||||
|
||||
==== Curl
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-with-auto-confirm-active/curl-request.adoc[]
|
||||
|
||||
==== Request URL
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-with-auto-confirm-active/http-request.adoc[]
|
||||
|
||||
==== Request path parameter
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-with-auto-confirm-active/path-parameters.adoc[]
|
||||
|
||||
==== Response example (auto-confirmation is active)
|
||||
|
||||
The response body in case auto-confirmation is active.
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-with-auto-confirm-active/http-response.adoc[]
|
||||
|
||||
==== Response example (auto-confirmation is not active)
|
||||
|
||||
The response body references a link to activate auto-confirmation as well as a link to an open action waiting for confirmation (if present).
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-with-auto-confirm-deactivated/http-response.adoc[]
|
||||
|
||||
=== Error responses
|
||||
|
||||
|===
|
||||
| HTTP Status Code | Reason | Response Model
|
||||
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/409.adoc[]
|
||||
include::../errors/415.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
== POST /{tenant}/controller/v1/{controllerid}/confirmationBase/activateAutoConfirm
|
||||
|
||||
=== Implementation notes
|
||||
|
||||
The device can use this resource to activate auto-confirmation. As a result all current active as well as future actions will automatically be confirmed by mentioning the initiator as triggered person. Actions will be automatically confirmed, as long as auto-confirmation is active.
|
||||
|
||||
=== Interface to activate auto-confirmation for a specific device
|
||||
|
||||
==== Curl
|
||||
|
||||
include::{snippets}/rootcontroller/activate-auto-confirmation/curl-request.adoc[]
|
||||
|
||||
==== Request URL
|
||||
|
||||
include::{snippets}/rootcontroller/activate-auto-confirmation/http-request.adoc[]
|
||||
|
||||
==== Request path parameter
|
||||
|
||||
include::{snippets}/rootcontroller/activate-auto-confirmation/path-parameters.adoc[]
|
||||
|
||||
==== Request fields
|
||||
|
||||
include::{snippets}/rootcontroller/activate-auto-confirmation/request-fields.adoc[]
|
||||
|
||||
=== Response (Status 200)
|
||||
|
||||
=== Error responses
|
||||
|
||||
|===
|
||||
| HTTP Status Code | Reason | Response Model
|
||||
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/409.adoc[]
|
||||
include::../errors/415.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
== POST /{tenant}/controller/v1/{controllerid}/confirmationBase/deactivateAutoConfirm
|
||||
|
||||
=== Implementation notes
|
||||
|
||||
The device can use this resource to deactivate auto-confirmation. All active actions will remain unchanged while all future actions need to be confirmed, before processing with the deployment.
|
||||
|
||||
=== Interface to deactivate auto-confirmation for a specific controller
|
||||
|
||||
==== Curl
|
||||
|
||||
include::{snippets}/rootcontroller/deactivate-auto-confirmation/curl-request.adoc[]
|
||||
|
||||
==== Request URL
|
||||
|
||||
include::{snippets}/rootcontroller/deactivate-auto-confirmation/http-request.adoc[]
|
||||
|
||||
==== Request path parameter
|
||||
|
||||
include::{snippets}/rootcontroller/deactivate-auto-confirmation/path-parameters.adoc[]
|
||||
|
||||
=== Response (Status 200)
|
||||
|
||||
=== Error responses
|
||||
|
||||
|===
|
||||
| HTTP Status Code | Reason | Response Model
|
||||
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/409.adoc[]
|
||||
include::../errors/415.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
== GET /{tenant}/controller/v1/{controllerid}/confirmationBase/{actionId}
|
||||
|
||||
=== Implementation notes
|
||||
|
||||
Resource to receive information about a pending confirmation.
|
||||
The response will be of the same format as the deploymentBase operation.
|
||||
The controller should provide feedback about the confirmation first, before processing the deployment.
|
||||
|
||||
Keep in mind that the provided download links for the artifacts are generated dynamically by the update server.
|
||||
Host, port and path are not guaranteed to be similar to the provided examples below but will be defined at runtime.
|
||||
|
||||
=== Confirmation status of an action
|
||||
|
||||
==== Curl
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-action/curl-request.adoc[]
|
||||
|
||||
==== Request URL
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-action/http-request.adoc[]
|
||||
|
||||
==== Request path parameter
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-action/path-parameters.adoc[]
|
||||
|
||||
==== Request query parameter
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-action/request-parameters.adoc[]
|
||||
|
||||
=== Response (Status 200)
|
||||
|
||||
==== Response fields
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-action/response-fields.adoc[]
|
||||
|
||||
==== Response example
|
||||
|
||||
The response body includes the detailed information about the action awaiting confirmation in the same format as for the deploymentBase operation.
|
||||
|
||||
include::{snippets}/rootcontroller/get-confirmation-base-action/http-response.adoc[]
|
||||
|
||||
=== Error responses
|
||||
|
||||
|===
|
||||
| HTTP Status Code | Reason | Response Model
|
||||
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404_target_action.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
== POST /{tenant}/controller/v1/{controllerid}/confirmationBase/{actionId}/feedback
|
||||
|
||||
=== Implementation notes
|
||||
|
||||
The device will use this resource to either confirm or deny an action which is waiting for confirmation. The action will be transferred into the RUNNING state in case the device is confirming it. Afterwards it will be exposed by the deploymentBase.
|
||||
|
||||
=== Feedback channel for actions waiting for confirmation
|
||||
|
||||
==== Curl
|
||||
|
||||
include::{snippets}/rootcontroller/post-confirmation-feedback/curl-request.adoc[]
|
||||
|
||||
==== Request URL
|
||||
|
||||
include::{snippets}/rootcontroller/post-confirmation-feedback/http-request.adoc[]
|
||||
|
||||
==== Request path parameter
|
||||
|
||||
include::{snippets}/rootcontroller/post-confirmation-feedback/path-parameters.adoc[]
|
||||
|
||||
==== Request fields
|
||||
|
||||
include::{snippets}/rootcontroller/post-confirmation-feedback/request-fields.adoc[]
|
||||
|
||||
=== Response (Status 200)
|
||||
|
||||
=== Error responses
|
||||
|
||||
|===
|
||||
| HTTP Status Code | Reason | Response Model
|
||||
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404_target_action.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/409.adoc[]
|
||||
include::../errors/410.adoc[]
|
||||
include::../errors/415.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
@@ -245,6 +245,152 @@ include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
|
||||
== GET /rest/v1/targets/{targetId}/autoConfirm
|
||||
|
||||
=== Implementation Notes
|
||||
|
||||
Handles the GET request to check the current auto-confirmation state of a target. Required Permission: READ_TARGET
|
||||
|
||||
=== Request auto-confirmation state for a specific target
|
||||
|
||||
==== Curl
|
||||
|
||||
include::{snippets}/targets/get-target-auto-confirm-state-active/curl-request.adoc[]
|
||||
|
||||
==== Request URL
|
||||
|
||||
include::{snippets}/targets/get-target-auto-confirm-state-active/http-request.adoc[]
|
||||
|
||||
==== Request path parameter
|
||||
|
||||
include::{snippets}/targets/get-target-auto-confirm-state-active/path-parameters.adoc[]
|
||||
|
||||
=== Response in case auto-confirmation is active (Status 200)
|
||||
|
||||
In case auto-confirmation is active, details like the initiator, remark and date of activation (as unix timestamp) will be provided. Reference links to switch the auto-confirmation state are exposed as well.
|
||||
|
||||
==== Response fields
|
||||
|
||||
include::{snippets}/targets/get-target-auto-confirm-state-active/response-fields.adoc[]
|
||||
|
||||
==== Response example
|
||||
|
||||
include::{snippets}/targets/get-target-auto-confirm-state-active/http-response.adoc[]
|
||||
|
||||
=== Response in case auto-confirmation is not active (Status 200)
|
||||
|
||||
The response body references a link to activate auto-confirmation.
|
||||
|
||||
==== Response fields
|
||||
|
||||
include::{snippets}/targets/get-target-auto-confirm-state-not-active/response-fields.adoc[]
|
||||
|
||||
==== Response example
|
||||
|
||||
include::{snippets}/targets/get-target-auto-confirm-state-not-active/http-response.adoc[]
|
||||
|
||||
=== Error responses
|
||||
|
||||
|===
|
||||
| HTTP Status Code | Reason | Response Model
|
||||
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
|
||||
== POST /rest/v1/targets/{targetId}/autoConfirm/activate
|
||||
|
||||
=== Implementation Notes
|
||||
|
||||
Handles the POST request to activate auto-confirmation for a specific target.
|
||||
As a result all current active as well as future actions will automatically be confirmed by mentioning the initiator as triggered person.
|
||||
Actions will be automatically confirmed, as long as auto-confirmation is active.
|
||||
Required Permission: UPDATE_TARGET
|
||||
|
||||
=== Activate auto-confirmation for a target
|
||||
|
||||
==== Curl
|
||||
|
||||
include::{snippets}/targets/post-activate-auto-confirm/curl-request.adoc[]
|
||||
|
||||
==== Request URL
|
||||
|
||||
include::{snippets}/targets/post-activate-auto-confirm/http-request.adoc[]
|
||||
|
||||
==== Request path parameter
|
||||
|
||||
include::{snippets}/targets/post-activate-auto-confirm/path-parameters.adoc[]
|
||||
|
||||
==== Request fields
|
||||
|
||||
include::{snippets}/targets/post-activate-auto-confirm/request-fields.adoc[]
|
||||
|
||||
=== Response (Status 200)
|
||||
|
||||
=== Error responses
|
||||
|
||||
|===
|
||||
| HTTP Status Code | Reason | Response Model
|
||||
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/409.adoc[]
|
||||
include::../errors/415.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
|
||||
== POST /rest/v1/targets/{targetId}/autoConfirm/deactivate
|
||||
|
||||
=== Implementation Notes
|
||||
|
||||
Handles the POST request to deactivate auto-confirmation for a specific target.
|
||||
All active actions will remain unchanged while all future actions need to be confirmed, before processing with the deployment.
|
||||
Required Permission: UPDATE_TARGET
|
||||
|
||||
=== Deactivate auto-confirmation for a target
|
||||
|
||||
==== Curl
|
||||
|
||||
include::{snippets}/targets/post-deactivate-auto-confirm/curl-request.adoc[]
|
||||
|
||||
==== Request URL
|
||||
|
||||
include::{snippets}/targets/post-deactivate-auto-confirm/http-request.adoc[]
|
||||
|
||||
==== Request path parameter
|
||||
|
||||
include::{snippets}/targets/post-deactivate-auto-confirm/path-parameters.adoc[]
|
||||
|
||||
=== Response (Status 200)
|
||||
|
||||
=== Error responses
|
||||
|
||||
|===
|
||||
| HTTP Status Code | Reason | Response Model
|
||||
|
||||
include::../errors/400.adoc[]
|
||||
include::../errors/401.adoc[]
|
||||
include::../errors/403.adoc[]
|
||||
include::../errors/404.adoc[]
|
||||
include::../errors/405.adoc[]
|
||||
include::../errors/406.adoc[]
|
||||
include::../errors/409.adoc[]
|
||||
include::../errors/415.adoc[]
|
||||
include::../errors/429.adoc[]
|
||||
|===
|
||||
|
||||
|
||||
== GET /rest/v1/targets/{targetId}/actions
|
||||
|
||||
=== Implementation Notes
|
||||
|
||||
Reference in New Issue
Block a user