Skip to content

Commit 9423bd1

Browse files
authored
Merge pull request #31 from ppolariss/main
chore: replace email and error message
2 parents 05e47b6 + 61fcbb7 commit 9423bd1

9 files changed

Lines changed: 18 additions & 18 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Environment Variables
2626
| VALIDATE_EMAIL_WHITELIST | | | use ',' to separate emails; the emails in it will not be checked for year vs. suffix |
2727
| EMAIL_SERVER_NO_REPLY_URL | | | required in "production" mode; if not set, unable to send verification email |
2828
| EMAIL_DOMAIN | | | required in "production" mode; if not set, unable to send verification email |
29-
| EMAIL_DEV | dev@fduhole.com | | send email if shamir update failed |
29+
| EMAIL_DEV | dev@danta.tech | | send email if shamir update failed |
3030
| SHAMIR_FEATURE | true | | if enabled, check email shamir encryption when users register and login |
3131
| STANDALONE | false | | if not set, this application not required to set KONG_URL |
3232
| VERIFICATION_CODE_EXPIRES | 10 | integers | register verification code expiration time |

apis/default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func Index(c *fiber.Ctx) error {
2626
Homepage: "https://github.com/opentreehole",
2727
Repository: "https://github.com/OpenTreeHole/auth_next",
2828
Author: "JingYiJun",
29-
Email: "dev@fduhole.com",
29+
Email: "dev@danta.tech",
3030
License: "Apache-2.0",
3131
})
3232
}

apis/shamir.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func GetPGPMessageByUserID(c *fiber.Ctx) error {
5151
}
5252

5353
if !IsShamirAdmin(userID) {
54-
return common.Forbidden("only admin can get pgp message")
54+
return common.Forbidden("only shamir admin can get pgp message")
5555
}
5656

5757
// get target user id
@@ -109,7 +109,7 @@ func ListPGPMessages(c *fiber.Ctx) error {
109109
}
110110

111111
if !IsShamirAdmin(userID) {
112-
return common.Forbidden("only admin can get pgp message")
112+
return common.Forbidden("only shamir admin can get pgp message")
113113
}
114114

115115
// list pgp messages
@@ -157,7 +157,7 @@ func UploadAllShares(c *fiber.Ctx) error {
157157
}
158158

159159
if !IsShamirAdmin(userID) {
160-
return common.Forbidden("only admin can upload shares")
160+
return common.Forbidden("only shamir admin can upload shares")
161161
}
162162

163163
// lock
@@ -219,7 +219,7 @@ func UploadPublicKey(c *fiber.Ctx) error {
219219
}
220220

221221
if !IsShamirAdmin(userID) {
222-
return common.Forbidden("only admin can upload public keys")
222+
return common.Forbidden("only shamir admin can upload public keys")
223223
}
224224

225225
GlobalUploadShamirStatus.Lock()
@@ -276,7 +276,7 @@ func GetShamirStatus(c *fiber.Ctx) error {
276276
}
277277

278278
if !IsShamirAdmin(userID) {
279-
return common.Forbidden("only admin can get shamir status")
279+
return common.Forbidden("only shamir admin can get shamir status")
280280
}
281281

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

305305
if !IsShamirAdmin(userID) {
306-
return common.Forbidden("only admin can update shamir")
306+
return common.Forbidden("only shamir admin can update shamir")
307307
}
308308

309309
GlobalUploadShamirStatus.Lock()
@@ -345,7 +345,7 @@ func RefreshShamir(c *fiber.Ctx) error {
345345
}
346346

347347
if !IsShamirAdmin(userID) {
348-
return common.Forbidden("only admin can refresh shamir")
348+
return common.Forbidden("only shamir admin can refresh shamir")
349349
}
350350

351351
GlobalUploadShamirStatus.Lock()
@@ -602,7 +602,7 @@ func UploadUserShares(c *fiber.Ctx) error {
602602
}
603603

604604
if !IsShamirAdmin(userID) {
605-
return common.Forbidden("only admin can upload user shares")
605+
return common.Forbidden("only shamir admin can upload user shares")
606606
}
607607

608608
GlobalUserSharesStatus.Lock()
@@ -651,7 +651,7 @@ func GetDecryptedUserEmail(c *fiber.Ctx) error {
651651
}
652652

653653
if !IsShamirAdmin(userID) {
654-
return common.Forbidden("only admin can decrypt email")
654+
return common.Forbidden("only shamir admin can decrypt email")
655655
}
656656

657657
// get target user id
@@ -716,7 +716,7 @@ func GetDecryptStatusbyUserID(c *fiber.Ctx) error {
716716
}
717717

718718
if !IsShamirAdmin(userID) {
719-
return common.Forbidden("only admin can get decrypt status")
719+
return common.Forbidden("only shamir admin can get decrypt status")
720720
}
721721

722722
// get target user id

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var Config struct {
2424
ValidateEmailWhitelist []string
2525
EmailServerNoReplyUrl url.URL `env:"EMAIL_SERVER_NO_REPLY_URL"`
2626
EmailDomain string
27-
EmailDev string `envDefault:"dev@fduhole.com"`
27+
EmailDev string `envDefault:"dev@danta.tech"`
2828
ShamirFeature bool `envDefault:"true"`
2929
Standalone bool
3030
VerificationCodeExpires int `envDefault:"10"`

docs/docs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const docTemplate = `{
1212
"contact": {
1313
"name": "Maintainer Chen Ke",
1414
"url": "https://danxi.fduhole.com/about",
15-
"email": "dev@fduhole.com"
15+
"email": "dev@danta.tech"
1616
},
1717
"license": {
1818
"name": "Apache 2.0",

docs/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"contact": {
77
"name": "Maintainer Chen Ke",
88
"url": "https://danxi.fduhole.com/about",
9-
"email": "dev@fduhole.com"
9+
"email": "dev@danta.tech"
1010
},
1111
"license": {
1212
"name": "Apache 2.0",

docs/swagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ definitions:
392392
host: localhost:8000
393393
info:
394394
contact:
395-
email: dev@fduhole.com
395+
email: dev@danta.tech
396396
name: Maintainer Chen Ke
397397
url: https://danxi.fduhole.com/about
398398
description: Next Generation of Auth microservice integrated with kong for registration

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// @contact.name Maintainer Chen Ke
66
// @contact.url https://danxi.fduhole.com/about
7-
// @contact.email dev@fduhole.com
7+
// @contact.email dev@danta.tech
88

99
// @license.name Apache 2.0
1010
// @license.url https://www.apache.org/licenses/LICENSE-2.0.html

utils/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func ValidateEmailFudan(email string) error {
3737
}
3838
emailSplit := strings.Split(email, "@")
3939

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

4242
if emailSplit[1] == "fudan.edu.cn" {
4343
if year >= 21 {

0 commit comments

Comments
 (0)