jumpaccess

package module
v0.1.0-beta.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

JumpAccess

JumpAccess 是一个面向 JumpServer 的独立访问工具项目。项目包含 Go 编写的命令行程序 jumpctl,以及基于 Wails 2、React 和 TypeScript 的桌面 GUI;两个入口复用同一套领域与连接核心。

项目当前处于首个可用版本的开发阶段。CLI 的配置、Profile、Alias、OAuth Token 生命周期、JumpServer 连接准备 API、直接 SSH 和通用 ProxyCommand 已经实现;GUI 已实现 Profile/Organization 切换、分页资产与 Alias 管理、手工 OAuth 回调、统一主题设置、浏览器式可恢复 Tab 工作区和多 xterm SSH 会话。Windows 使用自绘标题栏,macOS 保留原生 traffic lights。真实 JumpServer 已确认接受官方 jms://auth/callback 而拒绝未登记的 loopback Redirect URI;完整 Token 交换、SSH 链路与 macOS 原生环境仍需 smoke test。实际状态以代码、测试和发布说明为准。

项目目标

  • 不依赖 JumpServer 桌面 Client,独立完成浏览器 OAuth 登录和 Token 生命周期管理。
  • 以 SSH 客户端方式直接连接远程 Asset。
  • 作为通用 SSH ProxyCommand 被兼容的终端或 SSH 客户端调用,不与某个具体终端产品耦合。
  • 通过 TOML 管理多个 JumpServer Profile 以及 Asset 别名等非敏感配置。
  • 支持 Windows 和 macOS,并以仅当前用户可访问的 Profile 独立文件保存 OAuth Token。

首个兼容性参考基线是 JumpServer Client v4.1.6 所使用的协议和接口。它是分析参考,不表示本项目依赖该桌面 Client 才能运行。

开发环境与当前状态

项目已经建立 Go 工程、jumpctl 与 jumpaccess 入口、TOML 配置、Profile、Alias、浏览器 OAuth 登录、文件凭据存储、并发安全的 Token 刷新、JumpServer 连接准备协议、直接 SSH 客户端、多会话桌面终端,以及基于本地 SSH server façade 的通用 ProxyCommand。

当前已经确定的 Go module 路径为:

github.com/cmstar/jumpaccess

环境要求:Go 1.25 或更高版本。

本地运行、测试与构建

go run ./cmd/jumpctl --help
go test ./...
go vet ./...
go build -trimpath ./cmd/jumpctl

cd cmd/jumpaccess
npm test
wails dev
wails build

发布或人工验收桌面程序时应使用 wails build。Windows 下的 -nopackage 会跳过平台资源生成,产出的裸 EXE 不包含应用图标和版本资源。

当前已经实现的配置入口包括:

jumpctl version
jumpctl licenses
jumpctl config path
jumpctl config edit
jumpctl config validate
jumpctl profile add <name> --url <site>
jumpctl profile update <name> --url <site>
jumpctl profile delete <name>
jumpctl profile list
jumpctl profile use <name>
jumpctl alias set <name> --asset <asset> [--account <account>] [--organization <org>]
jumpctl alias list
jumpctl auth login [--profile <name>] [--manual]
jumpctl auth status [--profile <name>]
jumpctl auth refresh [--profile <name>]
jumpctl auth logout [--profile <name>]
jumpctl organization list [--profile <name>]
jumpctl asset list [--profile <name>] [--organization <org>] [--search <text>] [--offset <count>] [--limit <count>]
jumpctl account list <asset> [--profile <name>] [--organization <org>]
jumpctl ssh <target> [--profile <name>] [--organization <org>] [--account <account>]
jumpctl proxy <target> [--profile <name>] [--organization <org>] [--account <account>]

通用 OpenSSH 配置示例(web 可以是已绑定唯一 Asset 和 Account 的 Alias):

Host production-web
    HostName web
    User jumpaccess
    ProxyCommand jumpctl proxy %h

