Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask-vpn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Merlin
bitmask-vpn
Commits
249a8844
Unverified
Commit
249a8844
authored
5 years ago
by
meskio
Committed by
Kali Kaneko
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[bug] use the right http client to fetch the auth
parent
c56df012
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pkg/vpn/bonafide/auth_anon.go
+1
-3
1 addition, 3 deletions
pkg/vpn/bonafide/auth_anon.go
pkg/vpn/bonafide/auth_sip.go
+1
-2
1 addition, 2 deletions
pkg/vpn/bonafide/auth_sip.go
pkg/vpn/bonafide/bonafide.go
+2
-2
2 additions, 2 deletions
pkg/vpn/bonafide/bonafide.go
with
4 additions
and
7 deletions
pkg/vpn/bonafide/auth_anon.go
+
1
−
3
View file @
249a8844
...
...
@@ -19,9 +19,7 @@ import (
"errors"
)
type
anonymousAuthentication
struct
{
client
httpClient
}
type
anonymousAuthentication
struct
{}
func
(
a
*
anonymousAuthentication
)
needsCredentials
()
bool
{
return
true
...
...
This diff is collapsed.
Click to expand it.
pkg/vpn/bonafide/auth_sip.go
+
1
−
2
View file @
249a8844
...
...
@@ -19,7 +19,6 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
)
...
...
@@ -41,7 +40,7 @@ func (a *sipAuthentication) getToken(user, password string) ([]byte, error) {
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Cannot encode credentials: %s"
,
err
)
}
resp
,
err
:=
http
.
Post
(
a
.
authURI
,
"text/json"
,
strings
.
NewReader
(
credJSON
))
resp
,
err
:=
a
.
client
.
Post
(
a
.
authURI
,
"text/json"
,
strings
.
NewReader
(
credJSON
))
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Error on auth request: %v"
,
err
)
}
...
...
This diff is collapsed.
Click to expand it.
pkg/vpn/bonafide/bonafide.go
+
2
−
2
View file @
249a8844
...
...
@@ -105,10 +105,10 @@ func New() *Bonafide {
b
.
auth
=
&
sipAuthentication
{
client
,
b
.
getURL
(
"auth"
)}
case
"anon"
:
log
.
Println
(
"Client expects anon auth"
)
b
.
auth
=
&
anonymousAuthentication
{
client
}
b
.
auth
=
&
anonymousAuthentication
{}
default
:
log
.
Println
(
"Client expects invalid auth"
,
auth
)
b
.
auth
=
&
anonymousAuthentication
{
client
}
b
.
auth
=
&
anonymousAuthentication
{}
}
return
b
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment