Interface IClientInfoPort

All Known Implementing Classes:
HttpRequestClientInfoAdapter, NoOpClientInfoPort, SpringSecurityClientInfoAdapter

public interface IClientInfoPort
Output port responsible for resolving who triggered the current method invocation.

This interface belongs to the framework-free core module and has no knowledge of how the caller is actually identified. Adapter modules resolve this using framework-specific facilities, for example Spring Security's Authentication for an authenticated user, or the current HTTP request for a client IP address when no user is authenticated. A no-op implementation is provided in this module so that the core can be used standalone, without any adapter.

Implementations must never return anything derived from request headers, cookies, or body content beyond a coarse identifier (a user id or an IP address). This port exists to answer "who called this", not to carry arbitrary request data into logs.

  • Method Summary

    Modifier and Type
    Method
    Description
    Resolves an identifier describing who triggered the current invocation.
  • Method Details

    • resolveCallerIdentity

      String resolveCallerIdentity()
      Resolves an identifier describing who triggered the current invocation.
      Returns:
      a caller identity such as "user:42" or "ip:203.0.113.10", or an implementation-defined placeholder such as "unknown" if no identity can be resolved