Record Class TokenAccessProfile
java.lang.Object
java.lang.Record
eu.mrapik.minecraftservermcp.config.TokenAccessProfile
- Record Components:
profileName- display name for thisaccess.*blocktoken- secret matched against HTTP headerstools- per-tool-id policies undertools
public record TokenAccessProfile(String profileName, String token, Map<String,ToolAccessConfig> tools)
extends Record
One named entry under
access in config.yml: a shared secret token and a map of
ToolAccessConfig keyed by MCP tool id.
The profile name is informational (logging, debugging). The token string is matched against the value extracted from
the HTTP request (see HttpTokenSupport).
-
Constructor Summary
ConstructorsConstructorDescriptionTokenAccessProfile(String profileName, String token, Map<String, ToolAccessConfig> tools) Canonical constructor; stores an unmodifiable copy oftools. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Config section name, e.g.token()Secret value clients must present; must match exactly (including no extra whitespace after trim in the HTTP layer).@NotNull ToolAccessConfigtoolConfig(String toolId) Returns the policy fortoolId, orToolAccessConfig.permissiveDefault()if the profile defines notools.<toolId>block.tools()Unmodifiable view of all configured tool sections for this profile.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TokenAccessProfile
Canonical constructor; stores an unmodifiable copy oftools.
-
-
Method Details
-
profileName
Config section name, e.g.admin.- Returns:
- profile key from config
-
token
Secret value clients must present; must match exactly (including no extra whitespace after trim in the HTTP layer).- Returns:
- raw token string
-
toolConfig
Returns the policy fortoolId, orToolAccessConfig.permissiveDefault()if the profile defines notools.<toolId>block.- Parameters:
toolId- MCP tool name (same asMcpToolDefinition.id())- Returns:
- effective tool policy
-
tools
Unmodifiable view of all configured tool sections for this profile.- Returns:
- map from tool id to policy
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object).
-