Uploaded image for project: 'mod-entities-links'
  1. mod-entities-links
  2. MODELINKS-16

Link update: Implement mechanism of system user creation

    XMLWordPrintable

Details

    • Spitfire Sprint 152
    • 5
    • Spitfire
    • Orchid (R1 2023)

    Description

      Purpose/Overview:

      Updation of MARC Bib fields controlled by related Authority records will be implemented by using Kafka messaging interaction. To perform required calls to other Folio modules while the incoming Kafka message is processing there is required to have system user with a pre-defined list of permissions. 

      Requirements/Scope:

      1. Mechanism of system user (for each tenant) creation on module enabling should be implemented
      2. User data:
        • username: mod-entities-links
        • password: mod-entities-links
        • lastname: System
        • list of permissions:
          • TBD
      3. It should be able to define the system user's password via ENV variables.
      4. List of user permissions should be easy extendable.

      Approach:

      1. In `afterTenantUpdate` method of the module's TenantService implement logic of system user creation. 
      2. The logic of user creation:
        1. check if the user with provided username already exists in the system (GET /users endpoint with CQL-query: "username==<username>"
        2. If yes then update user's permissions:
          1. get existed user's permissions (GET /perms/users/<userId>/permissions?indexField=userId
          2. Verify that all required permissions are in place
          3. If not then update permissions (POST /perms/users/<userId>/permissions?indexField=userId
        3. If no:
          1. Create the user (POST /users)
          2. Save user's credentials (POST /authn/credentials)
          3. Create user's permissions (POST /perms/users)
      3. Implement mechanism of user authetication (POST /authn/login)
      4. Store user credentials in local cache

      Acceptance criteria:

      • For each tenant enabling system user is created
      • Covered by unit tests
      • Module documentation updated
      • Logging is well-defined

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                psmagin Pavlo Smahin
                psmagin Pavlo Smahin
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases