feat: refactor skill publish and add token auth support#27
Merged
shiyiyue1102 merged 2 commits intonacos-group:mainfrom Mar 20, 2026
Merged
Conversation
- Replace upload_skill/sync_skill with publish_skill command - Support both zip file and directory as skill source - Remove old skill sync logic (sync_skill.go, skill_syncer.go) - Add token-based authentication (--token flag) - Token takes priority over username/password - Token can be set via flag, config file, or env - Skip login when token is provided - Remove default nacos/nacos credentials - Username and password no longer default to 'nacos' - Empty credentials now result in explicit error - Pass token param to all NewNacosClient call sites
- Add AuthTypeNone ('none') as default when no credentials provided
- No login attempt, no auth header — suitable for public registries
- Auto-detect auth type: credentials → nacos, AK/SK → aliyun, token → token, else → none
- Make interactive prompts auth-optional
- Auth type default changed from 'nacos' to 'none'
- Selecting 'none' skips all credential prompts
- IsComplete/GetMissingFields treat 'none' as needing only host
- Improve HTTP error handling
- Add ParseHTTPError: 401/403/404/500 return user-friendly messages with hints
- All API methods use ParseHTTPError instead of raw status dumps
- Login failure is now a fatal error (was Warning + continue)
- Unify NewNacosClient call sites
- NewNacosClient returns (client, error) instead of client-only
- All cmd files use mustNewNacosClient() helper for consistent error exit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replace upload_skill/sync_skill with publish_skill command
Add token-based authentication (--token flag)
Remove default nacos/nacos credentials
Pass token param to all NewNacosClient call sites