RapL Documentation

website·Indexed 30 days ago

https://d3l2gm9rt6yqjg.cloudfront.net

Technical documentation for RapL, featuring the RapL Genie Internal API v1.0 for chat session management, task management workflows, and administrative guides. Includes details on role-privilege matrices, workspace configurations, audit logs, and organization settings.

Tokens
24K
Snippets
97
Records
135
Agent score
50%

What's inside RapL

  1. Understand Workspace functionality and controls

    A Workspace is a dedicated area for a group of people (e.g., Product team, Sales team) and the content they manage. Each supported content item belongs to exactly one Workspace.

    A Workspace controls:

    • Content ownership (which Workspace owns a content item).
    • Visibility and edit permissions for administrators and authors.
    • Availability of Craft and Genie for that Workspace.
    • Which users can query the Workspace via Genie.
    • Whether supported content can be reused across Workspaces.

    Important: Workspaces do NOT control learner access. Learner assignments, release rules, monitoring, and exports continue to use their existing access rules.

  2. Understand Task Management constraints and lifecycle

    Task management follows these core constraints:

    • No Translations: Task titles and descriptions are stored as entered and are not translated.
    • One-to-One Assignment: Each task can have only one assignee.
    • Lifecycle States: Tasks move through three primary states: YET_TO_START, IN_PROGRESS, and COMPLETED.
  3. Manage conversation access and workspace modes

    Conversations must maintain a consistent access mode established by the first message. The two supported modes are:

    1. SELECTED_WORKSPACE: Associated with one specific Workspace ID.
    2. ALL_QUERYABLE: No specific selected ID.

    If a request attempts to change the mode within the same conversation, return a 409 Conflict.

    Permission Validation Rules:

    • Validate query permissions on every request. If a SELECTED_WORKSPACE is no longer allowed, set the conversation to read-only.
    • In ALL_QUERYABLE mode, maintain previous context but restrict new searches to the currently allowed list.
    • Before loading history, verify conversation ownership. Source details require current query permission; if a source lacks a saved Workspace ID, attempt to find one unambiguous matching knowledge item in the same organization to verify permission. If unsuccessful, mark the source as unavailable.
    • Guest session UUIDs can only resume guest conversations within the same organization, provided the organization still meets guest access requirements.
  4. Implement Guest Chat workspace access validation

    For guest chat, Genie validates access by first retrieving the Core organisation ID from the guest domain and checking CHATBOT_GUEST_ACCESS. It then calls the guest access endpoint using the org_id and a Core service token (no user ID is required). Core verifies that the organisation is active and that a Default Workspace exists with Genie enabled. If successful, only the returned workspace_id is searchable; guests cannot select other workspaces or manage knowledge. If the Default Workspace is unavailable, Core returns a 409 error.
  5. Manage Organisation password policy

    The password_policy setting controls password length, character requirements, and zxcvbn strength checks.

    Constraints & Behavior:

    • zxcvbn Strength: Scores range from 1 to 4. Score 0 is not supported. A score of 2 is the default for non-privileged users, but passwords resembling common patterns are still rejected.
    • Contextual Checks: Passwords may be rejected if they contain contextual values like the user's name, email, or organisation details, even if they meet length/character requirements.
    • Privileged Accounts: Organisation and RapL Admins use the privileged_min_strength_score threshold.
    • Updates: Every update must include all eight policy fields.

    Policy Fields:

    • min_length (Integer): Min 6, max max_length. Default: 6.
    • max_length (Integer): Min min_length, max 512. Default: 512.
    • require_uppercase (Boolean): Default: false.
    • require_lowercase (Boolean): Default: false.
    • require_number (Boolean): Default: false.
    • require_special (Boolean): Default: false.
    • min_strength_score (Integer): zxcvbn score (1-4) for non-privileged users. Default: 2.
    • privileged_min_strength_score (Integer): zxcvbn score (1-4); must be $\ge$ min_strength_score. Default: 3.
    // Update example: value must be a serialized JSON string
    {
      "settings": [
        {
          "property": "password_policy",
          "value": "{\"min_length\":8,\"max_length\":128,\"require_uppercase\":true,\"require_lowercase\":true,\"require_number\":true,\"require_special\":false,\"min_strength_score\":2,\"privileged_min_strength_score\":3}"
        }
      ]
    }
    
    // Reset to default example
    {
      "settings": [
        {
          "property": "password_policy",
          "reset_to_default": true
        }
      ]
    }
  6. Handle Workspace permissions for Knowledge Management

    For administrative operations, use the manageable_workspace_ids list. Every read or change must be restricted to the user's organization and the allowed Workspace.
    Request SpecificationGenie Action
    No workspace_id (creating knowledge/listing Default)Check default_workspace_id. If null $\rightarrow$ return 409. If ID is missing from manageable list $\rightarrow$ return 403. Otherwise, use Default Workspace.
    Specific workspace_id (e.g., 22)Verify ID 22 is in the manageable list. If missing $\rightarrow$ return 403. Otherwise, use Workspace 22.
    Existing knowledge itemVerify the Workspace ID saved on the item is in the manageable list.
  7. Log user actions using AuditLogService

    The AuditLogService in the RapL application provides a static method initiate() to record user activity, such as data modifications or system configuration changes. This service does not require Dependency Injection (DI) and can be called statically. To complete the logging process, you must chain the initiate() call with the logAudit() method.

    The initiate() method requires two mandatory parameters:

    1. Audit Action: An instance of AuditActionInterface specifying the action being performed (e.g., UserAuditAction::USER_CREATED).
    2. Target: The Model instance being impacted by the action (e.g., the specific User or Topic model being edited).
    AuditLogService::initiate(UserAuditAction::USER_CREATED, $user)->logAudit();
  8. Insert images into task descriptions

    Task images must be uploaded as assets before being referenced in a task description. Images must be no larger than 20 MB and use a configured image MIME type.
    # 1. Upload image (multipart/form-data with 'file' field)
    curl -X POST -F "file=@/path/to/image.png" https://api.example.com/tasks/assets/image
    # Returns: { "asset_id": "12345" }
    
    # 2. Reference the asset in the task description using the marker
    # Description: "Please review the diagram {{img:12345}}"
    
    # 3. Create or update the task via POST /tasks or PATCH /tasks/{task_id}
  9. Validate Workspace permissions using Core endpoints

    Genie must verify permissions via Core before allowing users to search or manage knowledge. There are two primary permission types:

    1. Query Access: Allows users to search knowledge in chat and view sources.
    2. Management Access: Allows users to list, add, update, delete, reprocess, or download knowledge via admin APIs.

    For every operation, Genie must retrieve the matching permission list from Core and verify the Workspace ID against that list.

  10. Administer Workspaces based on organisation roles

    Only users with the organisation roles AUTHOR, ORG_ADMIN, or RAPL_ADMIN can use Workspace administration features:

    • ORG_ADMIN and RAPL_ADMIN: Can see and manage every active Workspace in the organisation.
    • AUTHOR: Can manage the default Workspace. To manage any other Workspace, they must be explicitly added as a member.
    • Other roles: Do not gain administration access through Workspace membership.
  11. Handle Workspace permissions for Chat and Sources

    For new chats, use the queryable_genie_workspace_ids list to determine search scope. The conversation mode and selected ID should be saved to the conversation to maintain consistency across subsequent messages.
    User ChoiceGenie Action
    No WorkspaceStart ALL_QUERYABLE conversation. Search only Workspaces in the list. If list is empty, do not search. Do not fallback to Default Workspace.
    Specific Workspace (e.g., ID 22)Verify ID 22 is in the list. If yes, start SELECTED_WORKSPACE conversation. If no, return 403.
    Default WorkspaceUse default_workspace_id (if not null). Verify it is in the queryable list before searching.
  12. Clone content into a different Workspace

    Clone operations for Topics, Assessments, Paths, Files, Surveys, Polls, Assignments, Feedback Templates, Certificate Templates, and Scenarios support an optional workspace_id to define the clone's owner.

    • If workspace_id is provided: The user must be able to manage both the source content and the destination Workspace.
    • If workspace_id is omitted or null: The clone inherits the Workspace of the source content.