Skip to content

feat: refactor skill publish and add token auth support#27

Merged
shiyiyue1102 merged 2 commits intonacos-group:mainfrom
Sunrisea:feat/skill-publish-and-token-auth
Mar 20, 2026
Merged

feat: refactor skill publish and add token auth support#27
shiyiyue1102 merged 2 commits intonacos-group:mainfrom
Sunrisea:feat/skill-publish-and-token-auth

Conversation

@Sunrisea
Copy link
Member

  • 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

- 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
@shiyiyue1102 shiyiyue1102 merged commit 5238c44 into nacos-group:main Mar 20, 2026
2 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