[[projects]]
branch = "master"
- digest = "1:17c6c3f4af27f721e3176aceeb2ee30621547a44c81ada0ce733170b9bdfee19"
+ digest = "1:784d7948aaae61b9fe50aa15c69a62fb277268a47ed006748a7e25fa61b841c9"
name = "code.gitea.io/sdk"
packages = ["gitea"]
pruneopts = "NUT"
- revision = "b9e72373fbe3001d98ce7395221d0134b9456679"
+ revision = "4a15722a627a9cf62a203a066e724e82556b3845"
[[projects]]
digest = "1:5d72bbcc9c8667b11c3dc3cbe681c5a6f71e5096744c0bf7726ab5c6425d5dc4"
revision = "3a771d992973f24aa725d07868b467d1ddfceafb"
[[projects]]
- branch = "master"
digest = "1:b17287a86f6cac923a5d886e10618df994eeb54b6724eac2e3b8dde89cfbe3a2"
name = "github.com/blevesearch/bleve"
packages = [
type AdminCreateUserForm struct {
LoginType string `binding:"Required"`
LoginName string
- UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"`
+ UserName string `binding:"Required;AlphaDashDot;MaxSize(40)"`
Email string `binding:"Required;Email;MaxSize(254)"`
Password string `binding:"MaxSize(255)"`
SendNotify bool
// CreateOrgForm form for creating organization
type CreateOrgForm struct {
- OrgName string `binding:"Required;AlphaDashDot;MaxSize(35)" locale:"org.org_name_holder"`
+ OrgName string `binding:"Required;AlphaDashDot;MaxSize(40)" locale:"org.org_name_holder"`
Visibility structs.VisibleType
}
// UpdateOrgSettingForm form for updating organization settings
type UpdateOrgSettingForm struct {
- Name string `binding:"Required;AlphaDashDot;MaxSize(35)" locale:"org.org_name_holder"`
+ Name string `binding:"Required;AlphaDashDot;MaxSize(40)" locale:"org.org_name_holder"`
FullName string `binding:"MaxSize(100)"`
Description string `binding:"MaxSize(255)"`
Website string `binding:"ValidUrl;MaxSize(255)"`
// RegisterForm form for registering
type RegisterForm struct {
- UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"`
+ UserName string `binding:"Required;AlphaDashDot;MaxSize(40)"`
Email string `binding:"Required;Email;MaxSize(254)"`
Password string `binding:"Required;MaxSize(255)"`
Retype string
// UpdateProfileForm form for updating profile
type UpdateProfileForm struct {
- Name string `binding:"AlphaDashDot;MaxSize(35)"`
+ Name string `binding:"AlphaDashDot;MaxSize(40)"`
FullName string `binding:"MaxSize(100)"`
Email string `binding:"Required;Email;MaxSize(254)"`
KeepEmailPrivate bool
// SignUpOpenIDForm form for signin up with OpenID
type SignUpOpenIDForm struct {
- UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"`
+ UserName string `binding:"Required;AlphaDashDot;MaxSize(40)"`
Email string `binding:"Required;Email;MaxSize(254)"`
GRecaptchaResponse string `form:"g-recaptcha-response"`
}
"type": "string",
"x-go-name": "LoginName"
},
+ "must_change_password": {
+ "type": "boolean",
+ "x-go-name": "MustChangePassword"
+ },
"password": {
"type": "string",
"x-go-name": "Password"
"format": "int64",
"x-go-name": "MaxRepoCreation"
},
+ "must_change_password": {
+ "type": "boolean",
+ "x-go-name": "MustChangePassword"
+ },
"password": {
"type": "string",
"x-go-name": "Password"
// Copyright 2015 The Gogs Authors. All rights reserved.
+// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
SourceID int64 `json:"source_id"`
LoginName string `json:"login_name"`
// required: true
- Username string `json:"username" binding:"Required;AlphaDashDot;MaxSize(35)"`
+ Username string `json:"username" binding:"Required;AlphaDashDot;MaxSize(40)"`
FullName string `json:"full_name" binding:"MaxSize(100)"`
// required: true
// swagger:strfmt email
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
// required: true
- Password string `json:"password" binding:"Required;MaxSize(255)"`
- SendNotify bool `json:"send_notify"`
+ Password string `json:"password" binding:"Required;MaxSize(255)"`
+ MustChangePassword bool `json:"must_change_password"`
+ SendNotify bool `json:"send_notify"`
}
// AdminCreateUser create a user
// swagger:strfmt email
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
Password string `json:"password" binding:"MaxSize(255)"`
+ MustChangePassword bool `json:"must_change_password"`
Website string `json:"website" binding:"MaxSize(50)"`
Location string `json:"location" binding:"MaxSize(50)"`
Active *bool `json:"active"`
type Client struct {
url string
accessToken string
+ sudo string
client *http.Client
}
c.client = client
}
+// SetSudo sets username to impersonate.
+func (c *Client) SetSudo(sudo string) {
+ c.sudo = sudo
+}
+
func (c *Client) doRequest(method, path string, header http.Header, body io.Reader) (*http.Response, error) {
req, err := http.NewRequest(method, c.url+"/api/v1"+path, body)
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "token "+c.accessToken)
+ if c.sudo != "" {
+ req.Header.Set("Sudo", c.sudo)
+ }
for k, v := range header {
req.Header[k] = v
}
jsonHeader, bytes.NewReader(body), issue)
}
+// StartIssueStopWatch starts a stopwatch for an existing issue for a given
+// repository
+func (c *Client) StartIssueStopWatch(owner, repo string, index int64) error {
+ _, err := c.getResponse("POST", fmt.Sprintf("/repos/%s/%s/issues/%d/stopwatch/start", owner, repo, index),
+ jsonHeader, nil)
+ return err
+}
+
+// StopIssueStopWatch stops an existing stopwatch for an issue in a given
+// repository
+func (c *Client) StopIssueStopWatch(owner, repo string, index int64) error {
+ _, err := c.getResponse("POST", fmt.Sprintf("/repos/%s/%s/issues/%d/stopwatch/stop", owner, repo, index),
+ jsonHeader, nil)
+ return err
+}
+
// EditDeadlineOption options for creating a deadline
type EditDeadlineOption struct {
// required:true