Skip to content

glzjin/lzc-uid-impersonation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lzc-uid-impersonation

English | 中文说明

中文说明

可以为请求添加懒猫微服应用免登的自定义用户ID(X-HC-User-ID)和角色头部(X-HC-User-Role)。

功能特点

  • 将请求转发到指定的目标URL
  • 自动添加 X-HC-User-ID 和 X-HC-User-Role 请求头
  • 支持通过命令行参数配置
  • 跨平台支持(Windows、macOS、Linux)

使用方法

# 使用默认配置运行
./lzc-uid-impersonation

# 自定义配置运行
./lzc-uid-impersonation -user testuser -role admin -target http://localhost:8080 -listen :8082

命令行参数

  • -user: 要模拟的用户名(默认值: "glzjin")
  • -role: 要模拟的角色(默认值: "ADMIN",将自动转换为大写)
  • -target: 要代理的目标URL(默认值: "http://127.0.0.1:8080")
  • -listen: 监听地址(默认值: ":8081")

下载

你可以从 Releases 页面下载最新版本。根据你的操作系统选择对应的版本:

  • Windows: lzc-uid-impersonation-windows-amd64.exe
  • Linux: lzc-uid-impersonation-linux-amd64
  • macOS Intel芯片: lzc-uid-impersonation-darwin-amd64
  • macOS Apple芯片: lzc-uid-impersonation-darwin-arm64

从源码编译

go build -o lzc-uid-impersonation main.go

English

A reverse proxy tool that adds custom user ID (X-HC-User-ID) and role headers (X-HC-User-Role) for LazyCat microservice application auto-login.

Features

  • Forwards requests to a specified target URL
  • Adds custom X-HC-User-ID and X-HC-User-Role headers
  • Configurable through command line arguments
  • Cross-platform support (Windows, macOS, Linux)

Usage

# Basic usage with default values
./lzc-uid-impersonation

# Custom configuration
./lzc-uid-impersonation -user testuser -role admin -target http://localhost:8080 -listen :8082

Command Line Arguments

  • -user: Username to impersonate (default: "glzjin")
  • -role: Role to impersonate (default: "ADMIN", will be converted to uppercase)
  • -target: Target URL to proxy to (default: "http://127.0.0.1:8080")
  • -listen: Address to listen on (default: ":8081")

Downloads

You can download the latest release from the Releases page. Choose the appropriate version for your platform:

  • Windows: lzc-uid-impersonation-windows-amd64.exe
  • Linux: lzc-uid-impersonation-linux-amd64
  • macOS Intel: lzc-uid-impersonation-darwin-amd64
  • macOS Apple Silicon: lzc-uid-impersonation-darwin-arm64

Building from Source

go build -o lzc-uid-impersonation main.go

About

懒猫微服UID模拟器

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages