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: work js-api signature #818

Merged
merged 16 commits into from
Jan 14, 2025
Merged

fix: work js-api signature #818

merged 16 commits into from
Jan 14, 2025

Conversation

mahongran
Copy link
Contributor

No description provided.

mahongran and others added 12 commits January 3, 2025 14:13
…anagement

- Added AgentID field to WorkAccessToken struct.
- Updated NewWorkAccessToken function to accept AgentID as a parameter.
- Modified access token cache key to incorporate AgentID, ensuring unique cache entries per agent.

This change improves the handling of access tokens in a multi-agent environment.
- Updated the AgentID field in WorkAccessToken struct to clarify its optional nature for distinguishing applications.
- Modified the access token cache key construction to support both new and legacy formats based on the presence of AgentID.
- Added comments for better understanding of the cache key logic and its compatibility with historical versions.

This change improves the flexibility and clarity of access token management in multi-agent scenarios.
- Introduced a new JsSdk method in the Work struct to facilitate the creation of a Js instance.
- This addition enhances the functionality of the Work module by enabling JavaScript SDK support.

This change improves the integration capabilities for developers working with the WeChat Work API.
# Conflicts:
#	credential/default_access_token.go
# Conflicts:
#	credential/default_access_token.go
…entConfig methods

- Replaced the use of strconv to format the signature string with fmt.Sprintf for improved readability.
- Updated the signature generation logic in both GetConfig and GetAgentConfig methods to use a single formatted string.

This change enhances code clarity and maintains functionality in the signature generation process.
# Conflicts:
#	credential/default_access_token.go
# Conflicts:
#	credential/default_access_token.go
@mahongran
Copy link
Contributor Author

fmt 下面要加上空行才可以通过 check 好奇怪

@houseme
Copy link
Collaborator

houseme commented Jan 14, 2025

fmt 下面要加上空行才可以通过 check 好奇怪

是官方包、第三方包、项目包路径都是按组引入,中间使用空行分隔。

- Removed redundant initialization of the Config variable and ensured it is instantiated correctly before use.
- This change improves code clarity and maintains the intended functionality of the GetConfig method.
@houseme houseme merged commit 010e49c into silenceper:v2 Jan 14, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants