feat(base): 添加邮箱注册码功能及用户注册接口

- 在 `sessionManager` 中新增邮件注册码缓存管理实例和相关方法
- 实现生成、保存、验证、删除邮件注册码的逻辑
- 新增 `/reg` 和 `/email` 接口用于用户注册和发送验证码
- 引入 `golang-lru` 依赖以支持限流缓存功能
- 调整包导入顺序,优化代码结构
```
This commit is contained in:
2025-11-04 11:44:07 +08:00
parent 689e7c51e2
commit 699db8406b
34 changed files with 4450 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
# Each line is a file pattern followed by one or more owners.
# More on CODEOWNERS files: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# Default owner
* @hashicorp/team-ip-compliance @hashicorp/raft-force
# Add override rules below. Each line is a file/folder pattern followed by one or more owners.
# Being an owner means those groups or individuals will be added as reviewers to PRs affecting
# those areas of the code.
# Examples:
# /docs/ @docs-team
# *.js @js-team
# *.go @go-team

View File

@@ -0,0 +1,36 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
commit-message:
prefix: "[chore] : "
groups:
actions:
patterns:
- "*"
- package-ecosystem: "gomod"
directories:
- "/"
- "/arc"
schedule:
interval: "weekly"
day: "sunday"
commit-message:
prefix: "[chore] : "
groups:
go:
patterns:
- "*"
applies-to: "version-updates"
go-security:
patterns:
- "*"
applies-to: "security-updates"

View File

@@ -0,0 +1,12 @@
<!-- heimdall_github_prtemplate:grc-pci_dss-2024-01-05 -->
## Description
<!-- Provide a summary of what the PR does and why it is being submitted. -->
## Related Issue
<!-- If this PR is linked to any issue, provide the issue number or description here. Any related JIRA tickets can also be added here. -->
## How Has This Been Tested?
<!-- Describe how the changes have been tested. Provide test instructions or details. -->

View File

@@ -0,0 +1,52 @@
name: build
on:
push:
branches: [main]
tags: ["*"]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: set up go 1.19
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: 1.19
id: go
- name: checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: build, test and generate coverage report
run: |
go test -timeout=60s -race -v ./... -coverprofile=coverage.out
go build -race ./...
- name: build and test ARC
working-directory: ./arc
run: |
go test -timeout=60s -race
go build -race
- name: Upload the coverage report
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
path: coverage.out
name: Coverage-report
- name: Display the coverage report
run: go tool cover -func=coverage.out
- name: install golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.53.3
- name: run golangci-lint
run: $GITHUB_WORKSPACE/golangci-lint run --out-format=github-actions ./... ./simplelru/... ./expirable/...
- name: run golangci-lint on ARC
working-directory: ./arc
run: $GITHUB_WORKSPACE/golangci-lint run --out-format=github-actions ./...

View File

@@ -0,0 +1,20 @@
name: Two-Stage PR Review Process
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled, ready_for_review, converted_to_draft]
pull_request_review:
types: [submitted]
jobs:
manage-pr-status:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.0.0
- name: Two stage PR review
uses: hashicorp/two-stage-pr-approval@v0.1.0