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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
e52b7294
Commit
e52b7294
authored
5 years ago
by
Moul
Committed by
matograine
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[mod] auth: Rephase comments
parent
fc1529c0
No related branches found
No related tags found
2 merge requests
!146
Merge dev into master branch to complete v0.8.0 development cycle
,
!128
[fix] #278: changing regex for PubSec authfile authentication
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
silkaj/auth.py
+6
-6
6 additions, 6 deletions
silkaj/auth.py
with
6 additions
and
6 deletions
silkaj/auth.py
+
6
−
6
View file @
e52b7294
...
...
@@ -61,10 +61,10 @@ def generate_auth_file(file):
@pass_context
def
auth_by_auth_file
(
ctx
):
"""
Uses an auth file to generate key
.
Authfile can
be
either:
*
S
eed in hexadecimal encoding
* PubSec format with public and private key in base58 encoding
.
Uses an auth
entication
file to generate
the
key
Authfile can either
be
:
*
A s
eed in hexadecimal encoding
* PubSec format with public and private key in base58 encoding
"""
file
=
ctx
.
obj
[
"
AUTH_FILE_PATH
"
]
authfile
=
Path
(
file
)
...
...
@@ -73,11 +73,11 @@ def auth_by_auth_file(ctx):
filetxt
=
authfile
.
open
(
"
r
"
).
read
()
# regex for seed (hexadecimal)
regex_seed
=
compile
(
"
^[0-9a-fA-F]{64}$
"
)
# two
RE for
PubSec format
# two
regural expressions for the
PubSec format
regex_pubkey
=
compile
(
"
pub: ([1-9A-HJ-NP-Za-km-z]{43,44})
"
,
MULTILINE
)
regex_signkey
=
compile
(
"
sec: ([1-9A-HJ-NP-Za-km-z]{87,90})
"
,
MULTILINE
)
# Seed
F
ormat
# Seed
f
ormat
if
search
(
regex_seed
,
filetxt
):
return
SigningKey
.
from_seedhex_file
(
file
)
# PubSec format
...
...
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