Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
00d09904
Commit
00d09904
authored
7 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[enh] rename get_certifications_from_identities() and clarify with comments.
parent
e9e00cfd
No related branches found
No related tags found
1 merge request
!82
Certification fails for members
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
silkaj/cert.py
+1
-1
1 addition, 1 deletion
silkaj/cert.py
silkaj/wot.py
+7
-5
7 additions, 5 deletions
silkaj/wot.py
with
8 additions
and
6 deletions
silkaj/cert.py
+
1
−
1
View file @
00d09904
...
@@ -6,7 +6,7 @@ from silkaj.tools import get_publickey_from_seed, message_exit, sign_document_fr
...
@@ -6,7 +6,7 @@ from silkaj.tools import get_publickey_from_seed, message_exit, sign_document_fr
from
silkaj.network_tools
import
get_current_block
,
post_request
from
silkaj.network_tools
import
get_current_block
,
post_request
from
silkaj.license
import
license_approval
from
silkaj.license
import
license_approval
from
silkaj.constants
import
NO_MATCHING_ID
from
silkaj.constants
import
NO_MATCHING_ID
from
silkaj.wot
import
is_member
,
get_pubkeys_from_id
,
\
from
silkaj.wot
import
is_member
,
\
get_uid_from_pubkey
,
get_searched_id
get_uid_from_pubkey
,
get_searched_id
...
...
This diff is collapsed.
Click to expand it.
silkaj/wot.py
+
7
−
5
View file @
00d09904
...
@@ -79,7 +79,7 @@ def id_pubkey_correspondence(ep, id_pubkey):
...
@@ -79,7 +79,7 @@ def id_pubkey_correspondence(ep, id_pubkey):
if
check_public_key
(
id_pubkey
,
False
):
if
check_public_key
(
id_pubkey
,
False
):
print
(
"
{} public key corresponds to identity: {}
"
.
format
(
id_pubkey
,
get_uid_from_pubkey
(
ep
,
id_pubkey
)))
print
(
"
{} public key corresponds to identity: {}
"
.
format
(
id_pubkey
,
get_uid_from_pubkey
(
ep
,
id_pubkey
)))
else
:
else
:
pubkeys
=
get_
pubkeys_from_id
(
ep
,
id_pubkey
)
pubkeys
=
get_
informations_for_identities
(
ep
,
id_pubkey
)
if
pubkeys
==
NO_MATCHING_ID
:
if
pubkeys
==
NO_MATCHING_ID
:
print
(
NO_MATCHING_ID
)
print
(
NO_MATCHING_ID
)
else
:
else
:
...
@@ -97,7 +97,7 @@ def get_searched_id(ep, id):
...
@@ -97,7 +97,7 @@ def get_searched_id(ep, id):
many identities could match
many identities could match
return the one searched
return the one searched
"""
"""
certs_req
=
get_
pubkeys_from_id
(
ep
,
id
)
certs_req
=
get_
informations_for_identities
(
ep
,
id
)
if
certs_req
==
NO_MATCHING_ID
:
if
certs_req
==
NO_MATCHING_ID
:
message_exit
(
NO_MATCHING_ID
)
message_exit
(
NO_MATCHING_ID
)
for
certs_id
in
certs_req
:
for
certs_id
in
certs_req
:
...
@@ -118,12 +118,14 @@ def get_uid_from_pubkey(ep, pubkey):
...
@@ -118,12 +118,14 @@ def get_uid_from_pubkey(ep, pubkey):
i
+=
1
i
+=
1
def
get_
pubkeys_from_id
(
ep
,
u
id
):
def
get_
informations_for_identities
(
ep
,
id
entifier
):
"""
"""
check id exist
:identifier: identity or pubkey in part or whole
Return received and sent certifications lists of matching identities
if one identity found
"""
"""
try
:
try
:
results
=
get_request
(
ep
,
"
wot/lookup/
"
+
u
id
)
results
=
get_request
(
ep
,
"
wot/lookup/
"
+
id
entifier
)
except
:
except
:
return
NO_MATCHING_ID
return
NO_MATCHING_ID
return
results
[
"
results
"
]
return
results
[
"
results
"
]
...
...
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