Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
acme-dns-tiny
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adrien Dorsaz
acme-dns-tiny
Commits
a2bee86e
Commit
a2bee86e
authored
Jun 12, 2020
by
Adrien Dorsaz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code style: follow pep8 recommendation of 99 max char by line
parent
68e54ce8
Pipeline
#272
failed with stages
in 13 minutes and 37 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
17 deletions
+24
-17
.gitlab-ci.yml
.gitlab-ci.yml
+10
-10
acme_dns_tiny.py
acme_dns_tiny.py
+8
-4
tests/config_factory.py
tests/config_factory.py
+2
-1
tests/staging_test_acme_dns_tiny.py
tests/staging_test_acme_dns_tiny.py
+4
-2
No files found.
.gitlab-ci.yml
View file @
a2bee86e
...
...
@@ -64,20 +64,20 @@ compile:
lint
:
extends
:
.check
script
:
-
pylint3 acme_dns_tiny.py
-
pylint3 tools/acme_account_deactivate.py
-
pylint3 tools/acme_account_rollover.py
-
pylint3 tests/config_factory.py
-
pylint3 tests/staging_test_acme_dns_tiny.py
-
pylint3 tests/unit_test_acme_dns_tiny.py
-
pylint3 tests/staging_test_acme_account_deactivate.py
-
pylint3 tests/staging_test_acme_account_rollover.py
-
pylint3
--max-line-length=99
acme_dns_tiny.py
-
pylint3
--max-line-length=99
tools/acme_account_deactivate.py
-
pylint3
--max-line-length=99
tools/acme_account_rollover.py
-
pylint3
--max-line-length=99
tests/config_factory.py
-
pylint3
--max-line-length=99
tests/staging_test_acme_dns_tiny.py
-
pylint3
--max-line-length=99
tests/unit_test_acme_dns_tiny.py
-
pylint3
--max-line-length=99
tests/staging_test_acme_account_deactivate.py
-
pylint3
--max-line-length=99
tests/staging_test_acme_account_rollover.py
pep8
:
extends
:
.check
script
:
-
pycodestyle --max-line-length=
100
--ignore=E401,W503 --exclude=tests .
-
pycodestyle --max-line-length=
100
--ignore=E722 tests
-
pycodestyle --max-line-length=
99
--ignore=E401,W503 --exclude=tests .
-
pycodestyle --max-line-length=
99
--ignore=E722 tests
jessie-ut
:
extends
:
.unit_test
...
...
acme_dns_tiny.py
View file @
a2bee86e
...
...
@@ -169,7 +169,8 @@ def get_crt(config, log=LOGGER):
log
.
info
(
"Update contact information if needed."
)
if
(
"contact"
in
account_request
and
set
(
account_request
[
"contact"
])
!=
set
(
account_info
[
"contact"
])):
http_response
,
result
=
_send_signed_request
(
private_acme_signature
[
"kid"
],
account_request
)
http_response
,
result
=
_send_signed_request
(
private_acme_signature
[
"kid"
],
account_request
)
if
http_response
.
status_code
==
200
:
log
.
debug
(
" - Account updated with latest contact informations."
)
else
:
...
...
@@ -190,7 +191,8 @@ def get_crt(config, log=LOGGER):
and
order
[
"type"
]
==
"urn:ietf:params:acme:error:userActionRequired"
):
raise
ValueError
((
"Order creation failed ({0}). Read Terms of Service ({1}), then follow "
"your CA instructions: {2}"
)
.
format
(
order
[
"detail"
],
http_response
.
headers
[
'Link'
],
order
[
"instance"
]))
.
format
(
order
[
"detail"
],
http_response
.
headers
[
'Link'
],
order
[
"instance"
]))
else
:
raise
ValueError
(
"Error getting new Order: {0} {1}"
.
format
(
http_response
.
status_code
,
order
))
...
...
@@ -240,7 +242,8 @@ def get_crt(config, log=LOGGER):
while
challenge_verified
is
False
:
try
:
log
.
debug
((
'Self test (try: %s): Check resource with value "%s" exits on '
'nameservers: %s'
),
number_check_fail
,
keydigest64
,
resolver
.
nameservers
)
'nameservers: %s'
),
number_check_fail
,
keydigest64
,
resolver
.
nameservers
)
for
response
in
resolver
.
query
(
dnsrr_domain
,
rdtype
=
"TXT"
).
rrset
:
log
.
debug
(
" - Found value %s"
,
response
.
to_text
())
challenge_verified
=
(
challenge_verified
...
...
@@ -281,7 +284,8 @@ def get_crt(config, log=LOGGER):
_update_dns
(
dnsrr_set
,
"delete"
)
log
.
info
(
"Request to finalize the order (all chalenge have been completed)"
)
csr_der
=
_base64
(
_openssl
(
"req"
,
[
"-in"
,
config
[
"acmednstiny"
][
"CSRFile"
],
"-outform"
,
"DER"
]))
csr_der
=
_base64
(
_openssl
(
"req"
,
[
"-in"
,
config
[
"acmednstiny"
][
"CSRFile"
],
"-outform"
,
"DER"
]))
http_response
,
result
=
_send_signed_request
(
order
[
"finalize"
],
{
"csr"
:
csr_der
})
if
http_response
.
status_code
!=
200
:
raise
ValueError
(
"Error while sending the CSR: {0} {1}"
...
...
tests/config_factory.py
View file @
a2bee86e
...
...
@@ -141,7 +141,8 @@ def generate_acme_dns_tiny_config(): # pylint: disable=too-many-locals,too-many
wild_san_conf
=
NamedTemporaryFile
(
delete
=
False
)
with
open
(
"/etc/ssl/openssl.cnf"
,
'r'
)
as
opensslcnf
:
wild_san_conf
.
write
(
opensslcnf
.
read
().
encode
(
"utf8"
))
wild_san_conf
.
write
(
"
\n
[SAN]
\n
subjectAltName=DNS:{0},DNS:*.{0}
\n
"
.
format
(
DOMAIN
).
encode
(
"utf8"
))
wild_san_conf
.
write
(
"
\n
[SAN]
\n
subjectAltName=DNS:{0},DNS:*.{0}
\n
"
.
format
(
DOMAIN
).
encode
(
"utf8"
))
wild_san_conf
.
seek
(
0
)
Popen
([
"openssl"
,
"req"
,
"-new"
,
"-sha256"
,
"-key"
,
domain_key
,
"-subj"
,
"/"
,
"-reqexts"
,
"SAN"
,
"-config"
,
wild_san_conf
.
name
,
...
...
tests/staging_test_acme_dns_tiny.py
View file @
a2bee86e
...
...
@@ -206,13 +206,15 @@ class TestACMEDNSTiny(unittest.TestCase):
"""Can't use the account key for the CSR."""
self
.
assertRaisesRegex
(
ValueError
,
"certificate public key must be different than account key"
,
acme_dns_tiny
.
main
,
[
self
.
configs
[
'account_as_domain'
],
"--verbose"
])
acme_dns_tiny
.
main
,
[
self
.
configs
[
'account_as_domain'
],
"--verbose"
])
def
test_failure_dns_update_tsigkeyname
(
self
):
"""Fail to update DNS records by invalid TSIG Key name."""
self
.
assertRaisesRegex
(
ValueError
,
"Error updating DNS"
,
acme_dns_tiny
.
main
,
[
self
.
configs
[
'invalid_tsig_name'
],
"--verbose"
])
acme_dns_tiny
.
main
,
[
self
.
configs
[
'invalid_tsig_name'
],
"--verbose"
])
if
__name__
==
"__main__"
:
# pragma: no cover
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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