fix(toolbox-core): Expose authorization token requirements on ToolboxTool
#294
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR exposes the authorization token requirements from the
ToolboxTool
class by promoting the internal list of required authorization tokens to a read-only property.Motivation
Currently, the list of authorization services that a tool requires is stored as a private attribute within the
ToolboxTool
instance. This encapsulation makes it difficult for external wrapper classes or orchestration layers to programmatically inspect a tool and determine its authentication needs.The ultimate goal, which will be implemented in a future PR (#291), is to enable self-authenticated tools. This feature requires the ability for
toolbox-langchain
wrapper to introspect a tool instance, identify its authorization requirements, and potentially manage the token acquisition lifecycle automatically. Currently we only expose authentication requirements, that is a map of parameter names to the corresponding applicable authentication services.This PR is the necessary first step, providing a clean and stable public API to access this information.
Changes Proposed
required_authz_tokens
, has been added to theToolboxTool
class.('my-auth-service', 'another-service')
) required by the tool.ToolboxTool
core class, avoiding the need to access private (__ToolboxTool_
) attributes.Note
This change is non-breaking and purely additive.