Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
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
nodes
typescript
duniter
Commits
83176931
Commit
83176931
authored
8 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
Fixing
#374
Revocation Sandbox
parent
9b0b8424
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/service/IdentityService.js
+5
-0
5 additions, 0 deletions
app/service/IdentityService.js
test/integration/server-sandbox.js
+7
-1
7 additions, 1 deletion
test/integration/server-sandbox.js
with
12 additions
and
1 deletion
app/service/IdentityService.js
+
5
−
0
View file @
83176931
...
@@ -191,6 +191,11 @@ function IdentityService () {
...
@@ -191,6 +191,11 @@ function IdentityService () {
// Create identity given by the revocation
// Create identity given by the revocation
const
idty
=
new
Identity
(
revoc
);
const
idty
=
new
Identity
(
revoc
);
idty
.
revocation_sig
=
revoc
.
signature
;
idty
.
revocation_sig
=
revoc
.
signature
;
idty
.
certsCount
=
0
;
idty
.
ref_block
=
parseInt
(
idty
.
buid
.
split
(
'
-
'
)[
0
]);
if
(
!
(
yield
dal
.
idtyDAL
.
sandbox
.
acceptNewSandBoxEntry
(
idty
,
conf
.
pair
&&
conf
.
pair
.
pub
)))
{
throw
constants
.
ERRORS
.
SANDBOX_FOR_IDENTITY_IS_FULL
;
}
yield
dal
.
savePendingIdentity
(
idty
);
yield
dal
.
savePendingIdentity
(
idty
);
return
jsonResultTrue
();
return
jsonResultTrue
();
}
}
...
...
This diff is collapsed.
Click to expand it.
test/integration/server-sandbox.js
+
7
−
1
View file @
83176931
...
@@ -43,6 +43,7 @@ const i4 = user('i4', { pub: '2LvDg21dVXvetTD9GdkPLURavLYEqP3whauvPWX4c2qc', s
...
@@ -43,6 +43,7 @@ const i4 = user('i4', { pub: '2LvDg21dVXvetTD9GdkPLURavLYEqP3whauvPWX4c2qc', s
const
i5
=
user
(
'
i5
'
,
{
pub
:
'
91dWdiyf7KaC4GAiKrwU7nGuue1vvmHqjCXbPziJFYtE
'
,
sec
:
'
4Zno2b8ZULwBLY3RU5JcZhUf2a5FfXLVUMaYwPEzzN6i4ow9vXPsiCq7u2pEhkgJywqWdj97Hje1fdqnnzHeFgQe
'
},
{
server
:
s1
});
const
i5
=
user
(
'
i5
'
,
{
pub
:
'
91dWdiyf7KaC4GAiKrwU7nGuue1vvmHqjCXbPziJFYtE
'
,
sec
:
'
4Zno2b8ZULwBLY3RU5JcZhUf2a5FfXLVUMaYwPEzzN6i4ow9vXPsiCq7u2pEhkgJywqWdj97Hje1fdqnnzHeFgQe
'
},
{
server
:
s1
});
const
i6
=
user
(
'
i6
'
,
{
pub
:
'
3C95HniUZsUN55AJy7z4wkz1UwtebbNd63dVAZ6EaUNm
'
,
sec
:
'
3iJMz8JKNeU692L7jvug8xVnKvzN9RDee2m6QkMKbWKrvoHhv6apS4LR9hP786PUyFYJWz8bReMrFK8PY3aGxB8m
'
},
{
server
:
s1
});
const
i6
=
user
(
'
i6
'
,
{
pub
:
'
3C95HniUZsUN55AJy7z4wkz1UwtebbNd63dVAZ6EaUNm
'
,
sec
:
'
3iJMz8JKNeU692L7jvug8xVnKvzN9RDee2m6QkMKbWKrvoHhv6apS4LR9hP786PUyFYJWz8bReMrFK8PY3aGxB8m
'
},
{
server
:
s1
});
const
i7
=
user
(
'
i7
'
,
{
pub
:
'
4e9QJhJqHfMzEHgt3GtbfCXjqHVaQuJZKrKt8CNKR3AF
'
,
sec
:
'
TqdT99RpPEUjiz8su5QY7AQwharxPeo4ELCmeaFcvBEd3fW7wY7s9i531LMnTrCYBsgkrES494V6KjkhGppyEcF
'
},
{
server
:
s1
});
const
i7
=
user
(
'
i7
'
,
{
pub
:
'
4e9QJhJqHfMzEHgt3GtbfCXjqHVaQuJZKrKt8CNKR3AF
'
,
sec
:
'
TqdT99RpPEUjiz8su5QY7AQwharxPeo4ELCmeaFcvBEd3fW7wY7s9i531LMnTrCYBsgkrES494V6KjkhGppyEcF
'
},
{
server
:
s1
});
const
i7onS2
=
user
(
'
i7
'
,
{
pub
:
'
4e9QJhJqHfMzEHgt3GtbfCXjqHVaQuJZKrKt8CNKR3AF
'
,
sec
:
'
TqdT99RpPEUjiz8su5QY7AQwharxPeo4ELCmeaFcvBEd3fW7wY7s9i531LMnTrCYBsgkrES494V6KjkhGppyEcF
'
},
{
server
:
s2
});
const
i8
=
user
(
'
i8
'
,
{
pub
:
'
6GiiWjJxr29Stc4Ph4J4EipZJCzaQW1j6QXKANTNzRV3
'
,
sec
:
'
Yju625FGz6FHErshRc7jZyJUJ83MG4Zh9TXUNML62rKLXz7VJmwofnhJzeRRensranFJGQMYBLNSAeycAAsp62m
'
},
{
server
:
s1
});
const
i8
=
user
(
'
i8
'
,
{
pub
:
'
6GiiWjJxr29Stc4Ph4J4EipZJCzaQW1j6QXKANTNzRV3
'
,
sec
:
'
Yju625FGz6FHErshRc7jZyJUJ83MG4Zh9TXUNML62rKLXz7VJmwofnhJzeRRensranFJGQMYBLNSAeycAAsp62m
'
},
{
server
:
s1
});
const
i9
=
user
(
'
i9
'
,
{
pub
:
'
6v4HnmiGxNzKwEjnBqxicWAmdKo6Bk51GvfQByS5YmiB
'
,
sec
:
'
2wXPPDYfM3a8jmpYiFihS9qzdqFZrLWryu4uwpNPRuw5TRW3JCdJPsMa64eAcpshLTnMXkrKL94argk3FGxzzBKh
'
},
{
server
:
s1
});
const
i9
=
user
(
'
i9
'
,
{
pub
:
'
6v4HnmiGxNzKwEjnBqxicWAmdKo6Bk51GvfQByS5YmiB
'
,
sec
:
'
2wXPPDYfM3a8jmpYiFihS9qzdqFZrLWryu4uwpNPRuw5TRW3JCdJPsMa64eAcpshLTnMXkrKL94argk3FGxzzBKh
'
},
{
server
:
s1
});
const
i10
=
user
(
'
i10
'
,
{
pub
:
'
6kr9Xr86qmrrwGq3XEjUXRVpHqS63FL52tcutcYGcRiv
'
,
sec
:
'
2jCzQx7XUWoxboH67mMMv2z8VcrQabtYWpxS39iF6hNQnSBwN1d9RVauVC52PTRz6mgMzTjrSMETPrrB5N3oC7qQ
'
},
{
server
:
s1
});
const
i10
=
user
(
'
i10
'
,
{
pub
:
'
6kr9Xr86qmrrwGq3XEjUXRVpHqS63FL52tcutcYGcRiv
'
,
sec
:
'
2jCzQx7XUWoxboH67mMMv2z8VcrQabtYWpxS39iF6hNQnSBwN1d9RVauVC52PTRz6mgMzTjrSMETPrrB5N3oC7qQ
'
},
{
server
:
s1
});
...
@@ -112,8 +113,13 @@ describe("Sandboxes", function() {
...
@@ -112,8 +113,13 @@ describe("Sandboxes", function() {
it
(
'
should reject i7(1)
'
,
()
=>
shouldThrow
(
i7
.
createIdentity
()));
it
(
'
should reject i7(1)
'
,
()
=>
shouldThrow
(
i7
.
createIdentity
()));
it
(
'
should reject i7(1) by revocation
'
,
()
=>
shouldThrow
(
co
(
function
*
()
{
yield
i7onS2
.
createIdentity
();
const
idty
=
yield
i7onS2
.
lookup
(
i7onS2
.
pub
);
yield
i7
.
revoke
(
idty
);
})));
it
(
'
should accept i7(1), i8(1), i9(1) by i1->i7(1), i1->i8(1), i1->i9(1)
'
,
()
=>
co
(
function
*
()
{
it
(
'
should accept i7(1), i8(1), i9(1) by i1->i7(1), i1->i8(1), i1->i9(1)
'
,
()
=>
co
(
function
*
()
{
yield
i7
.
createIdentity
(
null
,
s2
);
yield
i1
.
cert
(
i7
,
s2
);
yield
i1
.
cert
(
i7
,
s2
);
(
yield
s1
.
dal
.
idtyDAL
.
getSandboxRoom
()).
should
.
equal
(
0
);
(
yield
s1
.
dal
.
idtyDAL
.
getSandboxRoom
()).
should
.
equal
(
0
);
yield
i8
.
createIdentity
(
null
,
s2
);
yield
i8
.
createIdentity
(
null
,
s2
);
...
...
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