Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZKAPAuthorizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
ZKAPAuthorizer
Commits
5bf8abd5
Commit
5bf8abd5
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
docs
parent
459c73af
No related branches found
Branches containing commit
No related tags found
1 merge request
!43
Add some more docs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/_zkapauthorizer/_storage_server.py
+13
-2
13 additions, 2 deletions
src/_zkapauthorizer/_storage_server.py
with
13 additions
and
2 deletions
src/_zkapauthorizer/_storage_server.py
+
13
−
2
View file @
5bf8abd5
...
...
@@ -61,6 +61,16 @@ from .storage_common import (
)
class
MorePassesRequired
(
Exception
):
"""
Storage operations fail with ``MorePassesRequired`` when they are not
accompanied by a sufficient number of valid passes.
:ivar int valid_count: The number of valid passes presented in the
operation.
ivar int required_count: The number of valid passes which must be
presented for the operation to be authorized.
"""
def
__init__
(
self
,
valid_count
,
required_count
):
self
.
valid_count
=
valid_count
self
.
required_count
=
required_count
...
...
@@ -90,12 +100,13 @@ class ZKAPAuthorizerStorageServer(Referenceable):
def
_is_invalid_pass
(
self
,
message
,
pass_
):
"""
Check the validity of a single pass.
C
ryptographically c
heck the validity of a single pass.
:param unicode message: The shared message for pass validation.
:param bytes pass_: The encoded pass to validate.
:return bool: ``True`` if the pass is invalid, ``False`` otherwise.
:return bool: ``False`` (invalid) if the pass includes a valid
signature, ``True`` (valid) otherwise.
"""
assert
isinstance
(
message
,
unicode
),
"
message %r not unicode
"
%
(
message
,)
assert
isinstance
(
pass_
,
bytes
),
"
pass %r not bytes
"
%
(
pass_
,)
...
...
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