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

Issue 113: Make changes needed to successfully register deploy module. #123

Merged
merged 4 commits into from
Dec 13, 2023

Conversation

kaladay
Copy link

@kaladay kaladay commented Dec 12, 2023

resolves #113

Changes

Prepend 'camunda.' to each permission.

  • This gets the permissions structure to be compliant by having the module name as part of the permission name.
  • Without this, potential cross-module conflicts exist.

The provides dependencies are for individual module parts and not the entire module.
Change the behavior to use the individual mod-workflow parts as a dependency.

Remove mod-camunda from the context path.
Having mod-camunda in the context path is preventing proper deployment in OKAPI.

Local Deployment Test Process

This assumes proper login and other relating configuration.
This uses {{}} syntax to loosely represent variables.
Consider using the stripes-cli to perform the appropriate tasks.

  1. Make sure to start up a local docker or vagrant version of folio, like the FOLIO Nolana vagrant.
    For example, the OKAPI login using stripes-cli might look like this:
stripes okapi login diku_admin --okapi http://127.0.0.1:9130 --tenant diku
  1. Perform the appropriate maven packaging of the project.
  2. Spin up a local instance of mod-workflow, such as mvn spring-boot:run, java -jar ..., or an appropriate docker command.
  3. A POST request to {{okapi_url}}/_/proxy/modules in order to register the module.
    Make sure to use the build ModuleDescriptor.json as the payload body, generally found under service/target/.
  4. A POST request to {{okapi_url}}/_/discovery/modules.
    Rather than using the DeploymentDescriptor.json generally found under service/target/, use the following as the payload body.
{
  "srvcId": "mod-workflow-{{mod_workflow_version}}",
  "instId": "mod-workflow-{{mod_workflow_version}}",
  "url": "{{mod_workflow_url}}"
}

The {{mod_workflow_url}} in particular needs to point to an address of the locally running mod-workflow that the local FOLIO instance can access.
6. A POST request to {{okapi_url}}/_/proxy/tenants/{{tenant_name}}/modules, using the following as the body payload:

{
  "id": "mod-workflow-{{mod_workflow_version}}"
}

There may be permissions problems, in which case, they could be resolved using the stripes-cli. Example:

echo "okapi.proxy.modules.post" | stripes perm assign --okapi http://127.0.0.1:9130 --user diku_admin --tenant diku

To disable the module, a DELETE to {{okapi_url}}/_/proxy/tenants/{{tenant_name}}/modules/mod-workflow-{{mod_workflow_version}}.

To undeploy the module, a DELETE to {{okapi_url}}/_/discovery/modules/mod-workflow-{{mod_workflow_version}}.

This gets the permissions structure to be compliant by having the module name as part of the permission name.
Without this, potential cross-module conflicts exist.

This has a side-effect of `workflow.workflow.` as a permission.
The additional workflow represents the `workflow` path.
This is not removed to avoid potential naming conflicts as well.
…to one mapping of the id to permissions.

It simply makes more sense to use one to one mapping of the id to the permission.
If there is an 's' in the id, then use an 's' in the permission.
This is preventing proper deployment in OKAPI.
The `mod-camunda` path should probably also be removed from the OKAPI settings.
@kaladay kaladay marked this pull request as ready for review December 13, 2023 14:28
@kaladay kaladay linked an issue Dec 13, 2023 that may be closed by this pull request
@kaladay kaladay merged commit 664e40c into sprint13-staging Dec 13, 2023
@kaladay kaladay deleted the 113-register_deploy_folio-sprint_13 branch December 20, 2023 21:12
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.

Mod Workflow needs to be registered/deployed as a FOLIO module
2 participants