java.lang.Object
org.miaixz.bus.vortex.magic.Principal
Represents an authentication token and its associated context. This class encapsulates all necessary information for
authorizing and processing a request, including the token string, the source channel, related resource
configurations, and transient runtime data like tenant ID and API key.
- Since:
- Java 17+
- Author:
- Justubborn
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AssetsContains configuration and information about the resources or "assets" associated with this token.protected IntegerAn integer identifier for the source channel of the request.protected StringThe identifier for the tenant in a multi-tenant architecture.protected Integer类型 1.token 2. apiKeyprotected String根据type确定是token还是apiKey -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
id
The identifier for the tenant in a multi-tenant architecture. This field is marked astransientto prevent it from being included in serialization, as it's typically used for runtime request routing and context, not for persistent state. -
type
类型 1.token 2. apiKey -
value
根据type确定是token还是apiKey -
channel
An integer identifier for the source channel of the request. This can be used to differentiate between various clients or platforms, such as a mobile app, web application, or third-party integrations (e.g., WeChat, DingTalk). It is a required, immutable field. -
assets
Contains configuration and information about the resources or "assets" associated with this token. This could include permissions, rate limits, or other service-specific settings. It is a required, immutable field.
-
-
Constructor Details
-
Principal
public Principal()
-