You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
veypi 95c1f616be chore: bump version to v1.2.0 and update all docs
- Bump version from v1.1.1 to v1.2.0
- Add CHANGELOG.md summarizing 20 commits since v1.1.1
- Rewrite docs to match current code: Session auth, Require* APIs,
  nested config (db.dsn/db.type/jwt.*), Cookie-based token delivery
- Update method names uniformly: Perm* -> Require*
- Fix README license badge (Apache -> MIT), port and build commands
- Update auth design docs to reflect Provider + Auth SPI pattern
- Update CLAUDE.md with current architecture and directory structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 days ago
api feat(auth): replace user-level token version with session-based authentication 4 days ago
auth chore: bump version to v1.2.0 and update all docs 4 days ago
cfg docs(cfg): add usage tag for CookiePrefix config field 4 days ago
cli refactor(auth): Migrate token delivery to HttpOnly Cookie with version-based revocation 3 weeks ago
docs chore: bump version to v1.2.0 and update all docs 4 days ago
libs feat(auth): replace user-level token version with session-based authentication 4 days ago
models feat(auth): replace user-level token version with session-based authentication 4 days ago
scripts docs: Update documentation to reflect scoped RBAC and remove org system 3 months ago
tests chore: bump version to v1.2.0 and update all docs 4 days ago
ui feat(auth): replace user-level token version with session-based authentication 4 days ago
.gitignore chore(gitignore): Update ignore rules 4 months ago
CHANGELOG.md chore: bump version to v1.2.0 and update all docs 4 days ago
CLAUDE.md chore: bump version to v1.2.0 and update all docs 4 days ago
LICENSE Initial commit 5 years ago
Makefile feat(auth): Improve OAuth callback and add memory cache fallback 3 months ago
README.md chore: bump version to v1.2.0 and update all docs 4 days ago
agents.md chore: bump version to v1.2.0 and update all docs 4 days ago
dev.yml rename to vbase 4 months ago
go.mod feat(auth): add SMS/email verification code support for registration 2 weeks ago
go.sum feat(auth): add SMS/email verification code support for registration 2 weeks ago
init.go chore: bump version to v1.2.0 and update all docs 4 days ago

README.md

VBase

Go Version License Framework

基于 Golang 的高性能身份认证与权限管理基础框架

快速开始核心特性集成指南API 文档架构设计


简介

VBase 是一个基于 Vigo 框架开发的高性能后端基础框架提供一套标准化的用户管理、作用域权限控制Scoped RBAC和 OAuth2 认证服务。支持 Session + JWT 双 Token 认证、Cookie 令牌传送和短信/邮箱验证码注册。可作为独立服务部署,也可作为基础库集成到你的 Go 项目中。

核心特性

  • 完整认证体系 — Session + JWTAccess + Refresh TokenHttpOnly Cookie / Header / Query 多通道传送
  • Scoped RBAC 权限控制 — 基于作用域Scope的角色访问控制支持多应用权限隔离
  • 层级权限管理 — 支持资源类型(奇数层)和实例(偶数层)的精细化权限控制
  • OAuth2 Provider — 完整的 OAuth2 服务端实现,支持第三方应用接入
  • 多因素认证 — 短信/邮箱验证码注册和验证
  • 多数据库支持 — SQLite默认、MySQL、PostgreSQL 自动适配
  • 嵌入式管理界面 — 基于 vhtml 的管理后台,开箱即用
  • API 文档 — 内置 /_api.json 接口文档端点
  • 高性能 — 基于洋葱模型中间件架构Redis 缓存 Session 验证

快速开始

安装

go get github.com/veypi/vbase

作为独立服务运行

# 克隆项目
git clone https://github.com/veypi/vbase.git
cd vbase

# 直接启动(默认 SQLite + 端口 4000
go run ./cli/*.go -p 4000

# 或使用 Makefile
make run

服务默认在 http://localhost:4000 启动,管理界面访问 /vb/ 路径API 文档访问 /_api.json

作为库集成

package main

import (
	"github.com/veypi/vbase"
	"github.com/veypi/vbase/cfg"
	"github.com/veypi/vigo"
)

func main() {
	app := vigo.New("myapp", vbase.Router, cfg.Global, vigo.WithInit(vbase.Init))
	panic(app.Run())
}

更多集成方式请参考 集成指南

项目结构

vbase/
├── api/           # REST API 接口层
│   ├── auth/      # 认证接口登录、注册、Token 刷新)
│   ├── oauth/     # OAuth2 Provider 接口
│   ├── role/      # 角色管理
│   ├── user/      # 用户管理
│   ├── settings/  # 系统设置接口
│   └── verification/ # 验证码接口
├── auth/          # 核心权限控制模块Scoped RBAC + Session 管理)
├── cfg/           # 配置管理
├── cli/           # 命令行入口
├── models/        # 数据模型GORM
├── ui/            # 前端管理界面vhtml
└── docs/          # 文档