Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
user-discovery-bot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
archives
user-discovery-bot
Commits
afc52f85
Commit
afc52f85
authored
Jul 28, 2023
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Fix pipelien
parent
cf8073ae
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!68
Release
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
cmd/root.go
+9
-1
9 additions, 1 deletion
cmd/root.go
io/manager.go
+4
-1
4 additions, 1 deletion
io/manager.go
io/manager_test.go
+1
-1
1 addition, 1 deletion
io/manager_test.go
io/validateUsername_test.go
+2
-2
2 additions, 2 deletions
io/validateUsername_test.go
with
16 additions
and
5 deletions
cmd/root.go
+
9
−
1
View file @
afc52f85
...
...
@@ -84,9 +84,17 @@ var rootCmd = &cobra.Command{
jww
.
WARN
.
Printf
(
"Skipping scheduling signature verification set to %v "
,
viper
.
GetBool
(
"skipVerification"
))
// Extract private key
privKey
,
err
:=
rsa
.
LoadPrivateKeyFromPem
(
p
.
Key
)
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Failed to load RSA private key: %v"
,
err
)
}
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
1024
,
csprng
.
NewSystemRNG
)
// Set up manager with the ability to contact permissioning
manager
:=
io
.
NewManager
(
p
.
IO
,
&
id
.
UDB
,
permCert
,
twilioManager
,
bannedManager
,
storage
,
viper
.
GetBool
(
"skipVerification"
))
bannedManager
,
storage
,
viper
.
GetBool
(
"skipVerification"
)
,
privKey
,
rngStreamGen
)
hostParams
:=
connect
.
GetDefaultHostParams
()
hostParams
.
AuthEnabled
=
false
permHost
,
err
:=
manager
.
Comms
.
AddHost
(
&
id
.
Permissioning
,
...
...
This diff is collapsed.
Click to expand it.
io/manager.go
+
4
−
1
View file @
afc52f85
...
...
@@ -32,18 +32,21 @@ type Manager struct {
Twilio
*
twilio
.
Manager
Banned
*
banned
.
Manager
skipVerification
bool
RsaPrivateKey
*
rsa
.
PrivateKey
}
// NewManager creates a new UserDiscovery Manager given a set of Params.
func
NewManager
(
p
params
.
IO
,
id
*
id
.
ID
,
permissioningCert
*
rsa
.
PublicKey
,
twilio
*
twilio
.
Manager
,
banned
*
banned
.
Manager
,
storage
*
storage
.
Storage
,
skipVerification
bool
)
*
Manager
{
storage
*
storage
.
Storage
,
skipVerification
bool
,
key
*
rsa
.
PrivateKey
,
streamGen
*
fastRNG
.
StreamGenerator
)
*
Manager
{
m
:=
&
Manager
{
Storage
:
storage
,
PermissioningPublicKey
:
permissioningCert
,
Twilio
:
twilio
,
Banned
:
banned
,
skipVerification
:
skipVerification
,
RsaPrivateKey
:
key
,
Rng
:
streamGen
,
}
m
.
Comms
=
udb
.
StartServer
(
id
,
fmt
.
Sprintf
(
"0.0.0.0:%s"
,
p
.
Port
),
newImplementation
(
m
),
p
.
Cert
,
p
.
Key
)
...
...
This diff is collapsed.
Click to expand it.
io/manager_test.go
+
1
−
1
View file @
afc52f85
...
...
@@ -30,7 +30,7 @@ func TestNewManager(t *testing.T) {
t
.
Fatalf
(
"Failed to construct ban manager: %v"
,
err
)
}
m
:=
NewManager
(
p
,
id
.
NewIdFromString
(
"zezima"
,
id
.
User
,
t
),
nil
,
tm
,
bannedManager
,
store
,
false
)
m
:=
NewManager
(
p
,
id
.
NewIdFromString
(
"zezima"
,
id
.
User
,
t
),
nil
,
tm
,
bannedManager
,
store
,
false
,
nil
,
nil
)
if
m
==
nil
||
reflect
.
TypeOf
(
m
)
!=
reflect
.
TypeOf
(
&
Manager
{})
{
t
.
Errorf
(
"Did not receive a manager"
)
}
...
...
This diff is collapsed.
Click to expand it.
io/validateUsername_test.go
+
2
−
2
View file @
afc52f85
...
...
@@ -45,7 +45,7 @@ func TestValidateUsername(t *testing.T) {
t
.
Fatalf
(
"Failed to construct ban manager: %v"
,
err
)
}
_
,
err
=
registerUser
(
registerMsg
,
cert
,
store
,
bannedManager
)
_
,
err
=
registerUser
(
registerMsg
,
cert
,
store
,
bannedManager
,
false
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed happy path: %v"
,
err
)
}
...
...
@@ -96,7 +96,7 @@ func TestValidateUsername_UsernameMismatch(t *testing.T) {
t
.
Fatalf
(
"Failed to construct ban manager: %v"
,
err
)
}
_
,
err
=
registerUser
(
registerMsg
,
cert
,
store
,
bannedManager
)
_
,
err
=
registerUser
(
registerMsg
,
cert
,
store
,
bannedManager
,
false
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed happy path: %v"
,
err
)
}
...
...
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