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
3d0e89b7
Commit
3d0e89b7
authored
Jan 10, 2020
by
Ivar Derksen
Committed by
Sietse Ringers
Feb 05, 2020
Browse files
Added legacy storage tests for internal/sessiontest
parent
c0fc4c6f
Changes
3
Hide whitespace changes
Inline
Side-by-side
internal/sessiontest/legacy_test.go
0 → 100644
View file @
3d0e89b7
package
sessiontest
import
(
irma
"github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/internal/test"
"github.com/stretchr/testify/require"
"testing"
)
func
TestSessionUsingLegacyStorage
(
t
*
testing
.
T
)
{
test
.
SetTestStorageDir
(
"legacy_teststorage"
)
client
,
_
:=
parseStorage
(
t
)
// Issue new credential
sessionHelper
(
t
,
getMultipleIssuanceRequest
(),
"issue"
,
client
)
// Close client to prevent database to be opened twice
err
:=
client
.
Close
()
require
.
NoError
(
t
,
err
)
// Test whether credential is still there
require
.
NoError
(
t
,
err
)
id
:=
irma
.
NewAttributeTypeIdentifier
(
"irma-demo.MijnOverheid.root.BSN"
)
sessionHelper
(
t
,
getDisclosureRequest
(
id
),
"verification"
,
client
)
test
.
SetTestStorageDir
(
"teststorage"
)
}
irmaclient/client.go
View file @
3d0e89b7
...
...
@@ -186,6 +186,10 @@ func New(
return
cm
,
schemeMgrErr
}
func
(
client
*
Client
)
Close
()
error
{
return
client
.
storage
.
Close
()
}
// CredentialInfoList returns a list of information of all contained credentials.
func
(
client
*
Client
)
CredentialInfoList
()
irma
.
CredentialInfoList
{
list
:=
irma
.
CredentialInfoList
([]
*
irma
.
CredentialInfo
{})
...
...
irmaclient/storage.go
View file @
3d0e89b7
...
...
@@ -56,6 +56,10 @@ func (s *storage) EnsureStorageExists() error {
return
err
}
func
(
s
*
storage
)
Close
()
error
{
return
s
.
db
.
Close
()
}
func
(
s
*
storage
)
txStore
(
tx
*
bbolt
.
Tx
,
key
string
,
value
interface
{},
bucketName
string
)
error
{
b
,
err
:=
tx
.
CreateBucketIfNotExists
([]
byte
(
bucketName
))
if
err
!=
nil
{
...
...
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