Skip to content

Commit 83e8bca

Browse files
committed
RADAS: add default ignore patterns for signing
1 parent e32526b commit 83e8bca

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

charon/cmd/cmd_sign.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from charon.config import get_config
1919
from charon.pkgs.radas_sign import sign_in_radas
2020
from charon.cmd.internal import _decide_mode
21+
from charon.constants import DEFAULT_RADAS_SIGN_IGNORES
2122

2223
from click import command, option, argument
2324

@@ -98,8 +99,7 @@ def sign(
9899
ignore_patterns: List[str] = None,
99100
config: str = None,
100101
debug=False,
101-
quiet=False,
102-
dryrun=False
102+
quiet=False
103103
):
104104
"""Do signing against files in the repo zip in repo_url through
105105
radas service. The repo_url points to the maven zip repository
@@ -119,8 +119,10 @@ def sign(
119119
sys.exit(1)
120120
# All ignore files in global config should also be ignored in signing.
121121
ig_patterns = conf.get_ignore_patterns()
122+
ig_patterns.extend(DEFAULT_RADAS_SIGN_IGNORES)
122123
if ignore_patterns:
123124
ig_patterns.extend(ignore_patterns)
125+
ig_patterns = list(set(ig_patterns))
124126
args = {
125127
"repo_url": repo_url,
126128
"requester": requester,

charon/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,8 @@
177177
DEFAULT_REGISTRY = "localhost"
178178
DEFAULT_RADAS_SIGN_TIMEOUT_RETRY_COUNT = 10
179179
DEFAULT_RADAS_SIGN_TIMEOUT_RETRY_INTERVAL = 60
180+
181+
DEFAULT_RADAS_SIGN_IGNORES = [
182+
r".*\.md5$", r".*\.sha1$", r".*\.sha128$", r".*\.sha256$",
183+
r".*\.sha512$", r".*\.asc$"
184+
]

0 commit comments

Comments
 (0)