Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace email and error message #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Environment Variables
| VALIDATE_EMAIL_WHITELIST | | | use ',' to separate emails; the emails in it will not be checked for year vs. suffix |
| EMAIL_SERVER_NO_REPLY_URL | | | required in "production" mode; if not set, unable to send verification email |
| EMAIL_DOMAIN | | | required in "production" mode; if not set, unable to send verification email |
| EMAIL_DEV | dev@fduhole.com | | send email if shamir update failed |
| EMAIL_DEV | dev@danta.tech | | send email if shamir update failed |
| SHAMIR_FEATURE | true | | if enabled, check email shamir encryption when users register and login |
| STANDALONE | false | | if not set, this application not required to set KONG_URL |
| VERIFICATION_CODE_EXPIRES | 10 | integers | register verification code expiration time |
Expand Down
2 changes: 1 addition & 1 deletion apis/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func Index(c *fiber.Ctx) error {
Homepage: "https://github.com/opentreehole",
Repository: "https://github.com/OpenTreeHole/auth_next",
Author: "JingYiJun",
Email: "dev@fduhole.com",
Email: "dev@danta.tech",
License: "Apache-2.0",
})
}
20 changes: 10 additions & 10 deletions apis/shamir.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func GetPGPMessageByUserID(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can get pgp message")
return common.Forbidden("only shamir admin can get pgp message")
}

// get target user id
Expand Down Expand Up @@ -109,7 +109,7 @@ func ListPGPMessages(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can get pgp message")
return common.Forbidden("only shamir admin can get pgp message")
}

// list pgp messages
Expand Down Expand Up @@ -157,7 +157,7 @@ func UploadAllShares(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can upload shares")
return common.Forbidden("only shamir admin can upload shares")
}

// lock
Expand Down Expand Up @@ -219,7 +219,7 @@ func UploadPublicKey(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can upload public keys")
return common.Forbidden("only shamir admin can upload public keys")
}

GlobalUploadShamirStatus.Lock()
Expand Down Expand Up @@ -276,7 +276,7 @@ func GetShamirStatus(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can get shamir status")
return common.Forbidden("only shamir admin can get shamir status")
}

GlobalUploadShamirStatus.Lock()
Expand All @@ -303,7 +303,7 @@ func UpdateShamir(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can update shamir")
return common.Forbidden("only shamir admin can update shamir")
}

GlobalUploadShamirStatus.Lock()
Expand Down Expand Up @@ -345,7 +345,7 @@ func RefreshShamir(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can refresh shamir")
return common.Forbidden("only shamir admin can refresh shamir")
}

GlobalUploadShamirStatus.Lock()
Expand Down Expand Up @@ -602,7 +602,7 @@ func UploadUserShares(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can upload user shares")
return common.Forbidden("only shamir admin can upload user shares")
}

GlobalUserSharesStatus.Lock()
Expand Down Expand Up @@ -651,7 +651,7 @@ func GetDecryptedUserEmail(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can decrypt email")
return common.Forbidden("only shamir admin can decrypt email")
}

// get target user id
Expand Down Expand Up @@ -716,7 +716,7 @@ func GetDecryptStatusbyUserID(c *fiber.Ctx) error {
}

if !IsShamirAdmin(userID) {
return common.Forbidden("only admin can get decrypt status")
return common.Forbidden("only shamir admin can get decrypt status")
}

// get target user id
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var Config struct {
ValidateEmailWhitelist []string
EmailServerNoReplyUrl url.URL `env:"EMAIL_SERVER_NO_REPLY_URL"`
EmailDomain string
EmailDev string `envDefault:"dev@fduhole.com"`
EmailDev string `envDefault:"dev@danta.tech"`
ShamirFeature bool `envDefault:"true"`
Standalone bool
VerificationCodeExpires int `envDefault:"10"`
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const docTemplate = `{
"contact": {
"name": "Maintainer Chen Ke",
"url": "https://danxi.fduhole.com/about",
"email": "dev@fduhole.com"
"email": "dev@danta.tech"
},
"license": {
"name": "Apache 2.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"contact": {
"name": "Maintainer Chen Ke",
"url": "https://danxi.fduhole.com/about",
"email": "dev@fduhole.com"
"email": "dev@danta.tech"
},
"license": {
"name": "Apache 2.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ definitions:
host: localhost:8000
info:
contact:
email: dev@fduhole.com
email: dev@danta.tech
name: Maintainer Chen Ke
url: https://danxi.fduhole.com/about
description: Next Generation of Auth microservice integrated with kong for registration
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// @contact.name Maintainer Chen Ke
// @contact.url https://danxi.fduhole.com/about
// @contact.email dev@fduhole.com
// @contact.email dev@danta.tech

// @license.name Apache 2.0
// @license.url https://www.apache.org/licenses/LICENSE-2.0.html
Expand Down
2 changes: 1 addition & 1 deletion utils/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func ValidateEmailFudan(email string) error {
}
emailSplit := strings.Split(email, "@")

const messageSuffix = `如果您的邮箱不满足此规则,可以尝试邮箱别名,或发送您的学邮和情况说明到 dev@fduhole.com ,我们为您手动处理`
const messageSuffix = `如果您的邮箱不满足此规则,可以尝试邮箱别名,或发送您的学邮和情况说明到 dev@danta.tech ,我们为您手动处理`

if emailSplit[1] == "fudan.edu.cn" {
if year >= 21 {
Expand Down