Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove sensitive information from agent config toJSON() method #1112

Merged
12 changes: 10 additions & 2 deletions packages/core/src/agent/AgentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,16 @@ export class AgentConfig {
public toJSON() {
return {
...this.initConfig,
logger: this.logger !== undefined,
agentDependencies: this.agentDependencies != undefined,
walletConfig: {
...this.walletConfig,
key: this.walletConfig?.key ? '[omitted...]' : undefined,
storage: {
...this.walletConfig?.storage,
credentials: this.walletConfig?.storage?.credentials ? '[omitted...]' : undefined,
jimezesinachi marked this conversation as resolved.
Show resolved Hide resolved
},
},
logger: this.logger.logLevel,
agentDependencies: Boolean(this.agentDependencies),
label: this.label,
}
}
Expand Down