Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcs
dfss
Commits
2b63e8df
Commit
2b63e8df
authored
Apr 14, 2016
by
Loïck Bonniot
Browse files
Merge branch 'fix/2_gosimple_application' into 'master'
[c][p][mails] Apply gosimple propositions Fix
#2
See merge request
!53
parents
6dcd836e
fbfe0540
Pipeline
#623
passed with stages
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
2b63e8df
...
...
@@ -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 @
2b63e8df
...
...
@@ -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 @
2b63e8df
...
...
@@ -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 @
2b63e8df
...
...
@@ -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 @
2b63e8df
...
...
@@ -123,11 +123,7 @@ func (c *Config) checkData(keyPassphrase string) error {
}
_
,
err
=
auth
.
EncryptedPEMToPrivateKey
(
c
.
KeyData
,
keyPassphrase
)
if
err
!=
nil
{
return
err
}
return
nil
return
err
}
// SaveUserInformations save the certificate and private key to the files specified in the Config struct
...
...
dfssp/authority/rootCA.go
View file @
2b63e8df
...
...
@@ -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 @
2b63e8df
...
...
@@ -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 @
2b63e8df
...
...
@@ -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 @
2b63e8df
...
...
@@ -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
Supports
Markdown
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