Skip to content

Commit aec35fb

Browse files
authored
Merge branch 'main' into fix-pr-manually-merged
2 parents 3cbc009 + 4fcf3a3 commit aec35fb

File tree

25 files changed

+173
-86
lines changed

25 files changed

+173
-86
lines changed

.github/pull_request_template.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<!--
2-
1+
<!-- start tips -->
32
Please check the following:
4-
5-
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for bug fixes.
6-
2. Read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md
7-
3. Describe what your pull request does and which issue you're targeting (if any)
8-
9-
-->
3+
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for backports.
4+
2. Make sure you have read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md .
5+
3. Describe what your pull request does and which issue you're targeting (if any).
6+
4. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
7+
5. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
8+
6. Delete all these tips before posting.
9+
<!-- end tips -->

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,43 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.18.4](https://github.com/go-gitea/gitea/releases/tag/1.18.4) - 2023-02-20
8+
9+
* SECURITY
10+
* Provide the ability to set password hash algorithm parameters (#22942) (#22943)
11+
* Add command to bulk set must-change-password (#22823) (#22928)
12+
* ENHANCEMENTS
13+
* Use import of OCI structs (#22765) (#22805)
14+
* Fix color of tertiary button on dark theme (#22739) (#22744)
15+
* Link issue and pull requests status change in UI notifications directly to their event in the timelined view. (#22627) (#22642)
16+
* BUGFIXES
17+
* Notify on container image create (#22806) (#22965)
18+
* Fix blame view missing lines (#22826) (#22929)
19+
* Fix incorrect role labels for migrated issues and comments (#22914) (#22923)
20+
* Fix PR file tree folders no longer collapsing (#22864) (#22872)
21+
* Escape filename when assemble URL (#22850) (#22871)
22+
* Fix isAllowed of escapeStreamer (#22814) (#22837)
23+
* Load issue before accessing index in merge message (#22822) (#22830)
24+
* Improve trace logging for pulls and processes (#22633) (#22812)
25+
* Fix restore repo bug, clarify the problem of ForeignIndex (#22776) (#22794)
26+
* Add default user visibility to cli command "admin user create" (#22750) (#22760)
27+
* Escape path for the file list (#22741) (#22757)
28+
* Fix bugs with WebAuthn preventing sign in and registration. (#22651) (#22721)
29+
* Add missing close bracket in imagediff (#22710) (#22712)
30+
* Move code comments to a standalone file and fix the bug when adding a reply to an outdated review appears to not post(#20821) (#22707)
31+
* Fix line spacing for plaintext previews (#22699) (#22701)
32+
* Fix wrong hint when deleting a branch successfully from pull request UI (#22673) (#22698)
33+
* Fix README TOC links (#22577) (#22677)
34+
* Fix missing message in git hook when pull requests disabled on fork (#22625) (#22658)
35+
* Improve checkIfPRContentChanged (#22611) (#22644)
36+
* Prevent duplicate labels when importing more than 99 (#22591) (#22598)
37+
* Don't return duplicated users who can create org repo (#22560) (#22562)
38+
* BUILD
39+
* Upgrade golangcilint to v1.51.0 (#22764)
40+
* MISC
41+
* Use proxy for pull mirror (#22771) (#22772)
42+
* Use `--index-url` in PyPi description (#22620) (#22636)
43+
744
## [1.18.3](https://github.com/go-gitea/gitea/releases/tag/v1.18.3) - 2023-01-23
845

946
* SECURITY

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ Xinyu Zhou <[email protected]> (@xin-u)
4848
Jason Song <[email protected]> (@wolfogre)
4949
Yarden Shoham <[email protected]> (@yardenshoham)
5050
Yu Tian <[email protected]> (@Zettat123)
51+
Eddie Yang <[email protected]> (@yp05327)

models/auth/token_scope.go

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,23 @@ var allAccessTokenScopeBits = map[AccessTokenScope]AccessTokenScopeBitmap{
168168

169169
// Parse parses the scope string into a bitmap, thus removing possible duplicates.
170170
func (s AccessTokenScope) Parse() (AccessTokenScopeBitmap, error) {
171-
list := strings.Split(string(s), ",")
172-
173171
var bitmap AccessTokenScopeBitmap
174-
for _, v := range list {
172+
173+
// The following is the more performant equivalent of 'for _, v := range strings.Split(remainingScope, ",")' as this is hot code
174+
remainingScopes := string(s)
175+
for len(remainingScopes) > 0 {
176+
i := strings.IndexByte(remainingScopes, ',')
177+
var v string
178+
if i < 0 {
179+
v = remainingScopes
180+
remainingScopes = ""
181+
} else if i+1 >= len(remainingScopes) {
182+
v = remainingScopes[:i]
183+
remainingScopes = ""
184+
} else {
185+
v = remainingScopes[:i]
186+
remainingScopes = remainingScopes[i+1:]
187+
}
175188
singleScope := AccessTokenScope(v)
176189
if singleScope == "" {
177190
continue
@@ -187,9 +200,15 @@ func (s AccessTokenScope) Parse() (AccessTokenScopeBitmap, error) {
187200
}
188201
bitmap |= bits
189202
}
203+
190204
return bitmap, nil
191205
}
192206

207+
// StringSlice returns the AccessTokenScope as a []string
208+
func (s AccessTokenScope) StringSlice() []string {
209+
return strings.Split(string(s), ",")
210+
}
211+
193212
// Normalize returns a normalized scope string without any duplicates.
194213
func (s AccessTokenScope) Normalize() (AccessTokenScope, error) {
195214
bitmap, err := s.Parse()

models/issues/issue.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,15 @@ func (issue *Issue) LoadPoster(ctx context.Context) (err error) {
251251

252252
// LoadPullRequest loads pull request info
253253
func (issue *Issue) LoadPullRequest(ctx context.Context) (err error) {
254-
if issue.IsPull && issue.PullRequest == nil {
255-
issue.PullRequest, err = GetPullRequestByIssueID(ctx, issue.ID)
256-
if err != nil {
257-
if IsErrPullRequestNotExist(err) {
258-
return err
254+
if issue.IsPull {
255+
if issue.PullRequest == nil {
256+
issue.PullRequest, err = GetPullRequestByIssueID(ctx, issue.ID)
257+
if err != nil {
258+
if IsErrPullRequestNotExist(err) {
259+
return err
260+
}
261+
return fmt.Errorf("getPullRequestByIssueID [%d]: %w", issue.ID, err)
259262
}
260-
return fmt.Errorf("getPullRequestByIssueID [%d]: %w", issue.ID, err)
261263
}
262264
issue.PullRequest.Issue = issue
263265
}
@@ -347,7 +349,7 @@ func (issue *Issue) LoadAttributes(ctx context.Context) (err error) {
347349
return
348350
}
349351

350-
if err = issue.loadProject(ctx); err != nil {
352+
if err = issue.LoadProject(ctx); err != nil {
351353
return
352354
}
353355

models/issues/issue_project.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ import (
1313
)
1414

1515
// LoadProject load the project the issue was assigned to
16-
func (issue *Issue) LoadProject() (err error) {
17-
return issue.loadProject(db.DefaultContext)
18-
}
19-
20-
func (issue *Issue) loadProject(ctx context.Context) (err error) {
16+
func (issue *Issue) LoadProject(ctx context.Context) (err error) {
2117
if issue.Project == nil {
2218
var p project_model.Project
2319
if _, err = db.GetEngine(ctx).Table("project").

modules/context/access_log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package context
66
import (
77
"bytes"
88
"context"
9-
"html/template"
109
"net/http"
10+
"text/template"
1111
"time"
1212

1313
"code.gitea.io/gitea/modules/log"

modules/setting/config_provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ func mustMapSetting(rootCfg ConfigProvider, sectionName string, setting interfac
2525
}
2626
}
2727

28-
func deprecatedSetting(rootCfg ConfigProvider, oldSection, oldKey, newSection, newKey string) {
28+
func deprecatedSetting(rootCfg ConfigProvider, oldSection, oldKey, newSection, newKey, version string) {
2929
if rootCfg.Section(oldSection).HasKey(oldKey) {
30-
log.Error("Deprecated fallback `[%s]` `%s` present. Use `[%s]` `%s` instead. This fallback will be removed in v1.19.0", oldSection, oldKey, newSection, newKey)
30+
log.Error("Deprecated fallback `[%s]` `%s` present. Use `[%s]` `%s` instead. This fallback will be/has been removed in %s", oldSection, oldKey, newSection, newKey, version)
3131
}
3232
}
3333

modules/setting/indexer.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ func loadIndexerFrom(rootCfg ConfigProvider) {
5656
Indexer.IssueIndexerName = sec.Key("ISSUE_INDEXER_NAME").MustString(Indexer.IssueIndexerName)
5757

5858
// The following settings are deprecated and can be overridden by settings in [queue] or [queue.issue_indexer]
59-
// FIXME: DEPRECATED to be removed in v1.18.0
60-
deprecatedSetting(rootCfg, "indexer", "ISSUE_INDEXER_QUEUE_TYPE", "queue.issue_indexer", "TYPE")
61-
deprecatedSetting(rootCfg, "indexer", "ISSUE_INDEXER_QUEUE_DIR", "queue.issue_indexer", "DATADIR")
62-
deprecatedSetting(rootCfg, "indexer", "ISSUE_INDEXER_QUEUE_CONN_STR", "queue.issue_indexer", "CONN_STR")
63-
deprecatedSetting(rootCfg, "indexer", "ISSUE_INDEXER_QUEUE_BATCH_NUMBER", "queue.issue_indexer", "BATCH_LENGTH")
64-
deprecatedSetting(rootCfg, "indexer", "UPDATE_BUFFER_LEN", "queue.issue_indexer", "LENGTH")
59+
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
60+
// if these are removed, the warning will not be shown
61+
deprecatedSetting(rootCfg, "indexer", "ISSUE_INDEXER_QUEUE_TYPE", "queue.issue_indexer", "TYPE", "v1.19.0")
62+
deprecatedSetting(rootCfg, "indexer", "ISSUE_INDEXER_QUEUE_DIR", "queue.issue_indexer", "DATADIR", "v1.19.0")
63+
deprecatedSetting(rootCfg, "indexer", "ISSUE_INDEXER_QUEUE_CONN_STR", "queue.issue_indexer", "CONN_STR", "v1.19.0")
64+
deprecatedSetting(rootCfg, "indexer", "ISSUE_INDEXER_QUEUE_BATCH_NUMBER", "queue.issue_indexer", "BATCH_LENGTH", "v1.19.0")
65+
deprecatedSetting(rootCfg, "indexer", "UPDATE_BUFFER_LEN", "queue.issue_indexer", "LENGTH", "v1.19.0")
6566

6667
Indexer.RepoIndexerEnabled = sec.Key("REPO_INDEXER_ENABLED").MustBool(false)
6768
Indexer.RepoType = sec.Key("REPO_INDEXER_TYPE").MustString("bleve")

modules/setting/lfs.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ func loadLFSFrom(rootCfg ConfigProvider) {
3535
storageType := lfsSec.Key("STORAGE_TYPE").MustString("")
3636

3737
// Specifically default PATH to LFS_CONTENT_PATH
38-
// FIXME: DEPRECATED to be removed in v1.18.0
39-
deprecatedSetting(rootCfg, "server", "LFS_CONTENT_PATH", "lfs", "PATH")
38+
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
39+
// if these are removed, the warning will not be shown
40+
deprecatedSetting(rootCfg, "server", "LFS_CONTENT_PATH", "lfs", "PATH", "v1.19.0")
4041
lfsSec.Key("PATH").MustString(
4142
sec.Key("LFS_CONTENT_PATH").String())
4243

modules/setting/mailer.go

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ func loadMailerFrom(rootCfg ConfigProvider) {
6464
}
6565

6666
// Handle Deprecations and map on to new configuration
67-
// FIXME: DEPRECATED to be removed in v1.19.0
68-
deprecatedSetting(rootCfg, "mailer", "MAILER_TYPE", "mailer", "PROTOCOL")
67+
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
68+
// if these are removed, the warning will not be shown
69+
deprecatedSetting(rootCfg, "mailer", "MAILER_TYPE", "mailer", "PROTOCOL", "v1.19.0")
6970
if sec.HasKey("MAILER_TYPE") && !sec.HasKey("PROTOCOL") {
7071
if sec.Key("MAILER_TYPE").String() == "sendmail" {
7172
sec.Key("PROTOCOL").MustString("sendmail")
7273
}
7374
}
7475

75-
// FIXME: DEPRECATED to be removed in v1.19.0
76-
deprecatedSetting(rootCfg, "mailer", "HOST", "mailer", "SMTP_ADDR")
76+
deprecatedSetting(rootCfg, "mailer", "HOST", "mailer", "SMTP_ADDR", "v1.19.0")
7777
if sec.HasKey("HOST") && !sec.HasKey("SMTP_ADDR") {
7878
givenHost := sec.Key("HOST").String()
7979
addr, port, err := net.SplitHostPort(givenHost)
@@ -89,8 +89,7 @@ func loadMailerFrom(rootCfg ConfigProvider) {
8989
sec.Key("SMTP_PORT").MustString(port)
9090
}
9191

92-
// FIXME: DEPRECATED to be removed in v1.19.0
93-
deprecatedSetting(rootCfg, "mailer", "IS_TLS_ENABLED", "mailer", "PROTOCOL")
92+
deprecatedSetting(rootCfg, "mailer", "IS_TLS_ENABLED", "mailer", "PROTOCOL", "v1.19.0")
9493
if sec.HasKey("IS_TLS_ENABLED") && !sec.HasKey("PROTOCOL") {
9594
if sec.Key("IS_TLS_ENABLED").MustBool() {
9695
sec.Key("PROTOCOL").MustString("smtps")
@@ -99,38 +98,32 @@ func loadMailerFrom(rootCfg ConfigProvider) {
9998
}
10099
}
101100

102-
// FIXME: DEPRECATED to be removed in v1.19.0
103-
deprecatedSetting(rootCfg, "mailer", "DISABLE_HELO", "mailer", "ENABLE_HELO")
101+
deprecatedSetting(rootCfg, "mailer", "DISABLE_HELO", "mailer", "ENABLE_HELO", "v1.19.0")
104102
if sec.HasKey("DISABLE_HELO") && !sec.HasKey("ENABLE_HELO") {
105103
sec.Key("ENABLE_HELO").MustBool(!sec.Key("DISABLE_HELO").MustBool())
106104
}
107105

108-
// FIXME: DEPRECATED to be removed in v1.19.0
109-
deprecatedSetting(rootCfg, "mailer", "SKIP_VERIFY", "mailer", "FORCE_TRUST_SERVER_CERT")
106+
deprecatedSetting(rootCfg, "mailer", "SKIP_VERIFY", "mailer", "FORCE_TRUST_SERVER_CERT", "v1.19.0")
110107
if sec.HasKey("SKIP_VERIFY") && !sec.HasKey("FORCE_TRUST_SERVER_CERT") {
111108
sec.Key("FORCE_TRUST_SERVER_CERT").MustBool(sec.Key("SKIP_VERIFY").MustBool())
112109
}
113110

114-
// FIXME: DEPRECATED to be removed in v1.19.0
115-
deprecatedSetting(rootCfg, "mailer", "USE_CERTIFICATE", "mailer", "USE_CLIENT_CERT")
111+
deprecatedSetting(rootCfg, "mailer", "USE_CERTIFICATE", "mailer", "USE_CLIENT_CERT", "v1.19.0")
116112
if sec.HasKey("USE_CERTIFICATE") && !sec.HasKey("USE_CLIENT_CERT") {
117113
sec.Key("USE_CLIENT_CERT").MustBool(sec.Key("USE_CERTIFICATE").MustBool())
118114
}
119115

120-
// FIXME: DEPRECATED to be removed in v1.19.0
121-
deprecatedSetting(rootCfg, "mailer", "CERT_FILE", "mailer", "CLIENT_CERT_FILE")
116+
deprecatedSetting(rootCfg, "mailer", "CERT_FILE", "mailer", "CLIENT_CERT_FILE", "v1.19.0")
122117
if sec.HasKey("CERT_FILE") && !sec.HasKey("CLIENT_CERT_FILE") {
123118
sec.Key("CERT_FILE").MustString(sec.Key("CERT_FILE").String())
124119
}
125120

126-
// FIXME: DEPRECATED to be removed in v1.19.0
127-
deprecatedSetting(rootCfg, "mailer", "KEY_FILE", "mailer", "CLIENT_KEY_FILE")
121+
deprecatedSetting(rootCfg, "mailer", "KEY_FILE", "mailer", "CLIENT_KEY_FILE", "v1.19.0")
128122
if sec.HasKey("KEY_FILE") && !sec.HasKey("CLIENT_KEY_FILE") {
129123
sec.Key("KEY_FILE").MustString(sec.Key("KEY_FILE").String())
130124
}
131125

132-
// FIXME: DEPRECATED to be removed in v1.19.0
133-
deprecatedSetting(rootCfg, "mailer", "ENABLE_HTML_ALTERNATIVE", "mailer", "SEND_AS_PLAIN_TEXT")
126+
deprecatedSetting(rootCfg, "mailer", "ENABLE_HTML_ALTERNATIVE", "mailer", "SEND_AS_PLAIN_TEXT", "v1.19.0")
134127
if sec.HasKey("ENABLE_HTML_ALTERNATIVE") && !sec.HasKey("SEND_AS_PLAIN_TEXT") {
135128
sec.Key("SEND_AS_PLAIN_TEXT").MustBool(!sec.Key("ENABLE_HTML_ALTERNATIVE").MustBool(false))
136129
}

modules/setting/mirror.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ var Mirror = struct {
2727
func loadMirrorFrom(rootCfg ConfigProvider) {
2828
// Handle old configuration through `[repository]` `DISABLE_MIRRORS`
2929
// - please note this was badly named and only disabled the creation of new pull mirrors
30-
// FIXME: DEPRECATED to be removed in v1.18.0
31-
deprecatedSetting(rootCfg, "repository", "DISABLE_MIRRORS", "mirror", "ENABLED")
30+
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
31+
// if these are removed, the warning will not be shown
32+
deprecatedSetting(rootCfg, "repository", "DISABLE_MIRRORS", "mirror", "ENABLED", "v1.19.0")
3233
if rootCfg.Section("repository").Key("DISABLE_MIRRORS").MustBool(false) {
3334
Mirror.DisableNewPull = true
3435
}

modules/setting/server.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,38 +178,40 @@ func loadServerFrom(rootCfg ConfigProvider) {
178178
switch protocolCfg {
179179
case "https":
180180
Protocol = HTTPS
181-
// FIXME: DEPRECATED to be removed in v1.18.0
181+
182+
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
183+
// if these are removed, the warning will not be shown
182184
if sec.HasKey("ENABLE_ACME") {
183185
EnableAcme = sec.Key("ENABLE_ACME").MustBool(false)
184186
} else {
185-
deprecatedSetting(rootCfg, "server", "ENABLE_LETSENCRYPT", "server", "ENABLE_ACME")
187+
deprecatedSetting(rootCfg, "server", "ENABLE_LETSENCRYPT", "server", "ENABLE_ACME", "v1.19.0")
186188
EnableAcme = sec.Key("ENABLE_LETSENCRYPT").MustBool(false)
187189
}
188190
if EnableAcme {
189191
AcmeURL = sec.Key("ACME_URL").MustString("")
190192
AcmeCARoot = sec.Key("ACME_CA_ROOT").MustString("")
191-
// FIXME: DEPRECATED to be removed in v1.18.0
193+
192194
if sec.HasKey("ACME_ACCEPTTOS") {
193195
AcmeTOS = sec.Key("ACME_ACCEPTTOS").MustBool(false)
194196
} else {
195-
deprecatedSetting(rootCfg, "server", "LETSENCRYPT_ACCEPTTOS", "server", "ACME_ACCEPTTOS")
197+
deprecatedSetting(rootCfg, "server", "LETSENCRYPT_ACCEPTTOS", "server", "ACME_ACCEPTTOS", "v1.19.0")
196198
AcmeTOS = sec.Key("LETSENCRYPT_ACCEPTTOS").MustBool(false)
197199
}
198200
if !AcmeTOS {
199201
log.Fatal("ACME TOS is not accepted (ACME_ACCEPTTOS).")
200202
}
201-
// FIXME: DEPRECATED to be removed in v1.18.0
203+
202204
if sec.HasKey("ACME_DIRECTORY") {
203205
AcmeLiveDirectory = sec.Key("ACME_DIRECTORY").MustString("https")
204206
} else {
205-
deprecatedSetting(rootCfg, "server", "LETSENCRYPT_DIRECTORY", "server", "ACME_DIRECTORY")
207+
deprecatedSetting(rootCfg, "server", "LETSENCRYPT_DIRECTORY", "server", "ACME_DIRECTORY", "v1.19.0")
206208
AcmeLiveDirectory = sec.Key("LETSENCRYPT_DIRECTORY").MustString("https")
207209
}
208-
// FIXME: DEPRECATED to be removed in v1.18.0
210+
209211
if sec.HasKey("ACME_EMAIL") {
210212
AcmeEmail = sec.Key("ACME_EMAIL").MustString("")
211213
} else {
212-
deprecatedSetting(rootCfg, "server", "LETSENCRYPT_EMAIL", "server", "ACME_EMAIL")
214+
deprecatedSetting(rootCfg, "server", "LETSENCRYPT_EMAIL", "server", "ACME_EMAIL", "v1.19.0")
213215
AcmeEmail = sec.Key("LETSENCRYPT_EMAIL").MustString("")
214216
}
215217
} else {

modules/setting/task.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33

44
package setting
55

6-
// FIXME: DEPRECATED to be removed in v1.18.0
6+
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
7+
// if these are removed, the warning will not be shown
78
// - will need to set default for [queue.task] LENGTH to 1000 though
89
func loadTaskFrom(rootCfg ConfigProvider) {
910
taskSec := rootCfg.Section("task")
1011
queueTaskSec := rootCfg.Section("queue.task")
1112

12-
deprecatedSetting(rootCfg, "task", "QUEUE_TYPE", "queue.task", "TYPE")
13-
deprecatedSetting(rootCfg, "task", "QUEUE_CONN_STR", "queue.task", "CONN_STR")
14-
deprecatedSetting(rootCfg, "task", "QUEUE_LENGTH", "queue.task", "LENGTH")
13+
deprecatedSetting(rootCfg, "task", "QUEUE_TYPE", "queue.task", "TYPE", "v1.19.0")
14+
deprecatedSetting(rootCfg, "task", "QUEUE_CONN_STR", "queue.task", "CONN_STR", "v1.19.0")
15+
deprecatedSetting(rootCfg, "task", "QUEUE_LENGTH", "queue.task", "LENGTH", "v1.19.0")
1516

1617
switch taskSec.Key("QUEUE_TYPE").MustString("channel") {
1718
case "channel":

modules/structs/user_app.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ import (
1111
// AccessToken represents an API access token.
1212
// swagger:response AccessToken
1313
type AccessToken struct {
14-
ID int64 `json:"id"`
15-
Name string `json:"name"`
16-
Token string `json:"sha1"`
17-
TokenLastEight string `json:"token_last_eight"`
14+
ID int64 `json:"id"`
15+
Name string `json:"name"`
16+
Token string `json:"sha1"`
17+
TokenLastEight string `json:"token_last_eight"`
18+
Scopes []string `json:"scopes"`
1819
}
1920

2021
// AccessTokenList represents a list of API access token.
2122
// swagger:response AccessTokenList
2223
type AccessTokenList []*AccessToken
2324

2425
// CreateAccessTokenOption options when create access token
25-
// swagger:parameters userCreateToken
2626
type CreateAccessTokenOption struct {
27-
Name string `json:"name" binding:"Required"`
27+
// required: true
28+
Name string `json:"name" binding:"Required"`
29+
Scopes []string `json:"scopes"`
2830
}
2931

3032
// CreateOAuth2ApplicationOptions holds options to create an oauth2 application

0 commit comments

Comments
 (0)