Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
37c9f00d
Commit
37c9f00d
authored
Oct 24, 2017
by
Sietse Ringers
Browse files
Renaming, 4: irmaclient.NewClient() -> irmaclient.New()
parent
fb9733ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
irmaclient/client.go
View file @
37c9f00d
...
...
@@ -74,7 +74,7 @@ type secretKey struct {
Key
*
big
.
Int
}
// New
Client
creates a new Client that uses the directory
// New creates a new Client that uses the directory
// specified by storagePath for (de)serializing itself. irmaConfigurationPath
// is the path to a (possibly readonly) folder containing irma_configuration;
// androidStoragePath is an optional path to the files of the old android app
...
...
@@ -86,7 +86,7 @@ type secretKey struct {
//
// NOTE: It is the responsibility of the caller that there exists a (properly
// protected) directory at storagePath!
func
New
Client
(
func
New
(
storagePath
string
,
irmaConfigurationPath
string
,
androidStoragePath
string
,
...
...
@@ -351,7 +351,7 @@ func (client *Client) credentialByID(id irmago.CredentialIdentifier) (*credentia
// credential returns the requested credential, or nil if we do not have it.
func
(
client
*
Client
)
credential
(
id
irmago
.
CredentialTypeIdentifier
,
counter
int
)
(
cred
*
credential
,
err
error
)
{
// If the requested credential is not in credential map, we check if its attributes were
// deserialized during New
Client
(). If so, there should be a corresponding signature file,
// deserialized during New(). If so, there should be a corresponding signature file,
// so we read that, construct the credential, and add it to the credential map
if
_
,
exists
:=
client
.
creds
(
id
)[
counter
];
!
exists
{
attrs
:=
client
.
Attributes
(
id
,
counter
)
...
...
irmaclient/irmago_test.go
View file @
37c9f00d
...
...
@@ -42,7 +42,7 @@ func parseStorage(t *testing.T) *Client {
if
!
exists
{
require
.
NoError
(
t
,
os
.
Mkdir
(
"testdata/storage/test"
,
0755
),
"Could not create test storage"
)
}
manager
,
err
:=
New
Client
(
manager
,
err
:=
New
(
"testdata/storage/test"
,
"testdata/irma_configuration"
,
"testdata/oldstorage"
,
...
...
@@ -189,7 +189,7 @@ func TestUnmarshaling(t *testing.T) {
jwt
:=
getIssuanceJwt
(
"testip"
,
irmago
.
NewAttributeTypeIdentifier
(
"irma-demo.RU.studentCard.studentID"
))
sessionHelper
(
t
,
jwt
,
"issue"
,
client
)
newclient
,
err
:=
New
Client
(
"testdata/storage/test"
,
"testdata/irma_configuration"
,
"testdata/oldstorage"
,
nil
)
newclient
,
err
:=
New
(
"testdata/storage/test"
,
"testdata/irma_configuration"
,
"testdata/oldstorage"
,
nil
)
require
.
NoError
(
t
,
err
)
verifyManagerIsUnmarshaled
(
t
,
newclient
)
verifyCredentials
(
t
,
newclient
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment