0
0
mirror of https://github.com/thegeeklab/certbot-dns-corenetworks.git synced 2024-06-02 16:59:40 +02:00

Compare commits

...

37 Commits
v0.1.1 ... main

Author SHA1 Message Date
8d5c0a9df7
add discontinued information 2021-03-20 16:23:14 +01:00
renovate[bot]
3353e2795d
chore(deps): update dependency pydocstyle to v6 (#12)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-03-20 16:01:13 +01:00
Renovate Bot
361d70c709 chore(deps): update dependency yapf to ^0.31.0 2021-03-13 01:54:30 +00:00
5ff33d0ed2
ci: disable poetry experimental installer (#9) 2021-02-18 22:27:54 +01:00
e060462724
ci: increase log level for poetry install steps 2021-02-18 11:18:30 +01:00
5b7c513e11
[skip ci] disable github strict status check 2021-02-18 11:13:11 +01:00
5bfb87d6ad
fix ci step naming (#8) 2021-02-18 10:09:13 +01:00
f05cba4d44
fix ci badge 2021-01-17 15:23:46 +01:00
e1369f6e2d
fix ci badge 2021-01-17 15:10:33 +01:00
903eb6ce6a
remove unnecessary docker_config secret from drone config 2021-01-16 15:45:38 +01:00
c4450824f1
re-sign drone config 2021-01-16 15:21:38 +01:00
Renovate Bot
ceefd593df chore(deps): update dependency flake8-blind-except to ^0.2.0 2021-01-07 21:46:35 +00:00
f131c2fb96
chore(devel): add codecov config file 2021-01-06 18:12:46 +01:00
21c897ef05
[skip ci] exclude .venv folder from isort 2021-01-03 21:43:56 +01:00
2eb4543f24
[skip ci] update year in license file 2021-01-03 21:40:24 +01:00
renovate[bot]
7e408cccea
fix(deps): update dependency corenetworks to ^0.2.0 (#5)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-01-03 15:06:20 +01:00
8cf92d2aae
[skip ci] fix changelog 2021-01-02 21:29:16 +01:00
83c9a188f5
[skip ci] update changelog 2021-01-02 00:14:03 +01:00
6195e2b10d
docs: switch to new certbot syntax 2021-01-02 00:09:37 +01:00
9db6aed30b
[skip ci] update changelog 2021-01-01 23:55:31 +01:00
3254740896
chore: use renovate preset config 2021-01-01 23:55:08 +01:00
e54630035f
chore: replace master by main as default branch 2021-01-01 23:49:54 +01:00
bf9e3db262
docs: add contributing information 2021-01-01 23:43:22 +01:00
5d82f47658
build: migrate to poetry (#3) 2021-01-01 23:39:20 +01:00
28feec7766
add dockerhub auth for ci 2020-11-27 14:13:10 +01:00
bf6aad3d78
Merge pull request #1 from thegeeklab/renovate/configure
Configure Renovate
2020-11-11 22:29:34 +01:00
69e5cc8e6e
disable droneci manager 2020-11-11 22:26:45 +01:00
Renovate Bot
9faafe7578
Add renovate.json 2020-11-11 21:08:25 +00:00
482a287070
fix license badge 2020-09-25 18:39:04 +02:00
21619c0349
pin parsedatetime 2020-09-24 21:29:52 +02:00
f76eac09b9
[skip ci] revert: force ci 2020-09-24 21:21:34 +02:00
bd8303eee8
force ci 2020-09-24 21:21:05 +02:00
ad1f46df4e
migrate to thegeeklab namespace 2020-09-24 21:19:25 +02:00
db9425fede [SKIP CI] update changelog 2020-05-12 21:10:46 +02:00
c35fb93f5f bump dependency to corenetworks>=0.1.4 2020-05-12 21:04:35 +02:00
ab7f76d016 bump dependency to corenetworks>=0.1.3 2020-05-12 09:30:44 +02:00
a7064ba637 bump dependency to corenetworks>=0.1.1 2020-05-11 19:17:11 +02:00
20 changed files with 1807 additions and 285 deletions

View File

@ -1,16 +1,18 @@
local PythonVersion(pyversion='2.7') = {
name: 'python' + std.strReplace(pyversion, '.', ''),
local PythonVersion(pyversion='3.6') = {
name: 'python' + std.strReplace(pyversion, '.', '') + '-pytest',
image: 'python:' + pyversion,
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -r dev-requirements.txt -qq',
'pip install -qq .',
'pytest tests --cov=certbot_dns_corenetworks --no-cov-on-fail',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install',
'poetry run pytest',
'poetry version',
],
depends_on: [
'clone',
'fetch',
],
};
@ -23,20 +25,36 @@ local PipelineLint = {
},
steps: [
{
name: 'flake8',
image: 'python:3.8',
name: 'yapf',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -r dev-requirements.txt -qq',
'pip install -qq .',
'flake8 ./certbot_dns_corenetworks',
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install',
'poetry run yapf -dr ./certbot_dns_corenetworks',
],
},
{
name: 'flake8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install',
'poetry run flake8 ./certbot_dns_corenetworks',
],
},
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
@ -48,14 +66,20 @@ local PipelineTest = {
arch: 'amd64',
},
steps: [
PythonVersion(pyversion='2.7'),
PythonVersion(pyversion='3.5'),
{
name: 'fetch',
image: 'python:3.9',
commands: [
'git fetch -tq',
],
},
PythonVersion(pyversion='3.6'),
PythonVersion(pyversion='3.7'),
PythonVersion(pyversion='3.8'),
PythonVersion(pyversion='3.9'),
{
name: 'codecov',
image: 'python:3.8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
CODECOV_TOKEN: { from_secret: 'codecov_token' },
@ -65,11 +89,10 @@ local PipelineTest = {
'codecov --required -X gcov',
],
depends_on: [
'python27',
'python35',
'python36',
'python37',
'python38',
'python36-pytest',
'python37-pytest',
'python38-pytest',
'python39-pytest',
],
},
],
@ -77,7 +100,7 @@ local PipelineTest = {
'lint',
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
@ -91,14 +114,16 @@ local PipelineSecurity = {
steps: [
{
name: 'bandit',
image: 'python:3.8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -r dev-requirements.txt -qq',
'pip install -qq .',
'bandit -r ./certbot_dns_corenetworks -x ./certbot_dns_corenetworks/test',
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install',
'poetry run bandit -r ./certbot_dns_corenetworks -x ./certbot_dns_corenetworks/test',
],
},
],
@ -106,7 +131,7 @@ local PipelineSecurity = {
'test',
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
@ -120,12 +145,11 @@ local PipelineBuildPackage = {
steps: [
{
name: 'build',
image: 'python:3.8',
environment: {
SETUPTOOLS_SCM_PRETEND_VERSION: '${DRONE_TAG##v}',
},
image: 'python:3.9',
commands: [
'python setup.py sdist bdist_wheel',
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
},
{
@ -151,12 +175,15 @@ local PipelineBuildPackage = {
},
{
name: 'publish-pypi',
image: 'plugins/pypi',
settings: {
username: { from_secret: 'pypi_username' },
password: { from_secret: 'pypi_password' },
repository: 'https://upload.pypi.org/legacy/',
skip_build: true,
image: 'python:3.9',
commands: [
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry publish -n',
],
environment: {
POETRY_HTTP_BASIC_PYPI_USERNAME: { from_secret: 'pypi_username' },
POETRY_HTTP_BASIC_PYPI_PASSWORD: { from_secret: 'pypi_password' },
},
when: {
ref: ['refs/tags/**'],
@ -167,7 +194,7 @@ local PipelineBuildPackage = {
'security',
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
@ -198,7 +225,7 @@ local PipelineNotifications = {
'build-package',
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**'],
ref: ['refs/heads/main', 'refs/tags/**'],
status: ['success', 'failure'],
},
};

View File

@ -7,18 +7,31 @@ platform:
arch: amd64
steps:
- name: flake8
image: python:3.8
- name: yapf
image: python:3.9
commands:
- pip install -r dev-requirements.txt -qq
- pip install -qq .
- flake8 ./certbot_dns_corenetworks
- git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install
- poetry run yapf -dr ./certbot_dns_corenetworks
environment:
PY_COLORS: 1
- name: flake8
image: python:3.9
commands:
- git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install
- poetry run flake8 ./certbot_dns_corenetworks
environment:
PY_COLORS: 1
trigger:
ref:
- refs/heads/master
- refs/heads/main
- refs/tags/**
- refs/pull/**
@ -31,63 +44,65 @@ platform:
arch: amd64
steps:
- name: python27
image: python:2.7
- name: fetch
image: python:3.9
commands:
- pip install -r dev-requirements.txt -qq
- pip install -qq .
- pytest tests --cov=certbot_dns_corenetworks --no-cov-on-fail
environment:
PY_COLORS: 1
depends_on:
- clone
- git fetch -tq
- name: python35
image: python:3.5
commands:
- pip install -r dev-requirements.txt -qq
- pip install -qq .
- pytest tests --cov=certbot_dns_corenetworks --no-cov-on-fail
environment:
PY_COLORS: 1
depends_on:
- clone
- name: python36
- name: python36-pytest
image: python:3.6
commands:
- pip install -r dev-requirements.txt -qq
- pip install -qq .
- pytest tests --cov=certbot_dns_corenetworks --no-cov-on-fail
- pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install
- poetry run pytest
- poetry version
environment:
PY_COLORS: 1
depends_on:
- clone
- fetch
- name: python37
- name: python37-pytest
image: python:3.7
commands:
- pip install -r dev-requirements.txt -qq
- pip install -qq .
- pytest tests --cov=certbot_dns_corenetworks --no-cov-on-fail
- pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install
- poetry run pytest
- poetry version
environment:
PY_COLORS: 1
depends_on:
- clone
- fetch
- name: python38
- name: python38-pytest
image: python:3.8
commands:
- pip install -r dev-requirements.txt -qq
- pip install -qq .
- pytest tests --cov=certbot_dns_corenetworks --no-cov-on-fail
- pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install
- poetry run pytest
- poetry version
environment:
PY_COLORS: 1
depends_on:
- clone
- fetch
- name: python39-pytest
image: python:3.9
commands:
- pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install
- poetry run pytest
- poetry version
environment:
PY_COLORS: 1
depends_on:
- fetch
- name: codecov
image: python:3.8
image: python:3.9
commands:
- pip install codecov -qq
- codecov --required -X gcov
@ -96,15 +111,14 @@ steps:
from_secret: codecov_token
PY_COLORS: 1
depends_on:
- python27
- python35
- python36
- python37
- python38
- python36-pytest
- python37-pytest
- python38-pytest
- python39-pytest
trigger:
ref:
- refs/heads/master
- refs/heads/main
- refs/tags/**
- refs/pull/**
@ -121,17 +135,19 @@ platform:
steps:
- name: bandit
image: python:3.8
image: python:3.9
commands:
- pip install -r dev-requirements.txt -qq
- pip install -qq .
- bandit -r ./certbot_dns_corenetworks -x ./certbot_dns_corenetworks/test
- git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install
- poetry run bandit -r ./certbot_dns_corenetworks -x ./certbot_dns_corenetworks/test
environment:
PY_COLORS: 1
trigger:
ref:
- refs/heads/master
- refs/heads/main
- refs/tags/**
- refs/pull/**
@ -148,11 +164,11 @@ platform:
steps:
- name: build
image: python:3.8
image: python:3.9
commands:
- python setup.py sdist bdist_wheel
environment:
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
- git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: checksum
image: alpine
@ -175,13 +191,15 @@ steps:
- refs/tags/**
- name: publish-pypi
image: plugins/pypi
settings:
password:
image: python:3.9
commands:
- git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry publish -n
environment:
POETRY_HTTP_BASIC_PYPI_PASSWORD:
from_secret: pypi_password
repository: https://upload.pypi.org/legacy/
skip_build: true
username:
POETRY_HTTP_BASIC_PYPI_USERNAME:
from_secret: pypi_username
when:
ref:
@ -189,7 +207,7 @@ steps:
trigger:
ref:
- refs/heads/master
- refs/heads/main
- refs/tags/**
- refs/pull/**
@ -224,7 +242,7 @@ steps:
trigger:
ref:
- refs/heads/master
- refs/heads/main
- refs/tags/**
status:
- success
@ -235,6 +253,6 @@ depends_on:
---
kind: signature
hmac: 09f1f5c2f46dd90b159b5c5de705afce849ea7fb4772b96aa9827a6d6bb97e3e
hmac: 5b86a521681485b2518a6bd3ff3e490bb07d076ac94d26ff84b86749b3d045fc
...

19
.flake8
View File

@ -1,18 +1,3 @@
[flake8]
ignore = D103, D107, W503
max-line-length = 99
inline-quotes = double
exclude =
.git
.tox
__pycache__
build
dist
test*
*.pyc
*.egg-info
.cache
.eggs
env*
application-import-names = corenetworks
format = ${cyan}%(path)s:%(row)d:%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
# Requires `flake8-colors`. This is the formatting suggested by the package (and used in flake8 repository itself).
format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s

View File

@ -10,7 +10,7 @@ repository:
has_wiki: false
has_downloads: false
default_branch: master
default_branch: main
allow_squash_merge: true
allow_merge_commit: true
@ -46,14 +46,12 @@ labels:
description: This will not be worked on
branches:
- name: master
- name: main
protection:
required_pull_request_reviews: null
required_status_checks:
strict: true
strict: false
contexts:
- continuous-integration/drone/pr
enforce_admins: null
restrictions: null
...

View File

@ -1,2 +1,7 @@
* BUGFIX
* bump corenetworks library to version>=0.1.1 to fix env variable usage
# Changelog
## v0.2.1 (2021-03-20)
### Breaking Changes
- **Discontinued:** This project is no longer maintained

31
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,31 @@
# Contributing
## Security
If you think you have found a **security issue**, please do not mention it in this repository.
Instead, send an email to security@thegeeklab.de with as many details as possible so it can be handled confidential.
## Bug Reports and Feature Requests
If you have found a **bug** or have a **feature request** please use the search first in case a similar issue already exists.
If not, please create an issue in this repository
## Code
If you would like to fix a bug or implement a feature, please fork the repository and create a Pull Request.
Before you start any Pull Request, it is recommended that you create an issue to discuss first if you have any
doubts about requirement or implementation. That way you can be sure that the maintainer(s) agree on what to change and how,
and you can hopefully get a quick merge afterwards.
Pull Requests can only be merged once all status checks are green.
## Do not force push to your Pull Request branch
Please do not force push to your Pull Requests branch after you have created your Pull Request, as doing so makes it harder for us to review your work.
Pull Requests will always be squashed by us when we merge your work. Commit as many times as you need in your Pull Request branch.
## Re-requesting a review
Please do not ping your reviewer(s) by mentioning them in a new comment. Instead, use the re-request review functionality.
Read more about this in the [GitHub docs, Re-requesting a review](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request#re-requesting-a-review).

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 Robert Kaussow <mail@geeklabor.de>
Copyright (c) 2021 Robert Kaussow <mail@thegeeklab.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,11 +1,14 @@
# certbot-dns-corenetworks
[![Build Status](https://img.shields.io/drone/build/xoxys/certbot-dns-corenetworks?logo=drone)](https://cloud.drone.io/xoxys/certbot-dns-corenetworks)
[![Build Status](https://img.shields.io/drone/build/thegeeklab/certbot-dns-corenetworks?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/certbot-dns-corenetworks)
[![Python Version](https://img.shields.io/pypi/pyversions/certbot-dns-corenetworks.svg)](https://pypi.org/project/certbot-dns-corenetworks/)
[![PyPi Status](https://img.shields.io/pypi/status/certbot-dns-corenetworks.svg)](https://pypi.org/project/certbot-dns-corenetworks/)
[![PyPi Release](https://img.shields.io/pypi/v/certbot-dns-corenetworks.svg)](https://pypi.org/project/certbot-dns-corenetworks/)
[![Codecov](https://img.shields.io/codecov/c/github/xoxys/certbot-dns-corenetworks)](https://codecov.io/gh/xoxys/certbot-dns-corenetworks)
[![License: MIT](https://img.shields.io/github/license/xoxys/certbot-dns-corenetworks)](LICENSE)
[![Codecov](https://img.shields.io/codecov/c/github/thegeeklab/certbot-dns-corenetworks)](https://codecov.io/gh/thegeeklab/certbot-dns-corenetworks)
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/certbot-dns-corenetworks)](https://github.com/thegeeklab/certbot-dns-corenetworks/graphs/contributors)
[![License: MIT](https://img.shields.io/github/license/thegeeklab/certbot-dns-corenetworks)](https://github.com/thegeeklab/certbot-dns-corenetworks/blob/main/LICENSE)
> **Discontinued:** This project is no longer maintained.
## Install
@ -19,17 +22,17 @@ pip install certbot-dns-corenetworks
To start using DNS authentication for the Core Networks DNS API, pass the following arguments on certbot's command line:
| Option | Description |
|----------------------------------------------------------------------|--------------------------------------------------|
| `--authenticator certbot-dns-corenetworks:dns-corenetworks` | select the authenticator plugin (Required) |
| `--certbot-dns-corenetworks:dns-corenetworks-credentials` | Hetzner DNS API credentials INI file. (Required) |
| `--certbot-dns-corenetworks:dns-corenetworks-propagation-seconds` | Seconds to wait for the TXT record to propagate |
| Option | Description |
| ---------------------------------------- | ------------------------------------------------ |
| `--authenticator dns-corenetworks` | select the authenticator plugin (Required) |
| `--dns-corenetworks-credentials` | Hetzner DNS API credentials INI file. (Required) |
| `--dns-corenetworks-propagation-seconds` | Seconds to wait for the TXT record to propagate |
## Credentials
```ini
certbot_dns_corenetworks:dns_corenetworks_username = asaHB12r
certbot_dns_corenetworks:dns_corenetworks_password = secure_passwor
dns_corenetworks_username = asaHB12r
dns_corenetworks_password = secure_passwor
```
## Examples
@ -37,25 +40,26 @@ certbot_dns_corenetworks:dns_corenetworks_password = secure_passwor
To acquire a certificate for `example.com`
```bash
certbot certonly \\
--authenticator certbot-dns-corenetworks:dns-corenetworks \\
--certbot-dns-corenetworks:dns-corenetworks-credentials /path/to/my/credentials.ini \\
certbot certonly \
--authenticator dns-corenetworks \
--dns-corenetworks-credentials /path/to/my/credentials.ini \
-d example.com
```
To acquire a certificate for ``*.example.com``
To acquire a certificate for `*.example.com`
```bash
certbot certonly \\
--authenticator certbot-dns-corenetworks:dns-corenetworks \\
--certbot-dns-corenetworks:dns-corenetworks-credentials /path/to/my/credentials.ini \\
certbot certonly \
--authenticator dns-corenetworks \
--dns-corenetworks-credentials /path/to/my/credentials.ini \
-d '*.example.com'
```
## Contributors
Special thanks goes to all [contributors](https://github.com/thegeeklab/certbot-dns-corenetworks/graphs/contributors). If you would like to contribute,
please see the [instructions](https://github.com/thegeeklab/certbot-dns-corenetworks/blob/main/CONTRIBUTING.md).
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Maintainers and Contributors
[Robert Kaussow](https://github.com/xoxys)
This project is licensed under the MIT License - see the [LICENSE](https://github.com/thegeeklab/certbot-dns-corenetworks/blob/main/LICENSE) file for details.

View File

@ -1,10 +1,4 @@
# -*- coding: utf-8 -*-
"""Default package."""
__author__ = "Robert Kaussow"
__project__ = "certbot_dns_corenetworks"
__license__ = "MIT"
__maintainer__ = "Robert Kaussow"
__email__ = "mail@geeklabor.de"
__url__ = "https://github.com/xoxys/certbot-dns-corenetworks"
__version__ = "0.1.1"
__version__ = "0.0.0"

View File

@ -2,7 +2,7 @@
import logging
import re
import zope.interface # noqa
import zope.interface
from certbot import errors
from certbot import interfaces
from certbot.plugins import dns_common
@ -33,7 +33,7 @@ class Authenticator(dns_common.DNSAuthenticator):
self.credentials = None
@classmethod
def add_parser_arguments(cls, add): # noqa
def add_parser_arguments(cls, add):
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=60)
add(
"credentials",
@ -41,7 +41,7 @@ class Authenticator(dns_common.DNSAuthenticator):
default="/etc/letsencrypt/corenetworks.cfg"
)
def more_info(self): # noqa
def more_info(self):
return "This plugin configures a DNS TXT record to respond to a dns-01 challenge using " \
"the Core Networks DNS API."

View File

@ -34,7 +34,6 @@ class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthentic
self.auth = Authenticator(self.config, "corenetworks")
self.mock_client = mock.MagicMock()
# _get_corenetworks_client | pylint: disable=protected-access
self.auth._get_corenetworks_client = mock.MagicMock(return_value=self.mock_client)
def test_perform(self):
@ -46,7 +45,6 @@ class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthentic
self.assertEqual(expected, self.mock_client.mock_calls)
def test_cleanup(self):
# _attempt_cleanup | pylint: disable=protected-access
self.auth.nameCache["_acme-challenge." + DOMAIN] = "_acme-challenge." + DOMAIN
self.auth._attempt_cleanup = True
self.auth.cleanup([self.achall])

21
codecov.yml Normal file
View File

@ -0,0 +1,21 @@
codecov:
require_ci_to_pass: true
coverage:
status:
project:
default:
target: auto
threshold: 5%
branches:
- main
if_ci_failed: error
informational: false
only_pulls: false
patch:
default:
target: auto
threshold: 5%
branches:
- main
if_ci_failed: error
only_pulls: false

View File

@ -1,20 +0,0 @@
pydocstyle
flake8
flake8-colors
flake8-blind-except
flake8-builtins
flake8-docstrings
flake8-isort
flake8-logging-format
flake8-polyfill
flake8-quotes
flake8-pep3101
flake8-eradicate; python_version >= "3.6"
pep8-naming
wheel
mock
pytest
pytest-mock
pytest-cov
bandit
yapf

1447
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

94
pyproject.toml Normal file
View File

@ -0,0 +1,94 @@
[tool.poetry]
authors = ["Robert Kaussow <mail@thegeeklab.de>"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Plugins",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Security",
"Topic :: System :: Networking",
"Topic :: Utilities",
]
description = "Core Networks DNS Authenticator plugin for Certbot."
documentation = "https://github.com/thegeeklab/certbot-dns-corenetworks/"
homepage = "https://github.com/thegeeklab/certbot-dns-corenetworks/"
include = [
"LICENSE",
]
keywords = ["dns", "certbot", "automation", "corenetworks"]
license = "MIT"
name = "certbot-dns-corenetworks"
packages = [
{include = "certbot_dns_corenetworks"},
]
readme = "README.md"
repository = "https://github.com/thegeeklab/certbot-dns-corenetworks/"
version = "0.0.0"
[tool.poetry.plugins."certbot.plugins"]
dns-corenetworks = "certbot_dns_corenetworks.dns_corenetworks:Authenticator"
[tool.poetry.dependencies]
acme = "^1.10.1"
certbot = "^1.10.1 "
corenetworks = "^0.2.0"
parsedatetime = "^2.6"
python = "^3.6.0"
"zope.interface" = "^5.2.0"
[tool.poetry.dev-dependencies]
bandit = "^1.7.0"
flake8 = "^3.8.4"
flake8-blind-except = "^0.2.0"
flake8-builtins = "^1.5.3"
flake8-colors = "^0.1.9"
flake8-docstrings = "^1.5.0"
flake8-eradicate = "^1.0.0"
flake8-isort = "^4.0.0"
flake8-logging-format = "^0.6.0"
flake8-pep3101 = "^1.3.0"
flake8-polyfill = "^1.0.2"
flake8-quotes = "^3.2.0"
mock = "^4.0.3"
pep8-naming = "^0.11.1"
pydocstyle = "^6.0.0"
pytest = "^6.2.1"
pytest-cov = "^2.10.1"
pytest-mock = "^3.4.0"
yapf = "^0.31.0"
[tool.poetry-dynamic-versioning]
enable = true
style = "semver"
vcs = "git"
[tool.isort]
default_section = "THIRDPARTY"
force_single_line = true
line_length = 99
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
skip_glob = ["**/.env*", "**/env/*", "**/.venv/*", "**/docs/*"]
[tool.pytest.ini_options]
addopts = "certbot_dns_corenetworks --cov=certbot_dns_corenetworks --cov-report=xml:coverage.xml --cov-report=term --cov-append --no-cov-on-fail"
filterwarnings = [
"ignore::FutureWarning",
"ignore:.*collections.*:DeprecationWarning",
"ignore:.*pep8.*:FutureWarning",
]
[tool.coverage.run]
omit = ["**/test/*"]
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]

4
renovate.json Normal file
View File

@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>thegeeklab/renovate-presets"]
}

View File

@ -1,17 +1,20 @@
[metadata]
description-file = README.md
license_file = LICENSE
[bdist_wheel]
universal = 1
[isort]
default_section = THIRDPARTY
known_first_party = certbot_dns_corenetworks
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
force_single_line = true
line_length = 99
skip_glob = **/.env*,**/env/*,**/docs/*
[flake8]
# Explanation of errors
#
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D107: Missing docstring in __init__
# D202: No blank lines allowed after function docstring
# W503:Line break occurred before a binary operator
ignore = D102, D103, D107, D202, W503
max-line-length = 99
inline-quotes = double
exclude = .git, __pycache__, build, dist, test, *.pyc, *.egg-info, .cache, .eggs, env*
# NOTE: The format for flake8 output is set in the `.flake8` file. This is separate
# because `setup.cfg` is parsed on setup, but it would require flake8-colors
# to run successfully (which will only be available after install). So we define
# it in `.flake8`, and it seems to successfully combine the settings in the
# two files together.
[yapf]
based_on_style = google
@ -19,12 +22,3 @@ column_limit = 99
dedent_closing_brackets = true
coalesce_brackets = true
split_before_logical_operator = true
[tool:pytest]
filterwarnings =
ignore::FutureWarning
ignore:.*collections.*:DeprecationWarning
ignore:.*pep8.*:FutureWarning
[coverage:run]
omit = **/test/*

View File

@ -1,78 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup script for the package."""
import io
import os
import re
from setuptools import find_packages
from setuptools import setup
PACKAGE_NAME = "certbot_dns_corenetworks"
def get_property(prop, project):
current_dir = os.path.dirname(os.path.realpath(__file__))
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(os.path.join(current_dir, project, "__init__.py")).read(),
)
return result.group(1)
def get_readme(filename="README.md"):
this = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(this, filename), encoding="utf-8") as f:
long_description = f.read()
return long_description
setup(
name=get_property("__project__", PACKAGE_NAME),
description="Core Networks DNS Authenticator plugin for Certbot",
keywords="dns, certbot, automation, corenetworks",
version=get_property("__version__", PACKAGE_NAME),
author=get_property("__author__", PACKAGE_NAME),
author_email=get_property("__email__", PACKAGE_NAME),
url=get_property("__url__", PACKAGE_NAME),
license=get_property("__license__", PACKAGE_NAME),
long_description=get_readme(),
long_description_content_type="text/markdown",
packages=find_packages(exclude=["*.test", "test", "test.*"]),
include_package_data=True,
zip_safe=False,
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,<4",
entry_points={
"certbot.plugins": [
"dns-corenetworks = certbot_dns_corenetworks.dns_corenetworks:Authenticator"
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Plugins",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Security",
"Topic :: System :: Networking",
"Topic :: Utilities",
],
install_requires=[
"acme",
"certbot>=0.15",
"setuptools",
"zope.interface",
"corenetworks>=0.1.1",
],
dependency_links=[],
)