当前开发版本的 auth login 默认使用手工回调:浏览器完成授权后,不要点击确认页的“确认”,而是复制页面中的 jms:// 链接或浏览器地址栏的完整确认页 URL,粘贴到等待中的终端。--manual 可显式固定这一行为。正式发布后计划注册 jms 私有协议并默认自动接收回调,但永久保留 --manual,供官方客户端仍占用协议或系统不允许注册协议时使用。

proxy 模式不打开浏览器,也不提示选择 Account。缺少登录、Refresh Token 失效、目标或 Account 不唯一、上游主机尚未信任时,进程会在 SSH banner 之前失败,只向 stderr 写入可操作错误并返回非零状态。先运行 jumpctl auth login 完成授权;未知上游 gateway 需要先用 jumpctl ssh 进行一次人工指纹确认。

安全说明

不要把账号密码、Access Token、Refresh Token、Cookie、私钥或其他真实凭据写入仓库。真实 JumpServer 账号只用于开发者本机的手工 smoke test;常规自动化测试应使用模拟服务和脱敏 fixture。

OAuth 凭据以每个 Profile 一个 JSON 文件的方式保存在应用目录的 credentials 子目录。文件名由 Profile 标识稳定派生,不直接使用或改写 Profile 名;Windows 使用仅当前用户和 SYSTEM 可访问的受保护 DACL,macOS 使用当前用户所有的 0700 目录和 0600 文件。文件内容包含 Access Token 和 Refresh Token,应像 SSH 私钥一样保护,不能复制、同步或提交到仓库。

Windows Credential Manager 或 macOS Keychain 仅用于保存 ProxyCommand façade 的稳定 Ed25519 host key,不参与 OAuth Token 的读取或写入;包含 macOS Keychain 后端的正式构建需要启用 CGO 并链接系统 Security framework。

首次直接连接某个 JumpServer SSH gateway 时,jumpctl ssh 会显示 SHA-256 主机密钥指纹并要求明确确认;信任记录保存在同一 JumpAccess 应用目录的 known_hosts。主机密钥变化不会自动接受。

ProxyCommand 存在两层独立的主机信任:外部 SSH 客户端看到的是 JumpAccess 本地 façade 的稳定 Ed25519 host key,该私钥保存在操作系统凭据存储;JumpAccess 自己仍使用上述 known_hosts 严格验证上游 JumpServer gateway。

文档

发布

推送符合 vX.Y.Z 或 vX.Y.Z-prerelease 的 Git tag 会触发 Release 工作流。工作流先运行 Go、React 和发布脚本检查,再在 GitHub 托管的 Windows、macOS runner 上原生构建;只有全部目标成功,才会生成 Release Notes、SHA-256 校验文件并发布 GitHub Release。预发布标签会自动标记为 prerelease。

git tag v0.1.0
git push origin v0.1.0

正式产物包括 Windows amd64 的 CLI/GUI ZIP、macOS amd64 与 arm64 的 CLI tar.gz,以及 macOS Universal GUI ZIP。Windows ZIP 内的程序保持稳定名称 jumpctl.exe 和 jumpaccess.exe;归档同时包含可直接阅读的 LICENSE 与 THIRD-PARTY-NOTICES.txt。jumpctl 和桌面 GUI 也继续内嵌这些许可材料,CLI 可通过 jumpctl licenses 查看,GUI 可在设置底部查看。

版本标签是发布版本的唯一来源。工作流通过 Go linker 注入 CLI/GUI 显示版本,并只在临时 runner 工作副本中更新 Wails 产品元数据,不需要为每次发布提交版本文件改动。当前 Windows 可执行文件尚未进行 Authenticode 签名,macOS 可执行文件尚未进行 Developer ID 签名与 Apple notarization;首次运行时操作系统可能显示安全提示。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Licenses

func Licenses() string

Licenses returns the project license followed by all notices required for third-party software compiled into jumpctl.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL