Skip to content

Implement common processing to extract tenant/env/user info from API key #73

@takashi-uchida

Description

@takashi-uchida

Summary

Implement common processing functionality in the SaaSus Platform Java SDK to
extract tenantId, envId, and userId from API keys and pass class information to
methods. This will allow each method to access the desired information as
needed.

Current State

The current Java SDK implementation in
src/main/java/saasus/sdk/util/apiserver/ApiServer.java does not provide a
standardized way to extract and utilize tenant, environment, and user
information from API keys across different methods.

Proposed Implementation

Goals

  1. Create a common processing mechanism to parse API keys and extract:
    • tenantId
    • envId
    • userId
  2. Implement a way to pass class/context information to methods
  3. Allow individual methods to selectively use the information they need

Technical Requirements

  • Maintain backward compatibility with existing API calls
  • Provide a clean, reusable interface for accessing extracted information
  • Follow Java SDK conventions and patterns used in other SaaSus SDKs
  • Ensure thread-safety for concurrent usage

Acceptance Criteria

  • Common utility class/methods for API key parsing
  • Context object to hold extracted tenant/env/user information
  • Integration with existing ApiServer class
  • Unit tests for the new functionality
  • Documentation and usage examples
  • Verification that existing functionality remains unchanged

References

  • Target file: src/main/java/saasus/sdk/util/apiserver/ApiServer.java
  • Related to SaaSus Platform multi-tenancy architecture

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions