Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dfss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mpcs
dfss
Commits
fbfe0540
Commit
fbfe0540
authored
Apr 14, 2016
by
Loïck Bonniot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[c][p][mails] Apply gosimple propositions
parent
6dcd836e
Pipeline
#622
passed with stage
Changes
9
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
52 deletions
+12
-52
.gitlab-ci.yml
.gitlab-ci.yml
+2
-2
dfssc/impexp.go
dfssc/impexp.go
+1
-6
dfssc/user/authentication.go
dfssc/user/authentication.go
+2
-12
dfssc/user/client.go
dfssc/user/client.go
+2
-14
dfssc/user/config.go
dfssc/user/config.go
+1
-5
dfssp/authority/rootCA.go
dfssp/authority/rootCA.go
+1
-6
dfssp/common/group_test.go
dfssp/common/group_test.go
+1
-1
dfssp/contract/ready.go
dfssp/contract/ready.go
+1
-1
mails/email.go
mails/email.go
+1
-5
No files found.
.gitlab-ci.yml
View file @
fbfe0540
...
...
@@ -76,10 +76,10 @@ Code lint:
-
lint
script
:
-
"
ln
-s
$(pwd)
$GOPATH/src/dfss"
-
"
go
get
github.com/alecthomas/gometalinter"
-
"
go
get
-u
github.com/alecthomas/gometalinter"
-
"
./build/deps.sh"
-
"
cd
$GOPATH/src/dfss
&&
make
install_all"
-
"
gometalinter
--install"
-
"
gometalinter
--install
--update
"
-
"
gometalinter
-t
--deadline=600s
-j1
--skip=api
--skip=fixtures
--skip=gui
--skip=dfssd
--disable=aligncheck
./..."
Deploy
:
...
...
dfssc/impexp.go
View file @
fbfe0540
...
...
@@ -44,12 +44,7 @@ func readPassphrases(keyPassphrase, confPassphrase *string, second bool) error {
}
fmt
.
Println
(
"Enter the passphrase of your current key (if any)"
)
err
=
readPassword
(
keyPassphrase
,
false
)
if
err
!=
nil
{
return
err
}
return
nil
return
readPassword
(
keyPassphrase
,
false
)
}
// import the configuration
...
...
dfssc/user/authentication.go
View file @
fbfe0540
...
...
@@ -81,12 +81,7 @@ func (m *AuthManager) Authenticate() error {
return
err
}
err
=
m
.
evaluateResponse
(
response
)
if
err
!=
nil
{
return
err
}
return
nil
return
m
.
evaluateResponse
(
response
)
}
// Creates the associated authentication request and sends it to the platform grpc server
...
...
@@ -117,10 +112,5 @@ func (m *AuthManager) sendRequest() (*pb.RegisteredUser, error) {
func
(
m
*
AuthManager
)
evaluateResponse
(
response
*
pb
.
RegisteredUser
)
error
{
cert
:=
[]
byte
(
response
.
ClientCert
)
err
:=
ioutil
.
WriteFile
(
m
.
fileCert
,
cert
,
0600
)
if
err
!=
nil
{
return
err
}
return
nil
return
ioutil
.
WriteFile
(
m
.
fileCert
,
cert
,
0600
)
}
dfssc/user/client.go
View file @
fbfe0540
...
...
@@ -13,13 +13,7 @@ func Register(fileCA, fileCert, fileKey, addrPort, passphrase, country, organiza
if
err
!=
nil
{
return
err
}
err
=
manager
.
GetCertificate
()
if
err
!=
nil
{
return
err
}
return
nil
return
manager
.
GetCertificate
()
}
// Authenticate a user using the provided parameters
...
...
@@ -28,13 +22,7 @@ func Authenticate(fileCA, fileCert, addrPort, mail, token string) error {
if
err
!=
nil
{
return
err
}
err
=
manager
.
Authenticate
()
if
err
!=
nil
{
return
err
}
return
nil
return
manager
.
Authenticate
()
}
func
connect
(
fileCA
,
addrPort
string
)
(
pb
.
PlatformClient
,
error
)
{
...
...
dfssc/user/config.go
View file @
fbfe0540
...
...
@@ -123,11 +123,7 @@ func (c *Config) checkData(keyPassphrase string) error {
}
_
,
err
=
auth
.
EncryptedPEMToPrivateKey
(
c
.
KeyData
,
keyPassphrase
)
if
err
!=
nil
{
return
err
}
return
nil
}
// SaveUserInformations save the certificate and private key to the files specified in the Config struct
...
...
dfssp/authority/rootCA.go
View file @
fbfe0540
...
...
@@ -68,12 +68,7 @@ func Initialize(bits, days int, country, organization, unit, cn, path string, ca
}
// Save the root certificate.
err
=
ioutil
.
WriteFile
(
certPath
,
cert
,
0600
)
if
err
!=
nil
{
return
err
}
return
nil
return
ioutil
.
WriteFile
(
certPath
,
cert
,
0600
)
}
// Start fetches the platform's private rsa key and root certificate, and create a PlatformID accordingly.
...
...
dfssp/common/group_test.go
View file @
fbfe0540
...
...
@@ -44,7 +44,7 @@ func TestCloseWaitingGroup(t *testing.T) {
go
func
()
{
myChan
,
_
,
_
:=
w
.
Join
(
"A"
)
for
_
=
range
myChan
{
for
range
myChan
{
t
.
Fatal
(
"Should not be here"
)
}
// No need to call Unjoin here: if we do, we will try to unjoin a unknown room
...
...
dfssp/contract/ready.go
View file @
fbfe0540
...
...
@@ -137,7 +137,7 @@ func FindAndUpdatePendingSigner(mail string, signersReady *[]bool, signers *[]en
// Check if everyone is ready
for
_
,
s
:=
range
*
signersReady
{
if
s
==
false
{
if
!
s
{
return
}
}
...
...
mails/email.go
View file @
fbfe0540
...
...
@@ -143,11 +143,7 @@ func createFullMessage(b io.Writer, receiver, sender, globalHeader, base64Messag
return
err
}
}
if
err
:=
writer
.
Close
();
err
!=
nil
{
return
err
}
return
nil
return
writer
.
Close
()
}
// Create an attachment with a certain extension
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment