Merge pull request #2721 from techknowlogick/rm-basic-auth-gitea

Remove basic auth as an option for Gitea
This commit is contained in:
Brad Rydzewski 2019-09-01 13:25:43 -07:00 committed by GitHub
commit 33a8ecec91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 27 deletions

View file

@ -4,9 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Removed
- Support for basic auth as an option for Gitea, by [@techknowlogick](https://giteahub.com/techknowlogick). [#2721](https://github.com/drone/drone/issues/2721)
## [1.3.1] - 2019-08-26
### Added
- support for the GitHub deployment status API, by [@bradrydzewski](https://github.com/bradrydzewski).
## [1.3.0] - 2019-08-20

View file

@ -117,16 +117,6 @@ func provideGiteaClient(config config.Config) *scm.Client {
if config.Gitea.Debug {
client.DumpResponse = httputil.DumpResponse
}
if config.Gitea.ClientID == "" {
client.Client = &http.Client{
Transport: &oauth2.Transport{
Scheme: oauth2.SchemeToken,
Source: oauth2.ContextTokenSource(),
Base: defaultTransport(config.Gitea.SkipVerify),
},
}
return client
}
client.Client = &http.Client{
Transport: &oauth2.Transport{
Scheme: oauth2.SchemeBearer,

View file

@ -92,22 +92,14 @@ func provideGiteaLogin(config config.Config) login.Middleware {
if config.Gitea.Server == "" {
return nil
}
if config.Gitea.ClientID != "" {
return &gitea.Config {
ClientID: config.Gitea.ClientID,
ClientSecret: config.Gitea.ClientSecret,
Server: config.Gitea.Server,
Client: defaultClient(config.Gitea.SkipVerify),
Logger: logrus.StandardLogger(),
RedirectURL: config.Server.Addr + "/login",
Scope: config.Gitea.Scope,
}
}
return &gogs.Config{
Label: "drone",
Login: "/login/form",
Server: config.Gitea.Server,
Client: defaultClient(config.Gitea.SkipVerify),
return &gitea.Config {
ClientID: config.Gitea.ClientID,
ClientSecret: config.Gitea.ClientSecret,
Server: config.Gitea.Server,
Client: defaultClient(config.Gitea.SkipVerify),
Logger: logrus.StandardLogger(),
RedirectURL: config.Server.Addr + "/login",
Scope: config.Gitea.Scope,
}
}