diff --git a/CHANGELOG.md b/CHANGELOG.md index f87ce0dc1..40bc9c60a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,19 @@ and this project adheres to [Semantic Versioning][semver]. ### Added + +- Implement removal and rotation of keys [(561)] + ### Changed +Transition to the newest version of TUF [(561)] + ### Fixed +[561]: https://github.com/openlawlibrary/taf/pull/561 + + ## [0.33.1] ### Added @@ -30,6 +38,7 @@ and this project adheres to [Semantic Versioning][semver]. [579]: https://github.com/openlawlibrary/taf/pull/579 [577]: https://github.com/openlawlibrary/taf/pull/577 + ## [0.33.0] ### Added diff --git a/docs/architecture.md b/docs/architecture.md index 1209708a7..5d97497df 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -160,13 +160,11 @@ To validate commits that could be decades old without being obstructed by expire This module encapsulates the `GitRepository` class, a high-level abstraction over Git operations, designed to interface directly with Git repositories at the filesystem level. The `GitRepository` class serves as an intermediary, enabling programmatic access to Git actions including: creating branches, working with commits, and working with remotes. It leverages [`pygit2`](https://www.pygit2.org/) for some of the interactions with Git. Other interactions use direct shell command execution via subprocess for operations not covered by `pygit2` or where direct command invocation is preferred for efficiency or functionality reasons. -### `taf/repository_tool.py` +### `taf/tuf/repository` -Contains a `Repository` class, which is a wrapper around TUF's repository, making it simple to execute important updates, like -adding new signing keys, updating and signing metadata files and extracting information about roles, keys, -delegations and targets. - -NOTE: Long-term plan is to rework this part of the codebase. This is necessary to transition to the newest version of TUF, since it is relying on parts which no longer exist in newer TUF. +Contains a `MetadataRepository` class, which is an implementation of TUF's `Repository` class for editing metadata. +It simplifies the execution of important updates such as adding new signing keys, updating and signing metadata +files, and extracting information about roles, keys, delegations, and targets. ### `taf/auth_repo.py` diff --git a/docs/developers/repository-classes.md b/docs/developers/repository-classes.md index 19dc95f7e..cd074210d 100644 --- a/docs/developers/repository-classes.md +++ b/docs/developers/repository-classes.md @@ -1,18 +1,18 @@ # Repositories -As a tool focused on creation and secure update of Git repositories (authentication repositories and their -targets), TAF contains classes and functions which strive to make integration with Git and TUF as easy as possible. -`GitRepository` can be seen as a wrapper around git calls which make it possible to interact with the actual `Git` -repository located on the file system. E.g. to create a new branch, list commits, push to the remote etc. -On the other hand, `Repository` class contained by the `repository_tool` module can instantiate a TUF repository, -provided that the directory passed to it contains metadata files expected to be found in such a repository. It also -implements important TUF concepts, such as adding a new delegated role, determine which role is responsible for which -target file, add TUF targets etc. An authentication repository can be seen as a Git repository which is also a TUF repository - it -contains TUF's metadata and target files and a `.git` folder. TAF's `auth_repo` module's `AuthenticationRepository` -class follows that logic and is derived from the two previously mentioned base classes. Finally, `repositoriesdb` -is a module inspired by TUF's modules like `keysdb`, which deals with instantiation of repositories and stores the -created classes inside a "database" - a dictionary which maps authentication repositories and their commits -to lists of their target repositories at certain revisions. +As a tool focused on the creation and secure update of Git repositories (authentication repositories and their +targets), TAF contains classes and functions that strive to make integration with Git and TUF as simple as possible. +`GitRepository` acts as a wrapper around Git calls, enabling interaction with the actual `Git` repository on the file +system, e.g., creating a new branch, listing, creating, and pushing commits, etc. Conversely, the `MetadataRepository` +class in `tuf/repository.py` extends TUF's `Repository` class, an abstract class for metadata modifying implementations. +It provides implementations of crucial TUF concepts, such as adding a new delegated role, determining which role is +responsible for which target file, and adding TUF targets etc. An authentication repository can be seen as a Git +repository that is also a TUF repository. It contains TUF's metadata and target files and a `.git` folder. TAF's +`auth_repo` module's `AuthenticationRepository` class follows that logic and is derived from the two previously +mentioned base classes. Finally, `repositoriesdb` is a module inspired by TUF's modules like `keysdb`, which deals with +the instantiation of repositories and stores the created classes inside a "database" - a dictionary which maps +authentication repositories and their commits to lists of their target repositories at certain revisions. Note: the +concept of databases has been removed from TUF and removal of `repositoriesdb` is also planned in case of TAF. ## GitRepository @@ -66,44 +66,40 @@ repo.commit_empty('An example message') repo.push() ``` -## Repository tool's `Repository` +## Implementation of TUF's `Repository` class (`tuf/repository/MetadataRepository`) + +This class extends TUF's repository interface, providing features for executing metadata updates, such as +adding new signing keys, updating and signing metadata files, and extracting information about roles, +keys, delegations, and targets. It can be used to create a new TUF repository, retrieve information about +a TUF repository, or update its metadata files. TAF's implementation of the repository class follows the +convention of separating metadata and target files into directories named `metadata` and `target`: -This class can be seen as a wrapper around a TUF repository, making it simple to execute important updates, like -adding new signing keys, updating and signing metadata files and extracting information about roles, keys, -delegations and targets. It is instantiated by passing file system path which corresponds to a directory containing -all files and folders that a TUF repository expects. That means that `metadata` and `targets` folders have to exist -and that a valid `root.json` file needs to be found inside `metadata`. So: ``` - repo_root - metadata - root.json - targets ``` -Optionally, `name` attribute can also be specified during instantiation. It will be used to set name of the TUF's -repository instance. This value is set to `default` if not provided. If more than one repository is to be used -at the same time, it is important to set distinct names. - -TUF repository is instantiated lazily the first time it is needed. This object is not meant to be used directly. -The main purpose of TAF's repository class is to group operations which enable valid update of TUF metadata and acquiring -information like can a key be used to sign a certain metadata file or finding roles that are linked with -the provided public key. To set up a new repository or add a new signing key, it is recommended to use the -`developer_tool` module since it contains full implementations of these complex functionalities. Functionalities -like updating targets and signing metadata or updating a metadata's expiration date are fully covered by repository -class's methods and can be used directly. These include: -- `update_timestamp_keystores`, `update_snapshot_keystores` (`update_rolename_keystores`) and `update_role_keystores` (for delegated roles) --`update_timestamp_yubikeys`, `update_snapshot_yubikeys` (`update_rolename_yubikeys`) and `update_role_yubikeys` (for delegated roles) - -If `added_targets_data` or `removed_targets_data` is passed in when calling these methods (only applicable to -`targets` and delegated target roles), information about target files will be updated and the corresponding metadata -file will be signed. Its expiration date will be updated too. If there is targets data or if the called method -corresponds to a non-targets role, the metadata file's expiration will still be updated and the file will be signed. + +It is instantiated by providing the repository's path. Unlike the previous implementation, which was based on an +older version of TUF, this repository does not have, nor does it need, a name. The class can be instantiated +regardless of whether there are `metadata` files located at `path/metadata`. In fact, it is possible to read the +metadata and target files from mediums other than the local file system. TUF enables such flexibility by allowing +custom implementations of the `StorageBackendInterface`. These implementations can redefine how metadata and target +files are read and written. To instantiate a `MetadataRepository` class with a custom storage interface, use the +`storage` keyword argument. If not specified, TUF's default `FilesystemBackend` will be used. The other available +option is `GitStorageBackend`. This implementation loads data from a specific commit if the commit is specified, +or from the filesystem if the commit is `None`, by extending `FilesystemBackend`. + +This class is used extensively to implement API functions. ## `AuthenticationRepository` -This class is derived from both `GitRepository` and TAF's `Repository`. Authentication repositories are expected -to contain TUF metadata and target files, but are also Git repositories. It is important to note that only files -inside the `targets` folder are tracked and secured by TUF. +This class is derived from `GitRepository`, and indirectly from `MetadataRepository`. Authentication repositories are +expected to contain TUF metadata and target files, but are also Git repositories. It is important to note that only +files inside the `targets` folder are tracked and secured by TUF. + Instances of the `AuthenticationRepository` are created by passing the same arguments as to `GitRepository` (`library_dir`, `name`, `urls`, `custom`, `default_branch`, `allow_unsafe` and `path` which can replace `library_dir` and `name` combination), as well as some optional additional arguments: - `conf_directory_root` - path to the directory where the `last_validated_commit` will be stored. diff --git a/docs/testing/testing_notes.md b/docs/testing/testing_notes.md deleted file mode 100644 index 0ebccc1dd..000000000 --- a/docs/testing/testing_notes.md +++ /dev/null @@ -1,57 +0,0 @@ -# Developer tool - -## Setting up repositories - -### Yubikey flow - -1. `taf repo create ./law --keys-description ./data/keys.json --commit-msg "Generated initial metadata"` -2. `taf targets update-repos-from-fs ./law --library-dir ./data/targets --namespace test` -3. `taf targets generate-repositories-json ./law --library-dir ./data/targets --namespace test --custom data/custom_data.json` -4. `taf targets sign ./law` -5. `taf roles add-signing-key ./law --role targets` - -### Yubikey + Keystore flow - -1. `taf repo create ./law --keys-description ./data/keys.json --commit-msg "Generated initial roles" --keystore ./data/keystore/` -1. `taf targets update-repos-from-fs ./law --library-dir ./data/targets --namespace test` -1. `taf targets generate-repositories-json ./law --library-dir ./data/targets --namespace test --custom data/custom_data.json` -1. `taf targets sign --keystore ./data/keystore/` -1. `taf roles add-signing-key ./law --role targets` - -### keys.json - -``` -{ - "roles": { - "root": { - "yubikey": true, - "number": 3, - "length": 2048, - "threshold": 2 - }, - "targets": { - "yubikey": true, - "length": 2048 - }, - "snapshot": {}, - "timestamp": {} - } -} -``` - -### custom_data.json - -``` -{ - "test/law-xml": { - "type": "xml", - "allow-unauthenticated-commits": true - }, - "test/law-xml-codified": { - "type": "xml-codified" - }, - "test/law-html": { - "type": "html" - } -} -``` diff --git a/setup.py b/setup.py index 0c631291b..cd089f30d 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ "freezegun==0.3.15", "jsonschema==3.2.0", "jinja2==3.1.*", + "pytest-mock==3.14.*", ] yubikey_require = ["yubikey-manager==5.5.*"] @@ -54,13 +55,13 @@ "cattrs>=23.1.2", "click==8.*", "colorama>=0.3.9", - "oll-tuf==0.20.0.dev2", - "cryptography==38.0.*", - "securesystemslib==0.25.*", + "tuf==5.*", + "cryptography==43.0.*", + "securesystemslib==1.*", "loguru==0.7.*", 'pygit2==1.9.*; python_version < "3.11"', 'pygit2==1.14.*; python_version >= "3.11"', - "pyOpenSSL==22.1.*", + "pyOpenSSL==24.2.*", "logdecorator==2.*", ], "extras_require": { diff --git a/taf/api/api_workflow.py b/taf/api/api_workflow.py new file mode 100644 index 000000000..e8073bdeb --- /dev/null +++ b/taf/api/api_workflow.py @@ -0,0 +1,118 @@ +from contextlib import contextmanager +from pathlib import Path +from typing import Dict, List, Optional, Union + +from taf.api.utils._conf import find_keystore +from taf.auth_repo import AuthenticationRepository +from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME +from taf.exceptions import PushFailedError, TAFError +from taf.keys import load_signers +from taf.log import taf_logger +from taf.messages import git_commit_message +from taf.constants import METADATA_DIRECTORY_NAME + + +@contextmanager +def transactional_execution(auth_repo): + initial_commit = auth_repo.head_commit_sha() + try: + yield + except PushFailedError: + pass + except Exception: + auth_repo.reset_to_commit(initial_commit, hard=True) + raise + + +@contextmanager +def manage_repo_and_signers( + auth_repo: AuthenticationRepository, + roles: Optional[List[str]] = None, + keystore: Optional[Union[str, Path]] = None, + scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, + prompt_for_keys: Optional[bool] = False, + paths_to_reset_on_error: Optional[List[Union[str, Path]]] = None, + load_roles: Optional[bool] = True, + load_parents: Optional[bool] = False, + load_snapshot_and_timestamp: Optional[bool] = True, + commit: Optional[bool] = True, + push: Optional[bool] = True, + commit_key: Optional[str] = None, + commit_msg: Optional[str] = None, + no_commit_warning: Optional[bool] = True, +): + """ + A context manager that loads all signers and adds them to the specified authentication repository's + signers cache. This allows for the execution of other methods without having to update the + signers cache manually. Optionally, at the end, the context manager commits and pushes all changes made + to the authentication repository and handles cleanup in case of an error. + + Arguments: + auth_repo (AuthenticationRepository): Already instantiated authentication repository. + roles (Optional[List[str]]): List of roles that are expected to be updated. + keystore (Optional[Union[str, Path]]): Path to the keystore containing signing keys. + scheme (Optional[str]): The signature scheme. + prompt_for_keys (Optional[bool]): If True, prompts for keys if not found. Defaults to False. + paths_to_reset_on_error (Optional[List[Union[str, Path]]]): Paths to reset if an error occurs. + load_roles (Optional[bool]): If True, loads signing keys of the roles specified using the argument of the same name. + load_parents (Optional[bool]): If true, loads sining keys of the specified roles' parents. + load_snapshot_and_timestamp (Optional[bool]): If True, loads snapshot and timestamp signing keys. + commit (Optional[bool]): If True, commits changes to the repository. + push (Optional[bool]): If True, pushes changes to the remote repository. + commit_key (Optional[str]): Commit key from `messages.py` + commit_msg (Optional[str]): The message to use for commits. + no_commit_warning (Optional[bool]): If True, suppresses warnings when not committing. + """ + try: + roles_to_load = set() + if roles: + unique_roles = set(roles) + if load_roles: + roles_to_load.update(unique_roles) + if load_parents: + roles_to_load.update(auth_repo.find_parents_of_roles(unique_roles)) + if load_snapshot_and_timestamp: + roles_to_load.add("snapshot") + roles_to_load.add("timestamp") + if roles_to_load: + if not keystore: + keystore_path = find_keystore(auth_repo.path) + else: + keystore_path = Path(keystore) + loaded_yubikeys: Dict = {} + for role in roles_to_load: + if not auth_repo.check_if_keys_loaded(role): + keystore_signers, yubikey_signers = load_signers( + auth_repo, + role, + loaded_yubikeys=loaded_yubikeys, + keystore=keystore_path, + scheme=scheme, + prompt_for_keys=prompt_for_keys, + ) + auth_repo.add_signers_to_cache({role: keystore_signers}) + auth_repo.add_signers_to_cache({role: yubikey_signers}) + yield + if commit and auth_repo.something_to_commit(): + if not commit_msg and commit_key: + commit_msg = git_commit_message(commit_key) + auth_repo.commit_and_push(commit_msg=commit_msg, push=push) + elif not no_commit_warning: + taf_logger.log("NOTICE", "\nPlease commit manually\n") + + except PushFailedError: + raise + except Exception as e: + taf_logger.error(f"An error occurred: {e}") + if not paths_to_reset_on_error: + paths_to_reset_on_error = [METADATA_DIRECTORY_NAME] + elif METADATA_DIRECTORY_NAME not in paths_to_reset_on_error: + paths_to_reset_on_error.append(METADATA_DIRECTORY_NAME) + + if auth_repo.is_git_repository and paths_to_reset_on_error: + # restore metadata, leave targets as they might have been modified by the user + # TODO flag for also resetting targets? + # also update the CLI error handling] + auth_repo.restore([str(path) for path in paths_to_reset_on_error]) + + raise TAFError from e diff --git a/taf/api/dependencies.py b/taf/api/dependencies.py index b239dba59..c5be81827 100644 --- a/taf/api/dependencies.py +++ b/taf/api/dependencies.py @@ -2,12 +2,9 @@ from logging import DEBUG, ERROR from typing import Dict, Optional import click +from taf.api.targets import register_target_files import taf.repositoriesdb as repositoriesdb from logdecorator import log_on_end, log_on_error, log_on_start -from taf.api.utils._metadata import ( - update_snapshot_and_timestamp, - update_target_metadata, -) from taf.api.utils._git import check_if_clean from taf.messages import git_commit_message from pathlib import Path @@ -21,6 +18,33 @@ import taf.updater.updater as updater +def _add_to_dependencies( + auth_repo, branch_name, dependency_name, out_of_band_commit, custom +): + + # add to dependencies.json or update the entry + dependencies_json = repositoriesdb.load_dependencies_json(auth_repo) + + # if dependencies.json does not exist, initialize it + if not dependencies_json: + dependencies_json = {"dependencies": {}} + + dependencies = dependencies_json["dependencies"] + if dependency_name in dependencies: + print(f"{dependency_name} already added to dependencies.json. Overwriting") + dependencies[dependency_name] = { + "out-of-band-authentication": out_of_band_commit, + "branch": branch_name, + } + if custom: + dependencies[dependency_name]["custom"] = custom + + # update content of repositories.json before updating targets metadata + dependencies_path = Path(auth_repo.path, repositoriesdb.DEPENDENCIES_JSON_PATH) + dependencies_path.parent.mkdir(exist_ok=True) + Path(dependencies_path).write_text(json.dumps(dependencies_json, indent=4)) + + @log_on_start( DEBUG, "Adding or updating dependency {dependency_name:s}", logger=taf_logger ) @@ -125,61 +149,34 @@ def add_dependency( dependency, branch_name, out_of_band_commit, no_prompt ) else: - if branch_name is None or out_of_band_commit is None: - raise TAFError( - "Branch name and out-of-band commit must be specified if repository does not exist on disk" - ) if not no_prompt and not click.confirm( "Dependency not on disk. Proceed without validating branch and commit?" ): return - # add to dependencies.json or update the entry - dependencies_json = repositoriesdb.load_dependencies_json(auth_repo) - - # if dependencies.json does not exist, initialize it - if not dependencies_json: - dependencies_json = {"dependencies": {}} - - dependencies = dependencies_json["dependencies"] - if dependency_name in dependencies: - print(f"{dependency_name} already added to dependencies.json. Overwriting") - dependencies[dependency_name] = { - "out-of-band-authentication": out_of_band_commit, - "branch": branch_name, - } - if custom: - dependencies[dependency_name]["custom"] = custom - - # update content of repositories.json before updating targets metadata - dependencies_path = Path(auth_repo.path, repositoriesdb.DEPENDENCIES_JSON_PATH) - dependencies_path.parent.mkdir(exist_ok=True) - Path(dependencies_path).write_text(json.dumps(dependencies_json, indent=4)) + if branch_name is None or out_of_band_commit is None: + raise TAFError( + "Branch name and out-of-band commit must be specified if repository does not exist on disk" + ) - removed_targets_data: Dict = {} - added_targets_data: Dict = {repositoriesdb.DEPENDENCIES_JSON_NAME: {}} - update_target_metadata( - auth_repo, - added_targets_data, - removed_targets_data, - keystore, - write=False, + _add_to_dependencies( + auth_repo, branch_name, dependency_name, out_of_band_commit, custom + ) + commit_msg = git_commit_message("add-dependency", dependency_name=dependency_name) + register_target_files( + path=path, + keystore=keystore, + commit=commit, scheme=scheme, + auth_repo=auth_repo, + update_snapshot_and_timestamp=True, prompt_for_keys=prompt_for_keys, + push=push, + no_commit_warning=True, + reset_updated_targets_on_error=True, + commit_msg=commit_msg, ) - # update snapshot and timestamp calls write_all, so targets updates will be saved too - update_snapshot_and_timestamp( - auth_repo, keystore, scheme=scheme, prompt_for_keys=prompt_for_keys - ) - if commit: - commit_msg = git_commit_message( - "add-dependency", dependency_name=dependency_name - ) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - else: - print("\nPlease commit manually.\n") - @log_on_start(DEBUG, "Remove dependency {dependency_name:s}", logger=taf_logger) @log_on_end(DEBUG, "Finished removing dependency", logger=taf_logger) @@ -246,29 +243,23 @@ def remove_dependency( json.dumps(dependencies_json, indent=4) ) - removed_targets_data: Dict = {} - added_targets_data: Dict = {repositoriesdb.DEPENDENCIES_JSON_NAME: {}} - update_target_metadata( - auth_repo, - added_targets_data, - removed_targets_data, - keystore, - write=False, - scheme=scheme, - prompt_for_keys=prompt_for_keys, + commit_msg = git_commit_message( + "remove-dependency", dependency_name=dependency_name ) - # update snapshot and timestamp calls write_all, so targets updates will be saved too - update_snapshot_and_timestamp( - auth_repo, keystore, scheme=scheme, prompt_for_keys=prompt_for_keys + register_target_files( + path=path, + keystore=keystore, + commit=commit, + scheme=scheme, + auth_repo=auth_repo, + update_snapshot_and_timestamp=True, + prompt_for_keys=prompt_for_keys, + push=push, + no_commit_warning=True, + reset_updated_targets_on_error=True, + commit_msg=commit_msg, ) - if commit: - commit_msg = git_commit_message( - "remove-dependency", dependency_name=dependency_name - ) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - else: - print("\nPlease commit manually.\n") def _determine_out_of_band_data( @@ -304,9 +295,14 @@ def _determine_out_of_band_data( raise TAFError(f"Commit {out_of_band_commit} not on branch {branch_name}") if not no_prompt and (not is_branch_specified or not is_commit_specified): - if not click.confirm( - f"Branch and out-of-band authentication commit will be set to {branch_name} and {out_of_band_commit}. Proceed?" - ): - return + message = f""" +Setting: + + Branch: {branch_name} + out-of-band authentication commit: {out_of_band_commit}. + +Proceed?""" # noqa: E241 + if not click.confirm(message): + return None, None return branch_name, out_of_band_commit diff --git a/taf/api/keystore.py b/taf/api/keystore.py index 86267a318..077db17af 100644 --- a/taf/api/keystore.py +++ b/taf/api/keystore.py @@ -4,11 +4,6 @@ from pathlib import Path from taf.models.types import RolesKeysData from taf.api.utils._conf import find_taf_directory -from tuf.repository_tool import ( - generate_and_write_rsa_keypair, - generate_and_write_unencrypted_rsa_keypair, -) -from securesystemslib import keys from taf.api.roles import _initialize_roles_and_keystore from taf.keys import get_key_name @@ -16,6 +11,7 @@ from taf.models.types import RolesIterator from taf.models.converter import from_dict from taf.exceptions import KeystoreError +from taf.tuf.keys import generate_and_write_rsa_keypair, generate_rsa_keypair @log_on_start(INFO, "Generating '{key_path:s}'", logger=taf_logger) @@ -42,12 +38,7 @@ def _generate_rsa_key(key_path: str, password: str, bits: Optional[int] = None) None """ try: - if password: - generate_and_write_rsa_keypair( - filepath=key_path, bits=bits, password=password - ) - else: - generate_and_write_unencrypted_rsa_keypair(filepath=key_path, bits=bits) + generate_and_write_rsa_keypair(path=key_path, key_size=bits, password=password) taf_logger.log("NOTICE", f"Generated key {key_path}") except Exception: taf_logger.error(f"An error occurred while generating rsa key {key_path}") @@ -80,6 +71,7 @@ def generate_keys( Raises: KeystoreError if an error occurs while initializing the keystore directory or generating a key """ + # TODO handle scheme if keystore is None: taf_directory = find_taf_directory(Path()) if taf_directory: @@ -104,6 +96,5 @@ def generate_keys( key_path = str(Path(keystore, key_name)) _generate_rsa_key(key_path, password, role.length) else: - rsa_key = keys.generate_rsa_key(role.length) - private_key_val = rsa_key["keyval"]["private"] - print(f"{role.name} key:\n\n{private_key_val}\n\n") + rsa_key, _ = generate_rsa_keypair(role.length) + print(f"{role.name} key:\n\n{rsa_key.decode()}\n\n") diff --git a/taf/api/metadata.py b/taf/api/metadata.py index eda526da4..50de25602 100644 --- a/taf/api/metadata.py +++ b/taf/api/metadata.py @@ -1,13 +1,15 @@ -from datetime import datetime -from logging import INFO, ERROR +from datetime import datetime, timezone +from logging import ERROR from typing import Dict, List, Optional, Tuple -from logdecorator import log_on_end, log_on_error +from logdecorator import log_on_error +from tuf.api.metadata import Snapshot, Timestamp + from taf.api.utils._git import check_if_clean +from taf.api.api_workflow import manage_repo_and_signers from taf.exceptions import TAFError -from taf.keys import load_signing_keys from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME from taf.messages import git_commit_message -from taf.repository_tool import Repository, is_delegated_role +from taf.tuf.repository import MetadataRepository as TUFRepository from taf.log import taf_logger from taf.auth_repo import AuthenticationRepository @@ -42,10 +44,12 @@ def check_expiration_dates( Returns: None """ - taf_repo = Repository(path) + taf_repo = TUFRepository(path) if start_date is None: - start_date = datetime.now() + start_date = datetime.now(timezone.utc) + elif start_date.tzinfo is None: + start_date = start_date.replace(tzinfo=timezone.utc) expired_dict, will_expire_dict = taf_repo.check_roles_expiration_dates( interval, start_date, excluded_roles @@ -63,7 +67,7 @@ def print_expiration_dates( expired: Dict, will_expire: Dict, start_date: datetime, interval: Optional[int] = 30 ) -> None: if expired or will_expire: - now = datetime.now() + now = datetime.now(timezone.utc) print( f"Given a {interval} day interval from ({start_date.strftime('%Y-%m-%d')}):" ) @@ -85,13 +89,15 @@ def print_expiration_dates( def update_metadata_expiration_date( path: str, roles: List[str], - interval: int, + interval: Optional[int] = None, keystore: Optional[str] = None, scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, start_date: Optional[datetime] = None, commit: Optional[bool] = True, + commit_msg: Optional[str] = None, prompt_for_keys: Optional[bool] = False, push: Optional[bool] = True, + update_snapshot_and_timestamp: Optional[bool] = True, ) -> None: """ Update expiration dates of the specified roles and all other roles that need @@ -108,6 +114,7 @@ def update_metadata_expiration_date( start_date (optional): Date to which expiration interval is added. Set to today if not specified. commit (optional): Indicates if the changes should be committed and pushed automatically. + commit_msg (optional): Custom commit messages. prompt_for_keys (optional): Whether to ask the user to enter their key if it is not located inside the keystore directory. push (optional): Flag specifying whether to push to remote @@ -118,79 +125,109 @@ def update_metadata_expiration_date( Returns: None """ + + auth_repo = AuthenticationRepository(path=path) if start_date is None: start_date = datetime.now() - taf_repo = Repository(path) - loaded_yubikeys: Dict = {} - roles_to_update = [] - - if "root" in roles: - roles_to_update.append("root") - if "targets" in roles: - roles_to_update.append("targets") - for role in roles: - if is_delegated_role(role): - roles_to_update.append(role) - - if len(roles_to_update) or "snapshot" in roles: - roles_to_update.append("snapshot") - roles_to_update.append("timestamp") - - for role in roles_to_update: - _update_expiration_date_of_role( - taf_repo, - role, - loaded_yubikeys, - keystore, - start_date, - interval, - scheme, - prompt_for_keys, - ) + commit_msg = commit_msg or git_commit_message( + "update-expiration-dates", roles=",".join(roles) + ) - if not commit: - print("\nPlease commit manually.\n") - else: - auth_repo = AuthenticationRepository(path=path) - commit_msg = git_commit_message( - "update-expiration-dates", roles=",".join(roles) - ) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) + # update the order, snapshot has to be updated before timestamp + # and all other roles have to be updated before snapshot + # all other roles can be updated in any order + update_snapshot_expiration_date = Snapshot.type in roles + update_timestamp_expiration_date = Timestamp.type in roles -@log_on_end(INFO, "Updated expiration date of {role:s}", logger=taf_logger) -@log_on_error( - ERROR, - "Error: could not update expiration date: {e}", - logger=taf_logger, - on_exceptions=TAFError, - reraise=True, -) -def _update_expiration_date_of_role( - auth_repo: Repository, - role: str, - loaded_yubikeys: Dict, - keystore: str, - start_date: datetime, - interval: int, - scheme: str, - prompt_for_keys: bool, + with manage_repo_and_signers( + auth_repo, + roles, + keystore, + scheme, + prompt_for_keys, + load_snapshot_and_timestamp=update_snapshot_and_timestamp, + commit=commit, + commit_msg=commit_msg, + push=push, + ): + if update_snapshot_expiration_date: + auth_repo.add_to_open_metadata([Snapshot.type]) + if update_timestamp_expiration_date: + auth_repo.add_to_open_metadata([Timestamp.type]) + + for role in roles: + auth_repo.set_metadata_expiration_date( + role, start_date=start_date, interval=interval + ) + + auth_repo.remove_from_open_metadata([Snapshot.type]) + # it is important to update snapshot first + + if (update_snapshot_expiration_date or update_snapshot_and_timestamp) and not ( + len(roles) == 1 and update_timestamp_expiration_date + ): + auth_repo.do_snapshot(force=True) + + auth_repo.remove_from_open_metadata([Timestamp.type]) + if update_timestamp_expiration_date or update_snapshot_and_timestamp: + auth_repo.do_timestamp(force=True) + + +@check_if_clean +def update_snapshot_and_timestamp( + path: str, + keystore: Optional[str] = None, + roles_to_sync: Optional[List[str]] = None, + scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, + commit: Optional[bool] = True, + commit_msg: Optional[str] = None, + prompt_for_keys: Optional[bool] = False, + push: Optional[bool] = True, + update_expiration_dates: Optional[bool] = True, ) -> None: - keys, yubikeys = load_signing_keys( + """ + Update expiration snapshot and timestamp + + Arguments: + path: Authentication repository's location. + keystore (optional): Keystore directory's path + scheme (optional): Signature scheme. + commit (optional): Indicates if the changes should be committed and pushed automatically. + commit_msg (optional): Custom commit messages. + prompt_for_keys (optional): Whether to ask the user to enter their key if it is not located inside the keystore directory. + push (optional): Flag specifying whether to push to remote + update_expiration_dates (optional): Flag specifying whether to update expiration dates + + Side Effects: + Updates metadata files, saves changes to disk and commits changes + unless no_commit is set to True. + + Returns: + None + """ + + auth_repo = AuthenticationRepository(path=path) + + with manage_repo_and_signers( auth_repo, - role, - loaded_yubikeys=loaded_yubikeys, - keystore=keystore, - scheme=scheme, - prompt_for_keys=prompt_for_keys, - ) - # sign with keystore - if len(keys): - auth_repo.update_role_keystores( - role, keys, start_date=start_date, interval=interval - ) - if len(yubikeys): # sign with yubikey - auth_repo.update_role_yubikeys( - role, yubikeys, start_date=start_date, interval=interval - ) + [], + keystore, + scheme, + prompt_for_keys, + load_snapshot_and_timestamp=True, + commit=commit, + commit_msg=commit_msg, + push=push, + ): + if update_expiration_dates: + auth_repo.add_to_open_metadata([Snapshot.type, Timestamp.type]) + for role in [Snapshot.type, Timestamp.type]: + auth_repo.set_metadata_expiration_date(role) + auth_repo.clear_open_metadata() + if roles_to_sync: + auth_repo.sync_snapshot_with_roles(roles_to_sync) + auth_repo.do_timestamp(force=True) + else: + auth_repo.update_snapshot_and_timestamp() diff --git a/taf/api/repository.py b/taf/api/repository.py index c3616780a..8524cfe86 100644 --- a/taf/api/repository.py +++ b/taf/api/repository.py @@ -1,17 +1,16 @@ import json from logging import ERROR, INFO +import shutil from typing import Optional import click from logdecorator import log_on_end, log_on_error, log_on_start -from taf.api.utils._roles import setup_role +from taf.git import GitRepository from taf.messages import git_commit_message -from taf.models.types import RolesIterator from taf.models.types import RolesKeysData from taf.models.converter import from_dict from pathlib import Path from taf.api.roles import ( - create_delegations, _initialize_roles_and_keystore, ) from taf.api.targets import list_targets, register_target_files @@ -21,8 +20,8 @@ from taf.keys import load_sorted_keys_of_new_roles import taf.repositoriesdb as repositoriesdb from taf.api.utils._conf import find_keystore +from taf.tuf.repository import METADATA_DIRECTORY_NAME from taf.utils import ensure_pre_push_hook -from tuf.repository_tool import create_new_repository from taf.log import taf_logger @@ -62,12 +61,11 @@ def create_repository( Returns: None """ - auth_repo = AuthenticationRepository(path=path) - if not _check_if_can_create_repository(auth_repo): + if not _check_if_can_create_repository(Path(path)): return - if not keystore and auth_repo.path is not None: - keystore_path = find_keystore(auth_repo.path) + if not keystore and path is not None: + keystore_path = find_keystore(path) if keystore_path is not None: keystore = str(keystore_path) roles_key_infos_dict, keystore, skip_prompt = _initialize_roles_and_keystore( @@ -75,62 +73,46 @@ def create_repository( ) roles_keys_data = from_dict(roles_key_infos_dict, RolesKeysData) - repository = create_new_repository( - str(auth_repo.path), repository_name=auth_repo.name - ) - signing_keys, verification_keys = load_sorted_keys_of_new_roles( - auth_repo=auth_repo, + auth_repo = AuthenticationRepository(path=path) + signers, verification_keys = load_sorted_keys_of_new_roles( roles=roles_keys_data.roles, yubikeys_data=roles_keys_data.yubikeys, keystore=keystore, skip_prompt=skip_prompt, + certs_dir=auth_repo.certs_dir, ) - if signing_keys is None: + if signers is None: return - for role in RolesIterator(roles_keys_data.roles, include_delegations=False): - setup_role( - role, - repository, - verification_keys[role.name], - signing_keys.get(role.name), - ) - - create_delegations( - roles_keys_data.roles.targets, repository, verification_keys, signing_keys - ) + repository = AuthenticationRepository(path=path) + repository.create(roles_keys_data, signers, verification_keys) + if commit: + auth_repo.init_repo() + commit_msg = git_commit_message("create-repo") + auth_repo.commit(commit_msg, ["metadata"]) if test: - test_auth_file = ( - Path(auth_repo.path, auth_repo.targets_path) / auth_repo.TEST_REPO_FLAG_FILE - ) + auth_repo.targets_path.mkdir(exist_ok=True) + test_auth_file = auth_repo.targets_path / auth_repo.TEST_REPO_FLAG_FILE test_auth_file.touch() - auth_repo._tuf_repository = repository - updated = register_target_files( + register_target_files( path, keystore, roles_key_infos, - commit=False, - taf_repo=auth_repo, - write=True, + commit=commit, + auth_repo=auth_repo, + update_snapshot_and_timestamp=True, no_commit_warning=True, ) ensure_pre_push_hook(auth_repo.path) - if not updated: - repository.writeall() - - if commit: - auth_repo.init_repo() - commit_msg = git_commit_message("create-repo") - auth_repo.commit_and_push(push=False, commit_msg=commit_msg) - else: + if not commit: print("\nPlease commit manually.\n") -def _check_if_can_create_repository(auth_repo: AuthenticationRepository) -> bool: +def _check_if_can_create_repository(path: Path) -> bool: """ Check if a new authentication repository can be created at the specified location. A repository can be created if there is not directory at the repository's location @@ -145,11 +127,12 @@ def _check_if_can_create_repository(auth_repo: AuthenticationRepository) -> bool Returns: True if a new authentication repository can be created, False otherwise. """ - path = Path(auth_repo.path) + repo = GitRepository(path=path) if path.is_dir(): # check if there is non-empty metadata directory - if auth_repo.metadata_path.is_dir() and any(auth_repo.metadata_path.iterdir()): - if auth_repo.is_git_repository: + metadata_dir = path / METADATA_DIRECTORY_NAME + if metadata_dir.is_dir() and any(metadata_dir.iterdir()): + if repo.is_git_repository: print( f'"{path}" is a git repository containing the metadata directory. Generating new metadata files could make the repository invalid. Aborting.' ) @@ -158,6 +141,8 @@ def _check_if_can_create_repository(auth_repo: AuthenticationRepository) -> bool f'Metadata directory found inside "{path}". Recreate metadata files?' ): return False + else: + shutil.rmtree(metadata_dir) return True @@ -194,7 +179,7 @@ def taf_status(path: str, library_dir: Optional[str] = None, indent: int = 0) -> print(f"{indent_str}Something to commit: {auth_repo.something_to_commit()}") print(f"{indent_str}Target Repositories Status:") # Call the list_targets function - print(json.dumps(list_targets(path=path), indent=4)) + print(json.dumps(list_targets(path=path), indent=1)) # Load dependencies using repositoriesdb.get_auth_repositories repositoriesdb.load_dependencies(auth_repo, library_dir=library_dir) diff --git a/taf/api/roles.py b/taf/api/roles.py index 778f4b235..64b02d858 100644 --- a/taf/api/roles.py +++ b/taf/api/roles.py @@ -1,47 +1,35 @@ -import glob from logging import DEBUG, ERROR -import os from typing import Dict, List, Optional, Tuple import click from collections import defaultdict import json from pathlib import Path from logdecorator import log_on_end, log_on_error, log_on_start -from taf.api.utils._roles import _role_obj, create_delegations -from taf.messages import git_commit_message -from tuf.repository_tool import Targets +from taf.api.api_workflow import manage_repo_and_signers, transactional_execution +from taf.tuf.keys import get_sslib_key_from_value from taf.api.utils._git import check_if_clean from taf.exceptions import KeystoreError, TAFError from taf.models.converter import from_dict -from taf.models.types import RolesIterator, TargetsRole, compare_roles_data -from taf.repositoriesdb import REPOSITORIES_JSON_PATH -from tuf.repository_tool import TARGETS_DIRECTORY_NAME -import tuf.roledb -import taf.repositoriesdb as repositoriesdb +from taf.models.types import TargetsRole, compare_roles_data from taf.keys import ( find_keystore, get_key_name, get_metadata_key_info, - load_signing_keys, load_sorted_keys_of_new_roles, ) -from taf.api.utils._metadata import ( - update_snapshot_and_timestamp, - update_target_metadata, -) from taf.auth_repo import AuthenticationRepository from taf.constants import ( DEFAULT_ROLE_SETUP_PARAMS, DEFAULT_RSA_SIGNATURE_SCHEME, ) from taf.keystore import new_public_key_cmd_prompt -from taf.repository_tool import is_delegated_role +from taf.tuf.repository import MAIN_ROLES, METADATA_DIRECTORY_NAME from taf.utils import get_key_size, read_input_dict, resolve_keystore_path -from taf.log import taf_logger +from taf.log import NOTICE, taf_logger from taf.models.types import RolesKeysData +from taf.messages import git_commit_message - -MAIN_ROLES = ["root", "snapshot", "timestamp", "targets"] +from securesystemslib.signer._key import SSlibKey @log_on_start(DEBUG, "Adding a new role {role:s}", logger=taf_logger) @@ -97,52 +85,59 @@ def add_role( Returns: None """ + if auth_repo is None: auth_repo = AuthenticationRepository(path=path) + + if not parent_role: + parent_role = "targets" + existing_roles = auth_repo.get_all_targets_roles() existing_roles.extend(MAIN_ROLES) if role in existing_roles: taf_logger.log("NOTICE", "All roles already set up") return - targets_parent_role = TargetsRole() - if parent_role != "targets": - targets_parent_role.name = parent_role - targets_parent_role.paths = [] - - new_role = TargetsRole() - new_role.parent = targets_parent_role - new_role.name = role - new_role.paths = paths - new_role.number = keys_number - new_role.threshold = threshold - new_role.yubikey = yubikey - - signing_keys, verification_keys = load_sorted_keys_of_new_roles( - auth_repo=auth_repo, - roles=new_role, - yubikeys_data=None, - keystore=keystore, - skip_prompt=skip_prompt, - ) - create_delegations( - new_role, auth_repo, verification_keys, signing_keys, existing_roles - ) - _update_role( + keystore_path = Path(keystore) if keystore else find_keystore(Path(path)) + commit_msg = git_commit_message("add-role", role=role) + metadata_path = Path(METADATA_DIRECTORY_NAME, f"{role}.json") + + with manage_repo_and_signers( auth_repo, - targets_parent_role.name, - keystore, + roles=[parent_role], + keystore=keystore_path, scheme=scheme, prompt_for_keys=prompt_for_keys, - ) - if commit: - update_snapshot_and_timestamp( - auth_repo, keystore, scheme=scheme, prompt_for_keys=prompt_for_keys + load_roles=True, + load_snapshot_and_timestamp=True, + commit=commit, + push=push, + commit_msg=commit_msg, + paths_to_reset_on_error=[metadata_path], + ): + targets_parent_role = TargetsRole() + if parent_role != "targets": + targets_parent_role.name = parent_role + targets_parent_role.paths = [] + + new_role = TargetsRole() + new_role.name = role + new_role.parent = targets_parent_role + new_role.paths = paths + new_role.number = keys_number + new_role.threshold = threshold + new_role.yubikey = yubikey + + signers, _ = load_sorted_keys_of_new_roles( + roles=new_role, + yubikeys_data=None, + keystore=keystore_path, + skip_prompt=skip_prompt, + certs_dir=auth_repo.certs_dir, ) - commit_msg = git_commit_message("add-role", role=role) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - else: - taf_logger.log("NOTICE", "\nPlease commit manually\n") + auth_repo.create_delegated_roles([new_role], signers) + auth_repo.add_new_roles_to_snapshot([new_role.name]) + auth_repo.do_timestamp() @log_on_start(DEBUG, "Adding new paths to role {delegated_role:s}", logger=taf_logger) @@ -184,35 +179,36 @@ def add_role_paths( Returns: None """ + if auth_repo is None: auth_repo = AuthenticationRepository(path=auth_path) - if not auth_repo.check_if_role_exists(delegated_role): - raise TAFError(f"Role {delegated_role} does not exist") parent_role = auth_repo.find_delegated_roles_parent(delegated_role) - parent_role_obj = _role_obj(parent_role, auth_repo) - if isinstance(parent_role_obj, Targets): - try: - parent_role_obj.add_paths(paths, delegated_role) - except tuf.exceptions.InvalidNameError: - raise TAFError( - "All delegated paths should be relative to targets directory." - ) - _update_role(auth_repo, parent_role, keystore, prompt_for_keys=prompt_for_keys) - if commit: - update_snapshot_and_timestamp( - auth_repo, keystore, prompt_for_keys=prompt_for_keys - ) - commit_msg = git_commit_message( - "add-role-paths", paths=", ".join(paths), role=delegated_role - ) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - else: - taf_logger.log("NOTICE", "\nPlease commit manually\n") - else: - taf_logger.error( - f"Could not find parent role of role {delegated_role}. Check if its name was misspelled" - ) + if all( + path in auth_repo.get_delegations_of_role(parent_role)[delegated_role].paths + for path in paths + ): + taf_logger.log("NOTICE", "Paths already added") + return + + commit_msg = git_commit_message( + "add-role-paths", role=delegated_role, paths=", ".join(paths) + ) + + with manage_repo_and_signers( + auth_repo, + [delegated_role], + keystore=keystore, + prompt_for_keys=prompt_for_keys, + load_roles=False, + load_parents=True, + load_snapshot_and_timestamp=True, + commit=commit, + push=push, + commit_msg=commit_msg, + ): + auth_repo.add_path_to_delegated_role(role=delegated_role, paths=paths) + auth_repo.update_snapshot_and_timestamp() @log_on_start(DEBUG, "Adding new roles", logger=taf_logger) @@ -238,7 +234,6 @@ def add_multiple_roles( Add new target roles and sign all metadata files given information stored in roles_key_infos dictionary or .json file. - Arguments: path: Path to the authentication repository. keystore (optional): Location of the keystore files. @@ -254,65 +249,67 @@ def add_multiple_roles( Returns: None """ - auth_repo = AuthenticationRepository(path=path) roles_keys_data_new = _initialize_roles_and_keystore_for_existing_repo( path, roles_key_infos, keystore ) + + auth_repo = AuthenticationRepository(path=path) roles_data = auth_repo.generate_roles_description() roles_keys_data_current = from_dict(roles_data, RolesKeysData) - - new_roles, _ = compare_roles_data(roles_keys_data_current, roles_keys_data_new) - - parent_roles_names = {role.parent.name for role in new_roles} - - if not len(new_roles): + new_roles_data, _ = compare_roles_data(roles_keys_data_current, roles_keys_data_new) + existing_roles = auth_repo.get_all_targets_roles() + existing_roles.extend(MAIN_ROLES) + roles_to_add_data = [ + role_data + for role_data in new_roles_data + if role_data.name not in existing_roles + ] + if not len(roles_to_add_data): taf_logger.log("NOTICE", "All roles already set up") return - repository = auth_repo._repository - existing_roles = [ - role.name for role in RolesIterator(roles_keys_data_current.roles) + roles_to_add = [role_data.name for role_data in new_roles_data] + commit_msg = git_commit_message("add-roles", roles=", ".join(roles_to_add)) + roles_to_load = [ + role_data.parent.name + for role_data in new_roles_data + if role_data.parent.name not in roles_to_add ] - signing_keys, verification_keys = load_sorted_keys_of_new_roles( - auth_repo=auth_repo, - roles=roles_keys_data_new.roles, - keystore=keystore, - yubikeys_data=roles_keys_data_new.yubikeys, - existing_roles=existing_roles, - ) + keystore_path = roles_keys_data_new.keystore - create_delegations( - roles_keys_data_new.roles.targets, - repository, - verification_keys, - signing_keys, - existing_roles=existing_roles, - ) - for parent_role_name in parent_roles_names: - _update_role( - auth_repo, - parent_role_name, - keystore, - scheme=scheme, - prompt_for_keys=prompt_for_keys, - ) - update_snapshot_and_timestamp( - auth_repo, keystore, scheme=scheme, prompt_for_keys=prompt_for_keys - ) - if commit: - roles_names = [role.name for role in new_roles] - commit_msg = git_commit_message("add-roles", roles=", ".join(roles_names)) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - else: - taf_logger.log("NOTICE", "\nPlease commit manually\n") + with manage_repo_and_signers( + auth_repo, + roles=roles_to_load, + keystore=keystore_path, + scheme=scheme, + prompt_for_keys=prompt_for_keys, + load_snapshot_and_timestamp=True, + commit_msg=commit_msg, + commit=commit, + push=push, + ): + all_signers = {} + for role_to_add_data in roles_to_add_data: + signers, _ = load_sorted_keys_of_new_roles( + roles=role_to_add_data, + yubikeys_data=None, + keystore=keystore_path, + skip_prompt=not prompt_for_keys, + certs_dir=auth_repo.certs_dir, + ) + all_signers.update(signers) + + auth_repo.create_delegated_roles(roles_to_add_data, all_signers) + auth_repo.add_new_roles_to_snapshot(roles_to_add) + auth_repo.do_timestamp() -@log_on_start(DEBUG, "Adding new signing key to roles", logger=taf_logger) -@log_on_end(DEBUG, "Finished adding new signing key to roles", logger=taf_logger) +@log_on_start(NOTICE, "Adding a new signing key", logger=taf_logger) +@log_on_end(DEBUG, "Finished adding a new signing key", logger=taf_logger) @log_on_error( ERROR, - "An error occurred while adding new signing key to roles: {e}", + "An error occurred while adding a new signing key: {e}", logger=taf_logger, on_exceptions=TAFError, reraise=True, @@ -322,8 +319,8 @@ def add_signing_key( path: str, roles: List[str], pub_key_path: Optional[str] = None, + pub_key: Optional[SSlibKey] = None, keystore: Optional[str] = None, - roles_key_infos: Optional[str] = None, scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, commit: Optional[bool] = True, prompt_for_keys: Optional[bool] = False, @@ -340,7 +337,6 @@ def add_signing_key( pub_key_path (optional): path to the file containing the public component of the new key. If not provided, it will be necessary to ender the key when prompted. keystore (optional): Location of the keystore files. - roles_key_infos (optional): Path to a json file which contains information about repository's roles and keys. scheme (optional): Signing scheme. Set to rsa-pkcs1v15-sha256 by default. prompt_for_keys (optional): Whether to ask the user to enter their key if it is not located inside the keystore directory. commit (optional): Indicates if the changes should be committed and pushed automatically. @@ -353,70 +349,191 @@ def add_signing_key( Returns: None """ - auth_repo = AuthenticationRepository(path=path) - non_existant_roles = [] - for role in roles: - if not auth_repo.check_if_role_exists(role): - non_existant_roles.append(role) - if len(non_existant_roles): - raise TAFError(f"Role(s) {', '.join(non_existant_roles)} do not exist") - - _, keystore, _ = _initialize_roles_and_keystore( - roles_key_infos, keystore, enter_info=False + + pub_key = pub_key or _load_pub_key_from_file( + pub_key_path, prompt_for_keys=prompt_for_keys, scheme=scheme ) - pub_key_pem = None - if pub_key_path is not None: - pub_key_pem_path = Path(pub_key_path) - if pub_key_pem_path.is_file(): - pub_key_pem = Path(pub_key_path).read_text() + roles_keys = {role: [pub_key] for role in roles} - if pub_key_pem is None: - pub_key_pem = new_public_key_cmd_prompt(scheme)["keyval"]["public"] + auth_repo = AuthenticationRepository(path=path) - parent_roles = set() - for role in roles: - if auth_repo.is_valid_metadata_key(role, pub_key_pem): + with manage_repo_and_signers( + auth_repo, + roles, + keystore, + scheme, + prompt_for_keys, + load_snapshot_and_timestamp=True, + load_parents=True, + load_roles=False, + commit=commit, + push=push, + commit_msg=commit_msg, + ): + added_keys, already_added_keys, invalid_keys = auth_repo.add_metadata_keys( + roles_keys + ) + if already_added_keys: taf_logger.log( - "NOTICE", f"Key already registered as signing key of role {role}" + "NOTICE", f"Key(s) {', '.join(already_added_keys)} already added" ) - continue + if invalid_keys: + taf_logger.warning(f"Key(s) {', '.join(invalid_keys)} invalid") - auth_repo.add_metadata_key(role, pub_key_pem, scheme) + if len(added_keys): + auth_repo.update_snapshot_and_timestamp() - if is_delegated_role(role): - parent_role = auth_repo.find_delegated_roles_parent(role) - else: - parent_role = "root" - parent_roles.add(parent_role) +@log_on_start(NOTICE, "Revoking signing key", logger=taf_logger) +@log_on_end(DEBUG, "Finished revoking signing key", logger=taf_logger) +@log_on_error( + ERROR, + "An error occurred while revoking signing key: {e}", + logger=taf_logger, + on_exceptions=TAFError, + reraise=True, +) +@check_if_clean +def revoke_signing_key( + path: str, + key_id: str, + roles: Optional[List[str]] = None, + keystore: Optional[str] = None, + scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, + commit: Optional[bool] = True, + prompt_for_keys: Optional[bool] = False, + push: Optional[bool] = True, + commit_msg: Optional[str] = None, +) -> None: + """ + Revoke signing key. Update root metadata if one or more roles is one of the main TUF roles, + parent target role if one of the roles is a delegated target role and timestamp and snapshot in any case. + + Arguments: + path: Path to the authentication repository. + roles: A list of roles whose signing keys need to be extended. + key_id: id of the key to be removed + keystore (optional): Location of the keystore files. + scheme (optional): Signing scheme. Set to rsa-pkcs1v15-sha256 by default. + prompt_for_keys (optional): Whether to ask the user to enter their key if it is not located inside the keystore directory. + commit (optional): Indicates if the changes should be committed and pushed automatically. + push (optional): Flag specifying whether to push to remote. + commit_msg(optional): Commit message. Will be necessary to enter it if not provided. + Side Effects: + Updates metadata files (parents of the affected roles, snapshot and timestamp). + Writes changes to disk. - if not len(parent_roles): - return + Returns: + None + """ + + auth_repo = AuthenticationRepository(path=path) + + roles_to_update = roles or auth_repo.find_keysid_roles([key_id]) + + with manage_repo_and_signers( + auth_repo, + roles_to_update, + keystore, + scheme, + prompt_for_keys, + load_snapshot_and_timestamp=True, + load_parents=True, + load_roles=False, + commit=commit, + push=push, + commit_msg=commit_msg, + ): + + ( + removed_from_roles, + not_added_roles, + less_than_threshold_roles, + ) = auth_repo.revoke_metadata_key(key_id=key_id, roles=roles) + if not_added_roles: + taf_logger.log( + "NOTICE", + f"Key is not a signing key of role(s) {', '.join(not_added_roles)}", + ) + if less_than_threshold_roles: + taf_logger.warning( + f"Cannot remove key from {', '.join(less_than_threshold_roles)}. Number of keys must be greater or equal to thresholds" + ) + + if len(removed_from_roles): + auth_repo.update_snapshot_and_timestamp() + + +@check_if_clean +def rotate_signing_key( + path: str, + key_id: str, + pub_key_path: Optional[str] = None, + roles: Optional[List[str]] = None, + keystore: Optional[str] = None, + scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, + prompt_for_keys: Optional[bool] = False, + push: Optional[bool] = True, + revoke_commit_msg: Optional[str] = None, + add_commit_msg: Optional[str] = None, +) -> None: + """ + Rotate signing key. Remove it from one or more roles and add a new signing key. + Update root metadata if one or more roles is one of the main TUF roles, + parent target role if one of the roles is a delegated target role and timestamp and snapshot in any case. - auth_repo.unmark_dirty_roles(list(set(roles) - parent_roles)) - for parent_role in parent_roles: - _update_role( - auth_repo, - parent_role, - keystore, + Arguments: + path: Path to the authentication repository. + roles: A list of roles whose signing keys need to be extended. + key_id: id of the key to be removed + pub_key_path (optional): path to the file containing the public component of the new key. If not provided, + it will be necessary to ender the key when prompted. + keystore (optional): Location of the keystore files. + scheme (optional): Signing scheme. Set to rsa-pkcs1v15-sha256 by default. + prompt_for_keys (optional): Whether to ask the user to enter their key if it is not located inside the keystore directory. + commit (optional): Indicates if the changes should be committed and pushed automatically. + push (optional): Flag specifying whether to push to remote. + revoke_commit_msg(optional): First commit message, when revokig the specified key. Will be necessary to enter it if not provided. + add_commit_msg(optional): Second commit message, when addug a new signing key. Will be necessary to enter it if not provided. + Side Effects: + Updates metadata files (parents of the affected roles, snapshot and timestamp). + Writes changes to disk. + + Returns: + None + """ + + pub_key = _load_pub_key_from_file( + pub_key_path, prompt_for_keys=prompt_for_keys, scheme=scheme + ) + auth_repo = AuthenticationRepository(path=path) + roles = roles or auth_repo.find_keysid_roles([key_id]) + + with transactional_execution(auth_repo): + revoke_signing_key( + path=path, + key_id=key_id, + roles=roles, + keystore=keystore, scheme=scheme, + commit=True, prompt_for_keys=prompt_for_keys, + push=False, + commit_msg=revoke_commit_msg, ) - update_snapshot_and_timestamp( - auth_repo, keystore=keystore, scheme=scheme, prompt_for_keys=prompt_for_keys - ) - - if commit: - # TODO after saving custom key ids is implemented, remove customization of the commit message - # for now, it might be helpful to be able to specify which key was added - # commit_msg = git_commit_message( - # "add-signing-key", role={role} - # ) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - else: - taf_logger.log("NOTICE", "\nPlease commit manually\n") + add_signing_key( + path=path, + roles=roles, + pub_key=pub_key, + keystore=keystore, + scheme=scheme, + commit=True, + prompt_for_keys=prompt_for_keys, + push=push, + commit_msg=add_commit_msg, + ) # TODO this is probably outdated, the format of the outputted roles_key_infos @@ -534,6 +651,22 @@ def _enter_role_info( return role_info +def _load_pub_key_from_file(pub_key_path, prompt_for_keys, scheme) -> SSlibKey: + pub_key_pem = None + if pub_key_path is not None: + pub_key_pem_path = Path(pub_key_path) + if pub_key_pem_path.is_file(): + pub_key_pem = Path(pub_key_path).read_text() + + if pub_key_pem is None and prompt_for_keys: + pub_key_pem = new_public_key_cmd_prompt(scheme)["keyval"]["public"] + + if pub_key_pem is None: + raise TAFError("Public key not provided or invalid") + + return get_sslib_key_from_value(pub_key_pem) + + def _read_val(input_type, name, param=None, required=False): default_value_msg = "" default_value = None @@ -571,6 +704,8 @@ def _initialize_roles_and_keystore_for_existing_repo( keystore_path = find_keystore(Path(path)) if keystore_path: roles_keys_data.keystore = str(keystore_path) + else: + roles_keys_data.keystore = keystore return roles_keys_data @@ -762,89 +897,93 @@ def remove_role( Returns: None """ - if role in MAIN_ROLES: - taf_logger.error( - f"Cannot remove role {role}. It is one of the roles required by the TUF specification" - ) - return - - if auth_repo is None: - auth_repo = AuthenticationRepository(path=path) - - parent_role = auth_repo.find_delegated_roles_parent(role) - if parent_role is None: - taf_logger.error("Role is not among delegated roles") - return - parent_role_obj = _role_obj(parent_role, auth_repo) - if not isinstance(parent_role_obj, Targets): - taf_logger.error(f"Could not find parent targets role of role {role}.") - return - roleinfo = tuf.roledb.get_roleinfo(parent_role, auth_repo.name) - added_targets_data: Dict = {} - removed_targets = [] - for delegations_data in roleinfo["delegations"]["roles"]: - if delegations_data["name"] == role: - paths = delegations_data["paths"] - for target_path in paths: - target_file_path = Path(path, TARGETS_DIRECTORY_NAME, target_path) - if target_file_path.is_file(): - if remove_targets: - os.unlink(str(target_file_path)) - removed_targets.append(str(target_file_path)) - else: - added_targets_data[target_file_path] = {} - else: - # try glob pattern traversal - full_pattern = str(Path(path, TARGETS_DIRECTORY_NAME, target_path)) - matching_files = glob.glob(full_pattern) - for file_path in matching_files: - if remove_targets: - os.unlink(str(file_path)) - removed_targets.append(file_path) - else: - added_targets_data[file_path] = {} - break - - parent_role_obj.revoke(role) - - _update_role( - auth_repo, role=parent_role, keystore=keystore, prompt_for_keys=prompt_for_keys - ) - if len(added_targets_data): - removed_targets_data: Dict = {} - update_target_metadata( - auth_repo, - added_targets_data, - removed_targets_data, - keystore, - write=False, - scheme=DEFAULT_RSA_SIGNATURE_SCHEME, - prompt_for_keys=prompt_for_keys, - ) - - # if targets should be deleted, also removed them from repositories.json - if len(removed_targets): - repositories_json = repositoriesdb.load_repositories_json(auth_repo) - if repositories_json is not None: - repositories = repositories_json["repositories"] - for removed_target in removed_targets: - if removed_target in repositories: - repositories.pop(removed_target) - - # update content of repositories.json before updating targets metadata - Path(auth_repo.path, REPOSITORIES_JSON_PATH).write_text( - json.dumps(repositories_json, indent=4) - ) - - update_snapshot_and_timestamp( - auth_repo, keystore, scheme=scheme, prompt_for_keys=prompt_for_keys - ) - if commit: - commit_msg = git_commit_message("remove-role", role=role) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - else: - taf_logger.log("NOTICE", "Please commit manually") + # TODO This didn't fully work and was not being used + # can be done later + + # if role in MAIN_ROLES: + # taf_logger.error( + # f"Cannot remove role {role}. It is one of the roles required by the TUF specification" + # ) + # return + + # if auth_repo is None: + # auth_repo = AuthenticationRepository(path=path) + + # parent_role = auth_repo.find_delegated_roles_parent(role) + # if parent_role is None: + # taf_logger.error("Role is not among delegated roles") + # return + # parent_role_obj = auth_repo._role_obj(parent_role, auth_repo) + # if not isinstance(parent_role_obj, Targets): + # taf_logger.error(f"Could not find parent targets role of role {role}.") + # return + + # roleinfo = tuf.roledb.get_roleinfo(parent_role, auth_repo.name) + # added_targets_data: Dict = {} + # removed_targets = [] + # for delegations_data in roleinfo["delegations"]["roles"]: + # if delegations_data["name"] == role: + # paths = delegations_data["paths"] + # for target_path in paths: + # target_file_path = Path(path, TARGETS_DIRECTORY_NAME, target_path) + # if target_file_path.is_file(): + # if remove_targets: + # os.unlink(str(target_file_path)) + # removed_targets.append(str(target_file_path)) + # else: + # added_targets_data[target_file_path] = {} + # else: + # # try glob pattern traversal + # full_pattern = str(Path(path, TARGETS_DIRECTORY_NAME, target_path)) + # matching_files = glob.glob(full_pattern) + # for file_path in matching_files: + # if remove_targets: + # os.unlink(str(file_path)) + # removed_targets.append(file_path) + # else: + # added_targets_data[file_path] = {} + # break + + # parent_role_obj.revoke(role) + + # _update_role( + # auth_repo, role=parent_role, keystore=keystore, prompt_for_keys=prompt_for_keys + # ) + # if len(added_targets_data): + # removed_targets_data: Dict = {} + # update_target_metadata( + # auth_repo, + # added_targets_data, + # removed_targets_data, + # keystore, + # write=False, + # scheme=DEFAULT_RSA_SIGNATURE_SCHEME, + # prompt_for_keys=prompt_for_keys, + # ) + + # # if targets should be deleted, also removed them from repositories.json + # if len(removed_targets): + # repositories_json = repositoriesdb.load_repositories_json(auth_repo) + # if repositories_json is not None: + # repositories = repositories_json["repositories"] + # for removed_target in removed_targets: + # if removed_target in repositories: + # repositories.pop(removed_target) + + # # update content of repositories.json before updating targets metadata + # Path(auth_repo.path, REPOSITORIES_JSON_PATH).write_text( + # json.dumps(repositories_json, indent=4) + # ) + + # update_snapshot_and_timestamp( + # auth_repo, keystore, scheme=scheme, prompt_for_keys=prompt_for_keys + # ) + # if commit: + # commit_msg = git_commit_message("remove-role", role=role) + # auth_repo.commit_and_push(commit_msg=commit_msg, push=push) + # else: + # taf_logger.log("NOTICE", "Please commit manually") @log_on_start(DEBUG, "Removing delegated paths", logger=taf_logger) @@ -860,7 +999,9 @@ def remove_paths( path: str, paths: List[str], keystore: str, + scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, commit: Optional[bool] = True, + commit_msg: Optional[str] = None, prompt_for_keys: Optional[bool] = False, push: Optional[bool] = True, ) -> bool: @@ -882,105 +1023,39 @@ def remove_paths( True if the delegation existed, False otherwise """ auth_repo = AuthenticationRepository(path=path) - delegation_existed = False + paths_to_remove_from_roles = defaultdict(list) for path_to_remove in paths: delegated_role = auth_repo.get_role_from_target_paths([path_to_remove]) + if delegated_role != "targets": - parent_role = auth_repo.find_delegated_roles_parent(delegated_role) - # parent_role_obj = _role_obj(parent_role, auth_repo) - current_delegation_existed = _remove_path_from_role_info( - path_to_remove, parent_role, delegated_role, auth_repo - ) - delegation_existed = delegation_existed or current_delegation_existed - if current_delegation_existed: - _update_role( - auth_repo, parent_role, keystore, prompt_for_keys=prompt_for_keys - ) - if delegation_existed and commit: - update_snapshot_and_timestamp( - auth_repo, keystore, prompt_for_keys=prompt_for_keys - ) + paths_to_remove_from_roles[delegated_role].append(path_to_remove) + else: + taf_logger.log("NOTICE", f"Path {path_to_remove} not delegated to any role") + if not len(paths_to_remove_from_roles): + taf_logger.log("NOTICE", "No paths delegated") + return False + + if commit_msg is None: commit_msg = git_commit_message( "remove-role-paths", paths=", ".join(paths), role=delegated_role ) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - elif delegation_existed: - taf_logger.log("NOTICE", "\nPlease commit manually\n") - return delegation_existed - - -def _remove_path_from_role_info( - path_to_remove: str, - parent_role: str, - delegated_role: str, - auth_repo: AuthenticationRepository, -) -> bool: - """ - Remove path from delegated paths if directly listed. - - E.g. if delegated paths are - - "paths": [ - "namespace/repo1", - "namespace/repo2" - ] - - Arguments: - path_to_remove: path to be removed from delegated paths - parent_role: Parent role's name - delegated_role: Delegated role's name - auth_repo: Authentication repository - - and namespace/repo1 is being removed - - Returns: - True if path was directly specified as a delegated path, False otherwise - """ - - auth_repo.reload_tuf_repository() - delegation_exists = False - roleinfo = tuf.roledb.get_roleinfo(parent_role, auth_repo.name) - for delegations_data in roleinfo["delegations"]["roles"]: - if delegations_data["name"] == delegated_role: - delegations_paths = delegations_data["paths"] - if path_to_remove in delegations_paths: - delegations_paths.remove(path_to_remove) - delegation_exists = True - else: - taf_logger.log("NOTICE", f"{path_to_remove} not in delegated paths") - break - if delegation_exists: - tuf.roledb.update_roleinfo( - parent_role, roleinfo, repository_name=auth_repo.name - ) - return delegation_exists - - -def _update_role( - auth_repo: AuthenticationRepository, - role: str, - keystore: Optional[str], - scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, - prompt_for_keys: Optional[bool] = False, -) -> None: - """ - Update the specified role's metadata's expiration date, load the signing keys - from either a keystore file or yubikey and sign the file without updating - snapshot and timestamp and writing changes to disk - """ - loaded_yubikeys: Dict = {} - keystore_keys, yubikeys = load_signing_keys( + with manage_repo_and_signers( auth_repo, - role, - loaded_yubikeys, - keystore, + roles=list(paths_to_remove_from_roles.keys()), + keystore=keystore, scheme=scheme, prompt_for_keys=prompt_for_keys, - ) - if len(keystore_keys): - auth_repo.update_role_keystores(role, keystore_keys, write=False) - if len(yubikeys): - auth_repo.update_role_yubikeys(role, yubikeys, write=False) + load_roles=False, + load_parents=True, + load_snapshot_and_timestamp=True, + commit=commit, + push=push, + commit_msg=commit_msg, + ): + auth_repo.remove_delegated_paths(paths_to_remove_from_roles) + auth_repo.update_snapshot_and_timestamp() + + return True def list_roles(auth_repo: AuthenticationRepository) -> None: diff --git a/taf/api/targets.py b/taf/api/targets.py index 9dc5a8331..7a30051cd 100644 --- a/taf/api/targets.py +++ b/taf/api/targets.py @@ -1,15 +1,11 @@ from logging import DEBUG, ERROR, INFO from typing import Dict, List, Optional, Union -import click import os import json from collections import defaultdict from pathlib import Path from logdecorator import log_on_end, log_on_error, log_on_start -from taf.api.utils._metadata import ( - update_snapshot_and_timestamp, - update_target_metadata, -) +from taf.api.api_workflow import manage_repo_and_signers from taf.api.roles import ( _initialize_roles_and_keystore, add_role, @@ -17,7 +13,7 @@ remove_paths, ) from taf.api.utils._git import check_if_clean -from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME +from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME, TARGETS_DIRECTORY_NAME from taf.exceptions import TAFError from taf.git import GitRepository from taf.messages import git_commit_message @@ -25,8 +21,6 @@ import taf.repositoriesdb as repositoriesdb from taf.log import taf_logger from taf.auth_repo import AuthenticationRepository -from taf.repository_tool import Repository -from tuf.repository_tool import TARGETS_DIRECTORY_NAME @log_on_start(DEBUG, "Adding target repository {target_name:s}", logger=taf_logger) @@ -46,6 +40,12 @@ def add_target_repo( role: str, library_dir: str, keystore: str, + should_create_new_role: bool, + parent_role: Optional[str] = None, + paths: Optional[List] = None, + keys_number: Optional[int] = None, + threshold: Optional[int] = None, + yubikey: Optional[bool] = None, scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, custom: Optional[Dict] = None, commit: Optional[bool] = True, @@ -87,58 +87,76 @@ def add_target_repo( if target_path is not None: target_repo = GitRepository(path=target_path) - elif target_name is not None: - target_repo = GitRepository(library_dir, target_name) - else: + target_name = target_repo.name + elif target_name is None: raise TAFError( - "Cannot add new target repository. Specify either target name (and library dir) or target path" + "Cannot add new target repository. Specify either target name or target path" ) existing_roles = auth_repo.get_all_targets_roles() if role not in existing_roles: - parent_role = input("Enter new role's parent role (targets): ") - paths_input = input( - "Enter a comma separated list of path delegated to the new role: " - ) - paths = [path.strip() for path in paths_input.split(",") if len(path.strip())] - keys_number_input = input( - "Enter the number of signing keys of the new role (1): " - ) - keys_number = int(keys_number_input or 1) - threshold_input = input("Enter signatures threshold of the new role (1): ") - threshold = int(threshold_input or 1) - yubikey = click.confirm("Sign the new role's metadata using yubikeys? ") - if target_name not in paths: - paths.append(target_name) - - add_role( - path=path, - role=role, - parent_role=parent_role or "targets", - paths=paths, - keys_number=keys_number, - threshold=threshold, - yubikey=yubikey, - keystore=keystore, - scheme=DEFAULT_RSA_SIGNATURE_SCHEME, - commit=False, - auth_repo=auth_repo, - prompt_for_keys=prompt_for_keys, - ) + if not should_create_new_role: + taf_logger.error(f"Role {role} does not exist") + return + else: + taf_logger.log("NOTICE", f"Role {role} does not exist. Creating a new role") + + add_role( + path=path, + role=role, + parent_role=parent_role or "targets", + paths=paths, + keys_number=keys_number, + threshold=threshold, + yubikey=yubikey, + keystore=keystore, + scheme=DEFAULT_RSA_SIGNATURE_SCHEME, + commit=True, + push=False, + auth_repo=auth_repo, + prompt_for_keys=prompt_for_keys, + ) elif role != "targets": # delegated role paths are not specified for the top-level targets role # the targets role is responsible for signing all paths not # delegated to another target role - taf_logger.log("NOTICE", "Role already exists") + taf_logger.info("Role already exists") add_role_paths( paths=[target_name], delegated_role=role, keystore=keystore, - commit=False, + commit=True, + push=False, auth_repo=auth_repo, prompt_for_keys=prompt_for_keys, ) + _add_target_repository_to_repositories_json(auth_repo, target_name, custom) + commit_msg = git_commit_message("add-target", target_name=target_name) + register_target_files( + path=path, + keystore=keystore, + commit=commit, + scheme=scheme, + auth_repo=auth_repo, + update_snapshot_and_timestamp=True, + prompt_for_keys=prompt_for_keys, + push=push, + no_commit_warning=True, + reset_updated_targets_on_error=True, + commit_msg=commit_msg, + ) + + +# TODO Move this to auth repo when repositoriesdb is removed and there are no circular imports +def _add_target_repository_to_repositories_json( + auth_repo, target_repo_name: str, custom: Optional[Dict] = None +) -> None: + """ + Add repository to repositories.json + """ + if custom is None: + custom = {} # target repo should be added to repositories.json # delegation paths should be extended if role != targets # if the repository already exists, create a target file @@ -146,48 +164,25 @@ def add_target_repo( if repositories_json is None: repositories_json = {"repositories": {}} repositories = repositories_json["repositories"] - if target_repo.name in repositories: - taf_logger.log( - "NOTICE", - f"{target_repo.name} already added to repositories.json. Overwriting", + if target_repo_name in repositories: + auth_repo._log_notice( + f"{target_repo_name} already added to repositories.json. Overwriting" ) - repositories[target_repo.name] = {} + + repositories[target_repo_name] = {} if custom: - repositories[target_name]["custom"] = custom + repositories[target_repo_name]["custom"] = custom # update content of repositories.json before updating targets metadata - Path(auth_repo.path, repositoriesdb.REPOSITORIES_JSON_PATH).write_text( - json.dumps(repositories_json, indent=4) - ) - - added_targets_data: Dict = {} - if target_repo.is_git_repository_root: - _save_top_commit_of_repo_to_target( - Path(library_dir), target_repo.name, auth_repo.path - ) - added_targets_data[target_repo.name] = {} - - removed_targets_data: Dict = {} - added_targets_data[repositoriesdb.REPOSITORIES_JSON_NAME] = {} - update_target_metadata( - auth_repo, - added_targets_data, - removed_targets_data, - keystore, - write=False, - scheme=scheme, - prompt_for_keys=prompt_for_keys, + full_repositories_json_path = Path( + auth_repo.path, repositoriesdb.REPOSITORIES_JSON_PATH ) + if not full_repositories_json_path.parent.is_dir(): + full_repositories_json_path.parent.mkdir() - # update snapshot and timestamp calls write_all, so targets updates will be saved too - update_snapshot_and_timestamp( - auth_repo, keystore, scheme=scheme, prompt_for_keys=prompt_for_keys + Path(auth_repo.path, repositoriesdb.REPOSITORIES_JSON_PATH).write_text( + json.dumps(repositories_json, indent=4) ) - if commit: - commit_msg = git_commit_message("add-target", target_name=target_name) - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - else: - taf_logger.log("NOTICE", "\nPlease commit manually\n") def export_targets_history( @@ -327,11 +322,14 @@ def register_target_files( roles_key_infos: Optional[str] = None, commit: Optional[bool] = True, scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, - taf_repo: Optional[Repository] = None, - write: Optional[bool] = False, + auth_repo: Optional[AuthenticationRepository] = None, + update_snapshot_and_timestamp: Optional[bool] = True, prompt_for_keys: Optional[bool] = False, push: Optional[bool] = True, no_commit_warning: Optional[bool] = True, + reset_updated_targets_on_error: Optional[bool] = False, + commit_msg: Optional[str] = None, + force_update_of_roles: Optional[str] = None, ): """ Register all files found in the target directory as targets - update the targets @@ -342,46 +340,75 @@ def register_target_files( keystore: Location of the keystore files. roles_key_infos: A dictionary whose keys are role names, while values contain information about the keys. scheme (optional): Signing scheme. Set to rsa-pkcs1v15-sha256 by default. - taf_repo (optional): If taf repository is already initialized, it can be passed and used. + auth_repo (optional): If auth repository is already initialized, it can be passed and used. write (optional): Write metadata updates to disk if set to True commit (optional): Indicates if the changes should be committed and pushed automatically. prompt_for_keys (optional): Whether to ask the user to enter their key if it is not located inside the keystore directory. push (optional): Flag specifying whether to push to remote + force_update_of_roles (optional): A list of roles whose version should be updated, even + if no other changes are made Side Effects: Updates metadata files, writes changes to disk and optionally commits changes. Returns: True if there were targets that were updated, False otherwise """ + + # find files that should be added/modified/removed + + if auth_repo is None: + auth_repo = AuthenticationRepository(path=path) + + added_targets_data, removed_targets_data = auth_repo.get_all_target_files_state() + if not added_targets_data and not removed_targets_data: + taf_logger.log("NOTICE", "No updated targets") + return False + + all_updated_targets = list(added_targets_data.keys()) if added_targets_data else [] + if removed_targets_data: + all_updated_targets.extend(list(removed_targets_data.keys())) + + roles_and_targets = defaultdict(list) + paths_to_reset: List = [] + for path in all_updated_targets: + roles_and_targets[auth_repo.get_role_from_target_paths([path])].append(path) + if reset_updated_targets_on_error: + paths_to_reset.append(str(Path(TARGETS_DIRECTORY_NAME, path))) + _, keystore, _ = _initialize_roles_and_keystore( roles_key_infos, keystore, enter_info=False ) - if taf_repo is None: - path = Path(path).resolve() - taf_repo = Repository(str(path)) - # find files that should be added/modified/removed - added_targets_data, removed_targets_data = taf_repo.get_all_target_files_state() - updated = update_target_metadata( - taf_repo, - added_targets_data, - removed_targets_data, + roles_to_load = list(roles_and_targets.keys()) + if force_update_of_roles: + for role in force_update_of_roles: + if role not in roles_to_load: + roles_to_load.append(role) + with manage_repo_and_signers( + auth_repo, + roles_to_load, keystore, - scheme=scheme, - write=write, - prompt_for_keys=prompt_for_keys, - ) - - if updated and write: - taf_repo.writeall() - if commit: - auth_repo = AuthenticationRepository(path=taf_repo.path) - commit_msg = git_commit_message("update-targets") - auth_repo.commit_and_push(commit_msg=commit_msg, push=push) - elif not no_commit_warning: - taf_logger.log("NOTICE", "\nPlease commit manually\n") - - return updated + scheme, + prompt_for_keys, + load_snapshot_and_timestamp=update_snapshot_and_timestamp, + load_parents=False, + load_roles=True, + commit=commit, + push=push, + commit_msg=commit_msg, + commit_key="update-targets", + no_commit_warning=no_commit_warning, + paths_to_reset_on_error=paths_to_reset, + ): + for role, targets in roles_and_targets.items(): + auth_repo.update_target_role(role, targets) + if force_update_of_roles: + for role in force_update_of_roles: + if role not in roles_and_targets: + auth_repo.update_target_role(role, None, True) + + if update_snapshot_and_timestamp: + auth_repo.update_snapshot_and_timestamp() @log_on_start(DEBUG, "Removing target repository {target_name:s}", logger=taf_logger) @@ -400,6 +427,7 @@ def remove_target_repo( keystore: str, prompt_for_keys: Optional[bool] = False, push: Optional[bool] = True, + scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, ) -> None: """ Remove target repository from repositories.json, remove delegation, and target files and @@ -418,74 +446,76 @@ def remove_target_repo( None """ auth_repo = AuthenticationRepository(path=path) - removed_targets_data: Dict = {} - added_targets_data: Dict = {} - if not auth_repo.is_git_repository_root: - taf_logger.error(f"{path} is not a git repository!") - return - repositories_json = repositoriesdb.load_repositories_json(auth_repo) - if repositories_json is not None: - repositories = repositories_json["repositories"] - if target_name not in repositories: - taf_logger.log("NOTICE", f"{target_name} not in repositories.json") - else: - repositories.pop(target_name) - # update content of repositories.json before updating targets metadata - Path(auth_repo.path, repositoriesdb.REPOSITORIES_JSON_PATH).write_text( - json.dumps(repositories_json, indent=4) - ) - added_targets_data[repositoriesdb.REPOSITORIES_JSON_NAME] = {} - auth_repo_targets_dir = Path(auth_repo.path, TARGETS_DIRECTORY_NAME) + tarets_updated = _remove_from_repositories_json(auth_repo, target_name) + + auth_repo_targets_dir = auth_repo.path / TARGETS_DIRECTORY_NAME target_file_path = auth_repo_targets_dir / target_name if target_file_path.is_file(): os.unlink(str(target_file_path)) - removed_targets_data[target_name] = {} + tarets_updated = True else: - taf_logger.info(f"{target_file_path} target file does not exist") + taf_logger.log("NOTICE", f"{target_file_path} target file does not exist") changes_committed = False - if len(added_targets_data) or len(removed_targets_data): - update_target_metadata( - auth_repo, - added_targets_data, - removed_targets_data, - keystore, - write=False, + if tarets_updated: + commit_msg = git_commit_message("remove-target", target_name=target_name) + register_target_files( + path=path, + keystore=keystore, + commit=True, + scheme=scheme, + auth_repo=auth_repo, + update_snapshot_and_timestamp=True, prompt_for_keys=prompt_for_keys, + push=push, + no_commit_warning=True, + reset_updated_targets_on_error=True, + commit_msg=commit_msg, ) - update_snapshot_and_timestamp( - auth_repo, - keystore, - scheme=DEFAULT_RSA_SIGNATURE_SCHEME, - prompt_for_keys=prompt_for_keys, - ) - auth_repo.commit(git_commit_message("remove-target", target_name=target_name)) changes_committed = True + commit_msg = git_commit_message( + "remove-from-delegated-paths", target_name=target_name + ) delegation_existed = remove_paths( - path, [target_name], keystore, commit=False, prompt_for_keys=prompt_for_keys + path, + [target_name], + keystore=keystore, + commit=True, + prompt_for_keys=prompt_for_keys, + push=False, + commit_msg=commit_msg, ) if delegation_existed: - update_snapshot_and_timestamp( - auth_repo, - keystore, - scheme=DEFAULT_RSA_SIGNATURE_SCHEME, - prompt_for_keys=prompt_for_keys, - ) - auth_repo.commit( - git_commit_message("remove-from-delegated-paths", target_name=target_name) - ) changes_committed = True - else: - taf_logger.info(f"{target_name} not among delegated paths") + # update snapshot and timestamp calls write_all, so targets updates will be saved too if changes_committed and push: auth_repo.push() +def _remove_from_repositories_json(auth_repo, target_name): + repositories_json = repositoriesdb.load_repositories_json(auth_repo) + if repositories_json is not None: + repositories = repositories_json["repositories"] + if target_name not in repositories: + taf_logger.log("NOTICE", f"{target_name} not in repositories.json") + return False + else: + repositories.pop(target_name) + # update content of repositories.json before updating targets metadata + Path(auth_repo.path, repositoriesdb.REPOSITORIES_JSON_PATH).write_text( + json.dumps(repositories_json, indent=4) + ) + return True + else: + taf_logger.log("NOTICE", f"{target_name} not in repositories.json") + return False + + def _save_top_commit_of_repo_to_target( library_dir: Path, repo_name: str, @@ -557,15 +587,17 @@ def update_target_repos_from_repositories_json( _save_top_commit_of_repo_to_target( Path(library_dir), repo_name, repo_path, add_branch ) + register_target_files( repo_path, keystore, None, commit, scheme, - write=True, prompt_for_keys=prompt_for_keys, push=push, + update_snapshot_and_timestamp=True, + reset_updated_targets_on_error=True, ) @@ -640,14 +672,17 @@ def update_and_sign_targets( Path(library_dir), target_name, repo_path, True ) taf_logger.log("NOTICE", f"Updated {target_name} target file") + register_target_files( repo_path, keystore, roles_key_infos, commit, + push, scheme, - write=True, prompt_for_keys=prompt_for_keys, + reset_updated_targets_on_error=True, + update_snapshot_and_timestamp=True, ) diff --git a/taf/api/utils/_conf.py b/taf/api/utils/_conf.py index 0023e355e..06db85b55 100644 --- a/taf/api/utils/_conf.py +++ b/taf/api/utils/_conf.py @@ -1,9 +1,9 @@ from taf.log import taf_logger from pathlib import Path -from typing import Optional +from typing import Optional, Union -def find_taf_directory(auth_repo_path: Path) -> Optional[Path]: +def find_taf_directory(auth_repo_path: Union[Path, str]) -> Optional[Path]: """Look for the .taf directory within the archive root. Args: @@ -13,7 +13,7 @@ def find_taf_directory(auth_repo_path: Path) -> Optional[Path]: Optional[Path]: The path to the .taf directory if found, otherwise None. """ # Check the parent directory of the authentication repository - current_dir = auth_repo_path.parent + current_dir = Path(auth_repo_path).absolute().parent while current_dir != current_dir.root: taf_directory = current_dir / ".taf" if taf_directory.exists() and taf_directory.is_dir(): @@ -21,7 +21,7 @@ def find_taf_directory(auth_repo_path: Path) -> Optional[Path]: current_dir = current_dir.parent # If not found, check the archive root - archive_root = auth_repo_path.parent.parent + archive_root = Path(auth_repo_path).parent.parent current_dir = archive_root while current_dir != current_dir.root: taf_directory = current_dir / ".taf" @@ -29,13 +29,15 @@ def find_taf_directory(auth_repo_path: Path) -> Optional[Path]: return taf_directory current_dir = current_dir.parent - taf_logger.debug(f"No .taf directory found starting from {auth_repo_path.parent}") + taf_logger.debug( + f"No .taf directory found starting from {Path(auth_repo_path).parent}" + ) return None -def find_keystore(path: Path) -> Optional[Path]: +def find_keystore(path: Union[str, Path]) -> Optional[Path]: """Find keystore starting from the given path and traversing parent directories if needed.""" - taf_directory = find_taf_directory(path) + taf_directory = find_taf_directory(Path(path)) if taf_directory: keystore_path = taf_directory / "keystore" if keystore_path.exists() and keystore_path.is_dir(): diff --git a/taf/api/utils/_git.py b/taf/api/utils/_git.py index a5aa573a7..2cee0b87c 100644 --- a/taf/api/utils/_git.py +++ b/taf/api/utils/_git.py @@ -6,12 +6,14 @@ def check_if_clean(func): @functools.wraps(func) def wrapper(*args, **kwargs): - path = kwargs.get("path", None) - if path is None: - path = args[0] - repo = GitRepository(path=path) - if repo.something_to_commit(): - raise RepositoryNotCleanError(repo.name) + skip_check = kwargs.pop("skip_clean_check", False) + if not skip_check: + path = kwargs.get("path", None) + if path is None: + path = args[0] + repo = GitRepository(path=path) + if repo.something_to_commit(): + raise RepositoryNotCleanError(repo.name) # Call the original function return func(*args, **kwargs) diff --git a/taf/api/utils/_metadata.py b/taf/api/utils/_metadata.py deleted file mode 100644 index e2aa8fcc4..000000000 --- a/taf/api/utils/_metadata.py +++ /dev/null @@ -1,149 +0,0 @@ -from logging import DEBUG, ERROR, INFO -from typing import Dict, Optional -from logdecorator import log_on_end, log_on_error, log_on_start -from taf.exceptions import TAFError -from taf.keys import load_signing_keys -from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME -from taf.repository_tool import Repository -from taf.log import taf_logger - - -@log_on_end(INFO, "Updated snapshot and timestamp", logger=taf_logger) -@log_on_error( - ERROR, - "Could not update snapshot and timestamp: {e}", - logger=taf_logger, - on_exceptions=TAFError, - reraise=True, -) -def update_snapshot_and_timestamp( - taf_repo: Repository, - keystore: str, - scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, - write_all: Optional[bool] = True, - prompt_for_keys: Optional[bool] = False, -) -> None: - """ - Sign snapshot and timestamp metadata files. - - Arguments: - taf_repo: Authentication repository. - keystore: Keystore directory's path. - scheme (optional): Signature scheme. - write_all (optional): If True, writes authentication repository's - changes to disk. - prompt_for_keys (optional): Whether to ask the user to enter their key if it is not located inside the keystore directory. - push (optional): Flag specifying whether to push to remote - - Side Effects: - Updates metadata files, saves changes to disk if write_all is True - - Returns: - None - """ - loaded_yubikeys: Dict = {} - - for role in ("snapshot", "timestamp"): - keystore_keys, yubikeys = load_signing_keys( - taf_repo, - role, - loaded_yubikeys, - keystore, - scheme=scheme, - prompt_for_keys=prompt_for_keys, - ) - if len(yubikeys): - update_method = taf_repo.roles_yubikeys_update_method(role) - update_method(yubikeys, write=False) - if len(keystore_keys): - update_method = taf_repo.roles_keystore_update_method(role) - update_method(keystore_keys, write=False) - - if write_all: - taf_repo.writeall() - - -@log_on_start(DEBUG, "Updating target metadata", logger=taf_logger) -@log_on_end(DEBUG, "Updated target metadata", logger=taf_logger) -@log_on_error( - ERROR, - "Could not update target metadata: {e}", - logger=taf_logger, - on_exceptions=TAFError, - reraise=True, -) -def update_target_metadata( - taf_repo: Repository, - added_targets_data: Dict, - removed_targets_data: Dict, - keystore: str, - write: Optional[bool] = False, - scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, - prompt_for_keys: Optional[bool] = False, -) -> bool: - """Given dictionaries containing targets that should be added and targets that should - be removed, update and sign target metadata files and, if write is True, also - sign snapshot and timestamp. - - Arguments: - taf_repo: Authentication repository. - added_targets_data(dict): Dictionary containing targets data that should be added. - removed_targets_data(dict): Dictionary containing targets data that should be removed. - keystore: Keystore directory's path. - write (optional): If True, updates snapshot and timestamp and write changes to disk. - scheme (optional): Signature scheme. - prompt_for_keys (optional): Whether to ask the user to enter their key if it is not located inside the keystore directory. - - Side Effects: - Updates metadata files, saves changes to disk if write_all is True - - Returns: - True if there were targets that were updated, False otherwise - """ - added_targets_data = {} if added_targets_data is None else added_targets_data - removed_targets_data = {} if removed_targets_data is None else removed_targets_data - - roles_targets = taf_repo.roles_targets_for_filenames( - list(added_targets_data.keys()) + list(removed_targets_data.keys()) - ) - - if not roles_targets: - taf_logger.log("NOTICE", "No target files to sign") - return False - - # update targets - loaded_yubikeys: Dict = {} - for role, target_paths in roles_targets.items(): - keystore_keys, yubikeys = load_signing_keys( - taf_repo, - role, - loaded_yubikeys, - keystore, - scheme=scheme, - prompt_for_keys=prompt_for_keys, - ) - targets_data = dict( - added_targets_data={ - path: val - for path, val in added_targets_data.items() - if path in target_paths - }, - removed_targets_data={ - path: val - for path, val in removed_targets_data.items() - if path in target_paths - }, - ) - - if len(yubikeys): - taf_repo.update_targets_yubikeys(yubikeys, write=False, **targets_data) - if len(keystore_keys): - taf_repo.update_targets_keystores( - keystore_keys, write=False, **targets_data - ) - - if write: - update_snapshot_and_timestamp( - taf_repo, keystore, scheme=scheme, prompt_for_keys=prompt_for_keys - ) - return True diff --git a/taf/api/utils/_roles.py b/taf/api/utils/_roles.py deleted file mode 100644 index 434dcc082..000000000 --- a/taf/api/utils/_roles.py +++ /dev/null @@ -1,177 +0,0 @@ -import tuf -from logging import DEBUG, INFO -from typing import Dict, List, Optional, Union -from functools import partial -from logdecorator import log_on_end, log_on_start -from tuf.repository_tool import Repository as TUFRepository, Targets -from taf.exceptions import TAFError -from taf.models.types import RolesIterator -from tuf.repository_tool import Metadata -from taf import YubikeyMissingLibrary -from taf.keys import get_key_name -from taf.auth_repo import AuthenticationRepository -from taf.constants import YUBIKEY_EXPIRATION_DATE -from taf.repository_tool import MAIN_ROLES, Repository, yubikey_signature_provider -from taf.models.types import Role -from taf.log import taf_logger - -ykman_installed = True -try: - import taf.yubikey as yk -except ImportError: - yk = YubikeyMissingLibrary() # type: ignore - - -@log_on_start(INFO, "Creating delegations", logger=taf_logger) -@log_on_end(DEBUG, "Finished creating delegations", logger=taf_logger) -def create_delegations( - role: Role, - repository: AuthenticationRepository, - verification_keys: Dict, - signing_keys: Dict, - existing_roles: Optional[List[str]] = None, -) -> None: - """ - Initialize new delegated target roles, update authentication repository object - - Arguments: - role: Targets main role or a delegated role - repository: Authentication repository. - verification_keys: A dictionary containing mappings of role names to their verification (public) keys. - signing_keys: A dictionary containing mappings of role names to their signing (private) keys. - existing_roles: A list of already initialized roles. - - Side Effects: - Updates authentication repository object - - Returns: - None - """ - if existing_roles is None: - existing_roles = [] - skip_top_role = role.name == "targets" - try: - for delegated_role in RolesIterator(role, skip_top_role=skip_top_role): - parent_role_obj = _role_obj(delegated_role.parent.name, repository) - if not isinstance(parent_role_obj, Targets): - raise TAFError( - f"Could not find parent targets role of role {delegated_role}" - ) - if delegated_role.name in existing_roles: - taf_logger.log("NOTICE", f"Role {delegated_role.name} already set up.") - continue - paths = delegated_role.paths - roles_verification_keys = verification_keys[delegated_role.name] - # if yubikeys are used for signing, signing keys are not loaded - roles_signing_keys = signing_keys.get(delegated_role.name) - parent_role_obj.delegate( - delegated_role.name, - roles_verification_keys, - paths, - threshold=delegated_role.threshold, - terminating=delegated_role.terminating, - ) - setup_role( - delegated_role, - repository, - roles_verification_keys, - roles_signing_keys, - parent=parent_role_obj, - ) - except tuf.exceptions.InvalidNameError: - raise TAFError("All delegated paths should be relative to targets directory.") - - -@log_on_start(DEBUG, "Finding roles of key", logger=taf_logger) -def get_roles_and_paths_of_key( - public_key: Dict, - repository: AuthenticationRepository, -): - roles = repository.find_associated_roles_of_key(public_key) - roles_with_paths: Dict = {role: {} for role in roles} - for role in roles: - if role not in MAIN_ROLES: - roles_with_paths[role] = repository.get_role_paths(role) - return roles_with_paths - - -@log_on_start(INFO, "Setting up role {role.name:s}", logger=taf_logger) -@log_on_end(DEBUG, "Finished setting up role {role.name:s}", logger=taf_logger) -def setup_role( - role: Role, - repository: TUFRepository, - verification_keys: Dict, - signing_keys: Optional[Dict] = None, - parent: Optional[Targets] = None, -) -> None: - """ - Initialize a new role, add signing and verification keys. - """ - role_obj = _role_obj(role.name, repository, parent) - role_obj.threshold = role.threshold - if not role.is_yubikey: - if verification_keys is None or signing_keys is None: - raise TAFError(f"Cannot setup role {role.name}. Keys not specified") - for public_key, private_key in zip(verification_keys, signing_keys): - role_obj.add_verification_key(public_key) - role_obj.load_signing_key(private_key) - else: - yubikeys = role.yubikeys - if yubikeys is None: - yubikeys = [ - get_key_name(role.name, count, role.number) - for count in range(role.number) - ] - for key_name, key in zip(yubikeys, verification_keys): - role_obj.add_verification_key(key, expires=YUBIKEY_EXPIRATION_DATE) - # check if yubikey loaded - if yk.get_key_serial_by_id(key_name): - role_obj.add_external_signature_provider( - key, partial(yubikey_signature_provider, key_name, key["keyid"]) - ) - # Even though we add all verification keys (public keys directly specified in the keys-description) - # and those loaded from YubiKeys, only those directly specified in keys-description are registered - # as previous_keys - # this means that TUF expects at least one of those signing keys to be present - # we are setting up this role, so there should be no previous keys - - try: - tuf.roledb._roledb_dict[repository._repository_name][role.name][ - "previous_keyids" - ] = [] - except Exception: # temporary quick fix, this will all be reworked - tuf.roledb._roledb_dict[repository.name][role.name]["previous_keyids"] = [] - - -def _role_obj( - role: str, - repository: Union[Repository, TUFRepository], - parent: Optional[Targets] = None, -) -> Metadata: - """ - Return role TUF object based on its name - """ - if isinstance(repository, Repository): - tuf_repository = repository._repository - else: - tuf_repository = repository - if role == "targets": - return tuf_repository.targets - elif role == "snapshot": - return tuf_repository.snapshot - elif role == "timestamp": - return tuf_repository.timestamp - elif role == "root": - return tuf_repository.root - else: - # return delegated role - if parent is None: - return tuf_repository.targets(role) - return parent(role) - - -def list_roles(repository: AuthenticationRepository) -> List[str]: - """ - Return a list of all defined roles, main roles combined with delegated targets roles. - """ - return repository.get_all_roles() diff --git a/taf/api/yubikey.py b/taf/api/yubikey.py index 9e3808378..c17b750e0 100644 --- a/taf/api/yubikey.py +++ b/taf/api/yubikey.py @@ -4,13 +4,14 @@ from pathlib import Path from logdecorator import log_on_end, log_on_error, log_on_start -from taf.api.utils._roles import get_roles_and_paths_of_key from taf.auth_repo import AuthenticationRepository +from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME from taf.exceptions import TAFError -from tuf.repository_tool import import_rsakey_from_pem -from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME +# from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME from taf.log import taf_logger +from taf.tuf.keys import get_sslib_key_from_value +from taf.tuf.repository import MAIN_ROLES import taf.yubikey as yk @@ -79,9 +80,10 @@ def export_yk_certificate(path: Optional[str] = None) -> None: try: pub_key_pem = yk.export_piv_pub_key().decode("utf-8") scheme = DEFAULT_RSA_SIGNATURE_SCHEME - key = import_rsakey_from_pem(pub_key_pem, scheme) + key = get_sslib_key_from_value(pub_key_pem, scheme) yk.export_yk_certificate(path, key) - except Exception: + except Exception as e: + print(e) print("Could not export certificate. Check if a YubiKey is inserted") return @@ -109,7 +111,12 @@ def get_yk_roles(path: str) -> Dict: """ auth = AuthenticationRepository(path=path) pub_key = yk.get_piv_public_key_tuf() - return get_roles_and_paths_of_key(pub_key, auth) + roles = auth.find_associated_roles_of_key(pub_key) + roles_with_paths: Dict = {role: {} for role in roles} + for role in roles: + if role not in MAIN_ROLES: + roles_with_paths[role] = auth.get_role_paths(role) + return roles_with_paths @log_on_start(DEBUG, "Setting up a new signing YubiKey", logger=taf_logger) diff --git a/taf/auth_repo.py b/taf/auth_repo.py index dc49fa111..72ac73dc0 100644 --- a/taf/auth_repo.py +++ b/taf/auth_repo.py @@ -1,24 +1,24 @@ import json import os -import tempfile import fnmatch +import pygit2 from typing import Any, Callable, Dict, List, Optional, Union from collections import defaultdict from contextlib import contextmanager from pathlib import Path -import pygit2 -from tuf.repository_tool import METADATA_DIRECTORY_NAME +from taf.tuf.storage import GitStorageBackend from taf.git import GitRepository -from taf.repository_tool import ( - Repository as TAFRepository, +from taf.tuf.repository import ( + METADATA_DIRECTORY_NAME, + MetadataRepository as TUFRepository, get_role_metadata_path, get_target_path, ) from taf.constants import INFO_JSON_PATH -class AuthenticationRepository(GitRepository, TAFRepository): +class AuthenticationRepository(GitRepository): LAST_VALIDATED_FILENAME = "last_validated_commit" LAST_VALIDATED_KEY = "last_validated_commit" @@ -77,6 +77,24 @@ def __init__( self.conf_directory_root = conf_directory_root_path.resolve() self.out_of_band_authentication = out_of_band_authentication + self._storage = GitStorageBackend() + self._tuf_repository = TUFRepository(self.path, storage=self._storage) + + def __getattr__(self, item): + """Delegate attribute lookup to TUFRepository instance""" + if item in self.__dict__: + return self.__dict__[item] + try: + # First try to get attribute from super class (GitRepository) + return super().__getattribute__(item) + except AttributeError: + # If not found, delegate to TUFRepository + return getattr(self._tuf_repository, item) + + def __dir__(self): + """Return list of attributes available on this object, including those + from TUFRepository.""" + return super().__dir__() + dir(self._tuf_repository) # TODO rework conf_dir @@ -109,8 +127,9 @@ def conf_dir(self) -> str: return self._conf_dir @property - def certs_dir(self) -> str: - certs_dir = Path(self.path, "certs") + def certs_dir(self): + certs_dir = self.path / "certs" + certs_dir.mkdir(parents=True, exist_ok=True) return str(certs_dir) @property @@ -240,6 +259,38 @@ def get_info_json( def get_metadata_path(self, role): return self.path / METADATA_DIRECTORY_NAME / f"{role}.json" + def get_role_repositories(self, role, parent_role=None): + """Get repositories of the given role + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + - parent_role(str): Name of the parent role of the delegated role. If not specified, + it will be set automatically, but this might be slow if there + are many delegations. + + Returns: + Repositories' path from repositories.json that matches given role paths + + Raises: + - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. + - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this + """ + if self.is_bare_repository: + # raise an error for now + # once we have an ergonomic way to get repositories from a bare repository, remove the error + raise Exception( + "Getting role repositories from a bare repository is not yet supported." + ) + + role_paths = self._tuf_repository.get_role_paths(role) + + target_repositories = self._get_target_repositories_from_disk() + return [ + repo + for repo in target_repositories + if any([fnmatch.fnmatch(repo, path) for path in role_paths]) + ] + def is_commit_authenticated(self, target_name: str, commit: str) -> bool: """Checks if passed commit is ever authenticated for given target name.""" for auth_commit in self.all_commits_on_branch(reverse=False): @@ -256,27 +307,12 @@ def is_commit_authenticated(self, target_name: str, commit: str) -> bool: @contextmanager def repository_at_revision(self, commit: str): """ - Context manager which makes sure that TUF repository is instantiated - using metadata files at the specified revision. Creates a temp directory - and metadata files inside it. Deleted the temp directory when no longer - needed. + Context manager that enables reading metadata from an older commit. + This should be used in combination with the Git storage backend. """ - tuf_repository = self._tuf_repository - with tempfile.TemporaryDirectory() as temp_dir: - metadata_files = self.list_files_at_revision( - commit, METADATA_DIRECTORY_NAME - ) - Path(temp_dir, METADATA_DIRECTORY_NAME).mkdir(parents=True) - for file_name in metadata_files: - path = Path(temp_dir, METADATA_DIRECTORY_NAME, file_name) - with open(path, "w") as f: - data = self.get_json( - commit, f"{METADATA_DIRECTORY_NAME}/{file_name}" - ) - json.dump(data, f) - self._load_tuf_repository(temp_dir) - yield - self._tuf_repository = tuf_repository + self._storage.commit = commit + yield + self._storage.commit = None def set_last_validated_data( self, @@ -565,3 +601,13 @@ def targets_at_revisions( "custom": target_content, } return targets + + def _get_target_repositories_from_disk(self): + """ + Read repositories.json from disk and return the list of target repositories + """ + repositories_path = self.targets_path / "repositories.json" + if repositories_path.exists(): + repositories = repositories_path.read_text() + repositories = json.loads(repositories)["repositories"] + return [str(Path(target_path).as_posix()) for target_path in repositories] diff --git a/taf/constants.py b/taf/constants.py index e1a141635..1b5dffa3d 100644 --- a/taf/constants.py +++ b/taf/constants.py @@ -1,10 +1,10 @@ -# Default scheme for all RSA keys. It can be changed in keys.json while -# generating repository +import attrs import datetime from typing import List, Optional -from tuf.repository_tool import TARGETS_DIRECTORY_NAME -import attrs + +TARGETS_DIRECTORY_NAME = "targets" +METADATA_DIRECTORY_NAME = "metadata" DEFAULT_RSA_SIGNATURE_SCHEME = "rsa-pkcs1v15-sha256" diff --git a/taf/exceptions.py b/taf/exceptions.py index 885c31921..6ded2b0cb 100644 --- a/taf/exceptions.py +++ b/taf/exceptions.py @@ -19,6 +19,10 @@ def __init__(self, repo): ) +class CommandValidationError(TAFError): + pass + + class FetchException(TAFError): def __init__(self, path: str): self.message = f"Cannot fetch changes. Repo: {path}" @@ -74,6 +78,10 @@ class InvalidPINError(TAFError): pass +class PushFailedError(GitError): + pass + + class RemoveMetadataKeyThresholdError(TAFError): def __init__(self, threshold: int): super().__init__( @@ -133,6 +141,12 @@ def __init__(self, script: str, error_msg: str): self.script = script +class SignersNotLoaded(TAFError): + def __init__(self, roles): + message = f"Signers of roles {', '.join(roles)} not loaded." + super().__init__(message) + + class MetadataUpdateError(TAFError): def __init__(self, metadata_role: str, message: str): super().__init__( diff --git a/taf/git.py b/taf/git.py index 02fff634d..f2c6868a0 100644 --- a/taf/git.py +++ b/taf/git.py @@ -4,6 +4,7 @@ import itertools import os import re +import shutil import uuid import pygit2 import subprocess @@ -16,6 +17,7 @@ from taf.exceptions import ( NoRemoteError, NothingToCommitError, + PushFailedError, TAFError, CloneRepoException, FetchException, @@ -96,7 +98,7 @@ def __init__( self.path = self._validate_repo_path(path) self.alias = alias - self.urls = self._validate_urls(urls) + self.urls = self._validate_urls([str(url) for url in urls]) if urls else None self.allow_unsafe = allow_unsafe self.custom = custom or {} if default_branch is None: @@ -154,6 +156,8 @@ def to_json_dict(self): _remotes = None + _is_bare_repo = None + @property def remotes(self) -> List[str]: if self._remotes is None: @@ -227,12 +231,15 @@ def pygit_repo(self) -> pygit2.Repository: @property def is_bare_repository(self) -> bool: - if self.pygit_repo is None: - self._log_debug( - "pygit repository could not be instantiated, assuming not bare" - ) - return False - return self.pygit_repo.is_bare + if self._is_bare_repo is None: + if self.pygit_repo is not None: + self._is_bare_repo = self.pygit_repo.is_bare + else: + raise GitError( + "Cannot determine if repository is a bare repository. Cannot instantiate pygit repository" + ) + + return self._is_bare_repo def _git(self, cmd, *args, **kwargs): """Call git commands in subprocess @@ -639,6 +646,32 @@ def checkout_orphan_branch(self, branch_name: str) -> None: except GitError: # If repository is empty pass + def check_files_exist( + self, file_paths: List[str], commit_sha: Optional[str] = None + ): + """ + Check if file paths are known to git + """ + repo = self.pygit_repo + if commit_sha is None: + commit_sha = self.head_commit_sha() + + commit = repo[commit_sha] + tree = commit.tree # Get the tree of that commit + + existing_files = [] + non_existing = [] + + for file_path in file_paths: + try: + # Check if the file exists in the tree + tree[file_path] + existing_files.append(file_path) + except KeyError: + non_existing.append(file_path) + + return existing_files, non_existing + def clean(self): self._git("clean -fd") @@ -878,8 +911,11 @@ def branch_unpushed_commits(self, branch_name): return bool(unpushed_commits), [commit.id for commit in unpushed_commits] - def commit(self, message: str) -> str: - self._git("add -A") + def commit(self, message: str, paths_to_commit: Optional[List[str]] = None) -> str: + if not paths_to_commit: + self._git("add -A") + else: + self._git(f"add {' '.join(paths_to_commit)}") try: self._git("diff --cached --exit-code --shortstat", reraise_error=True) except GitError: @@ -1428,10 +1464,7 @@ def push( self._log_notice("Successfully pushed to remote") return True except GitError as e: - self._log_error( - f"Push failed: {str(e)}. Please check if there are upstream changes." - ) - raise TAFError("Push operation failed") from e + raise PushFailedError(self, message=f"Push operation failed: {e}") def remove_remote(self, remote_name: str) -> None: try: @@ -1476,6 +1509,20 @@ def reset_to_commit( if hard: self._git(f"reset {flag} HEAD") + def restore(self, file_paths: List[str]) -> None: + if not file_paths: + return + file_paths = [str(Path(file_path).as_posix()) for file_path in file_paths] + existing, non_existing = self.check_files_exist(file_paths) + if existing: + self._git(f"restore {' '.join(existing)}") + for path in non_existing: + file_path = Path(path) + if file_path.is_file(): + file_path.unlink() + elif file_path.is_dir(): + shutil.rmtree(file_path) + def update_branch_refs(self, branch: str, commit: str) -> None: # Update the local branch reference to the specific commit self._git(f"update-ref refs/heads/{branch} {commit}") diff --git a/taf/keys.py b/taf/keys.py index d766c92c4..68c4862b8 100644 --- a/taf/keys.py +++ b/taf/keys.py @@ -1,20 +1,24 @@ from collections import defaultdict +from functools import partial from logging import INFO from typing import Dict, List, Optional, Tuple, Union import click from pathlib import Path from logdecorator import log_on_start -from taf.auth_repo import AuthenticationRepository from taf.log import taf_logger from taf.models.types import Role, RolesIterator from taf.models.models import TAFKey from taf.models.types import TargetsRole, MainRoles, UserKeyData -from taf.repository_tool import Repository +from taf.tuf.repository import MetadataRepository as TUFRepository from taf.api.utils._conf import find_keystore -from tuf.repository_tool import ( - generate_and_write_unencrypted_rsa_keypair, +from taf.tuf.keys import ( + YkSigner, generate_and_write_rsa_keypair, + generate_rsa_keypair, + get_sslib_key_from_value, + load_signer_from_pem, ) + from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME, RoleSetupParams from taf.exceptions import ( KeystoreError, @@ -24,15 +28,10 @@ from taf.keystore import ( get_keystore_keys_of_role, key_cmd_prompt, - read_private_key_from_keystore, - read_public_key_from_keystore, + load_signer_from_private_keystore, ) from taf import YubikeyMissingLibrary -from securesystemslib import keys -from securesystemslib.interface import ( - import_rsa_privatekey_from_file, - import_rsa_publickey_from_file, -) +from securesystemslib.signer._crypto_signer import CryptoSigner try: import taf.yubikey as yk @@ -61,7 +60,7 @@ def get_metadata_key_info(certs_dir: str, key_id: str) -> TAFKey: file whose name matches that key's id. """ cert_path = Path(certs_dir, key_id + ".cert") - if cert_path.exists(): + if cert_path.is_file(): cert_pem = cert_path.read_bytes() return TAFKey(key_id, **_extract_x509(cert_pem)) @@ -90,13 +89,13 @@ def _get_attr(oid): def load_sorted_keys_of_new_roles( - auth_repo: AuthenticationRepository, roles: Union[MainRoles, TargetsRole], yubikeys_data: Optional[Dict[str, UserKeyData]], - keystore: Optional[str], + keystore: Optional[Union[Path, str]], yubikeys: Optional[Dict[str, Dict]] = None, existing_roles: Optional[List[str]] = None, skip_prompt: Optional[bool] = False, + certs_dir: Optional[Union[Path, str]] = None, ): """ Load signing keys of roles - first those stored on YubiKeys to avoid entering pins @@ -139,77 +138,50 @@ def _sort_roles(roles): existing_roles = [] try: keystore_roles, yubikey_roles = _sort_roles(roles) - signing_keys: Dict = {} + signers: Dict = {} verification_keys: Dict = {} for role in keystore_roles: if role.name in existing_roles: continue - keystore_keys, _ = setup_roles_keys( + keystore_signers, _, _ = setup_roles_keys( role, - auth_repo, - auth_repo.path, keystore=keystore, skip_prompt=skip_prompt, ) - for public_key, private_key in keystore_keys: - signing_keys.setdefault(role.name, []).append(private_key) - verification_keys.setdefault(role.name, []).append(public_key) + for signer in keystore_signers: + signers.setdefault(role.name, []).append(signer) for role in yubikey_roles: if role.name in existing_roles: continue - _, yubikey_keys = setup_roles_keys( + _, yubikey_keys, yubikey_signers = setup_roles_keys( role, - auth_repo=auth_repo, - certs_dir=auth_repo.certs_dir, + certs_dir=certs_dir, yubikeys=yubikeys, users_yubikeys_details=yubikeys_data, skip_prompt=skip_prompt, ) verification_keys[role.name] = yubikey_keys - return signing_keys, verification_keys + signers[role.name] = yubikey_signers + return signers, verification_keys except KeystoreError: raise SigningError("Could not load keys of new roles") -@log_on_start( - INFO, - "Public key {key_name}.pub not found. Generating from private key.", - logger=taf_logger, -) -def _generate_public_key_from_private(keystore_path, key_name, scheme): - """Generate public key from the private key and return the key object""" - try: - priv_key = import_rsa_privatekey_from_file( - str(keystore_path / key_name), scheme=scheme - ) - public_key_pem = priv_key["keyval"]["public"] - public_key_path = keystore_path / f"{key_name}.pub" - public_key_path.write_text(public_key_pem) - return import_rsa_publickey_from_file(str(public_key_path), scheme=scheme) - except Exception as e: - taf_logger.error(f"Error generating public key for {key_name}: {e}") - return None - - -def _load_from_keystore( +def _load_signer_from_keystore( taf_repo, keystore_path, key_name, num_of_signatures, scheme, role -): +) -> CryptoSigner: if keystore_path is None: return None if (keystore_path / key_name).is_file(): try: - key = read_private_key_from_keystore( - keystore_path, key_name, num_of_signatures, scheme + signer = load_signer_from_private_keystore( + keystore=keystore_path, key_name=key_name, scheme=scheme ) # load only valid keys - if taf_repo.is_valid_metadata_key(role, key, scheme=scheme): - # Check if the public key is missing and generate it if necessary - public_key_path = keystore_path / f"{key_name}.pub" - if not public_key_path.exists(): - _generate_public_key_from_private(keystore_path, key_name, scheme) - return key + if taf_repo.is_valid_metadata_key(role, signer.public_key, scheme=scheme): + return signer except KeystoreError: pass @@ -217,8 +189,8 @@ def _load_from_keystore( @log_on_start(INFO, "Loading signing keys of '{role:s}'", logger=taf_logger) -def load_signing_keys( - taf_repo: Repository, +def load_signers( + taf_repo: TUFRepository, role: str, loaded_yubikeys: Optional[Dict], keystore: Optional[str] = None, @@ -234,7 +206,7 @@ def load_signing_keys( signing_keys_num = len(taf_repo.get_role_keys(role)) all_loaded = False num_of_signatures = 0 - keys = [] + signers_keystore = [] yubikeys = [] # first try to sign using yubikey @@ -254,7 +226,7 @@ def load_signing_keys( def _load_and_append_yubikeys( key_name, role, retry_on_failure, hide_already_loaded_message ): - public_key, _ = yk.yubikey_prompt( + public_key, serial_num = yk.yubikey_prompt( key_name, role, taf_repo, @@ -263,7 +235,10 @@ def _load_and_append_yubikeys( hide_already_loaded_message=hide_already_loaded_message, ) if public_key is not None and public_key not in yubikeys: - yubikeys.append(public_key) + signer = YkSigner( + public_key, partial(yk.yk_secrets_handler, serial_num=serial_num) + ) + yubikeys.append(signer) taf_logger.info(f"Successfully loaded {key_name} from inserted YubiKey") return True return False @@ -279,11 +254,11 @@ def _load_and_append_yubikeys( # there is no need to ask the user if they want to load more key, try to load from keystore if num_of_signatures < len(keystore_files): key_name = keystore_files[num_of_signatures] - key = _load_from_keystore( + signer = _load_signer_from_keystore( taf_repo, keystore_path, key_name, num_of_signatures, scheme, role ) - if key is not None: - keys.append(key) + if signer is not None: + signers_keystore.append(signer) num_of_signatures += 1 continue if num_of_signatures >= threshold: @@ -313,20 +288,21 @@ def _load_and_append_yubikeys( continue if prompt_for_keys and click.confirm(f"Manually enter {role} key?"): + keys = [signer.public_key for signer in signers_keystore] key = key_cmd_prompt(key_name, role, taf_repo, keys, scheme) - keys.append(key) + signer = load_signer_from_pem(key) + signers_keystore.append(key) num_of_signatures += 1 else: raise SigningError(f"Cannot load keys of role {role}") - return keys, yubikeys + return signers_keystore, yubikeys def setup_roles_keys( role: Role, - auth_repo: AuthenticationRepository, certs_dir: Optional[Union[Path, str]] = None, - keystore: Optional[str] = None, + keystore: Optional[Union[Path, str]] = None, yubikeys: Optional[Dict] = None, users_yubikeys_details: Optional[Dict[str, UserKeyData]] = None, skip_prompt: Optional[bool] = False, @@ -336,7 +312,8 @@ def setup_roles_keys( if role.name is None: raise SigningError("Cannot set up roles keys. Role name not specified") yubikey_keys = [] - keystore_keys = [] + keystore_signers = [] + yubikey_signers = [] yubikey_ids = role.yubikey_ids if yubikey_ids is None: @@ -347,31 +324,27 @@ def setup_roles_keys( is_yubikey = bool(yubikey_ids) if is_yubikey: - yubikey_keys = _setup_yubikey_roles_keys( + yubikey_keys, yubikey_signers = _setup_yubikey_roles_keys( yubikey_ids, users_yubikeys_details, yubikeys, role, certs_dir, key_size ) else: if keystore is None: - keystore_path = find_keystore(auth_repo.path) - if keystore_path is None: - taf_logger.warning("No keystore provided and no default keystore found") - else: - keystore = str(keystore_path) + taf_logger.error("No keystore provided and no default keystore found") + raise KeyError("No keystore provided and no default keystore found") default_params = RoleSetupParams() for key_num in range(role.number): key_name = get_key_name(role.name, key_num, role.number) - public_key, private_key = _setup_keystore_key( + signer = _setup_keystore_key( keystore, role.name, key_name, - key_num, role.scheme or default_params["scheme"], role.length or default_params["length"], None, skip_prompt=skip_prompt, ) - keystore_keys.append((public_key, private_key)) - return keystore_keys, yubikey_keys + keystore_signers.append(signer) + return keystore_signers, yubikey_keys, yubikey_signers def _setup_yubikey_roles_keys( @@ -380,32 +353,27 @@ def _setup_yubikey_roles_keys( loaded_keys_num = 0 yk_with_public_key = {} yubikey_keys = [] - + signers = [] for key_id in yubikey_ids: - # Check the present value from the yubikeys dictionary - if ( - key_id in users_yubikeys_details - and not users_yubikeys_details[key_id].present - ): - continue public_key_text = None if key_id in users_yubikeys_details: public_key_text = users_yubikeys_details[key_id].public if public_key_text: scheme = users_yubikeys_details[key_id].scheme - public_key = keys.import_rsakey_from_public_pem(public_key_text, scheme) + public_key = get_sslib_key_from_value(public_key_text, scheme) # Check if the signing key is already loaded if not yk.get_key_serial_by_id(key_id): yk_with_public_key[key_id] = public_key else: loaded_keys_num += 1 + yubikey_keys.append(public_key) else: key_scheme = None if key_id in users_yubikeys_details: key_scheme = users_yubikeys_details[key_id].scheme key_scheme = key_scheme or role.scheme - public_key = _setup_yubikey( + public_key, serial_num = _setup_yubikey( yubikeys, role.name, key_id, @@ -415,17 +383,32 @@ def _setup_yubikey_roles_keys( key_size, ) loaded_keys_num += 1 - yubikey_keys.append(public_key) + signer = YkSigner( + public_key, partial(yk.yk_secrets_handler, serial_num=serial_num) + ) + signers.append(signer) if loaded_keys_num < role.threshold: print(f"Threshold of role {role.name} is {role.threshold}") while loaded_keys_num < role.threshold: loaded_keys = [] for key_id, public_key in yk_with_public_key.items(): - if _load_and_verify_yubikey(yubikeys, role.name, key_id, public_key): + if ( + key_id in users_yubikeys_details + and not users_yubikeys_details[key_id].present + ): + continue + serial_num = _load_and_verify_yubikey( + yubikeys, role.name, key_id, public_key + ) + if serial_num: loaded_keys_num += 1 loaded_keys.append(key_id) - yubikey_keys.append(public_key) + signer = YkSigner( + public_key, + partial(yk.yk_secrets_handler, serial_num=serial_num), + ) + signers.append(signer) if loaded_keys_num == role.threshold: break if loaded_keys_num < role.threshold: @@ -436,55 +419,43 @@ def _setup_yubikey_roles_keys( for key_id in loaded_keys: yk_with_public_key.pop(key_id) - return yubikey_keys + return yubikey_keys, signers def _setup_keystore_key( - keystore: Optional[str], + keystore: Optional[Union[Path, str]], role_name: str, key_name: str, - key_num: int, scheme: str, length: int, password: Optional[str], skip_prompt: Optional[bool], -) -> Tuple[Optional[Dict], Optional[Dict]]: +) -> CryptoSigner: # if keystore exists, load the keys generate_new_keys = keystore is None - public_key = private_key = None + signer = None - def _invalid_key_message(key_name, keystore, is_public): - extension = ".pub" if is_public else "" - key_path = Path(keystore, f"{key_name}{extension}") + def _invalid_key_message(key_name, keystore): + key_path = Path(keystore, key_name) if key_path.is_file(): - if is_public: - print(f"Could not load public key {key_path}") - else: - print(f"Could not load private key {key_path}") + print(f"Could not load private key {key_path}") else: print(f"{key_path} is not a file!") if keystore is not None: keystore_path = str(Path(keystore).expanduser().resolve()) - while public_key is None and private_key is None: - try: - public_key = read_public_key_from_keystore( - keystore_path, key_name, scheme - ) - except KeystoreError: - _invalid_key_message(key_name, keystore, True) + while signer is None: try: - private_key = read_private_key_from_keystore( + signer = load_signer_from_private_keystore( keystore_path, key_name, - key_num=key_num, scheme=scheme, password=password, ) except KeystoreError: - _invalid_key_message(key_name, keystore, False) + _invalid_key_message(key_name, keystore) - if public_key is None or private_key is None: + if signer is None: generate_new_keys = skip_prompt is True or click.confirm( "Generate new keys?" ) @@ -512,28 +483,16 @@ def _invalid_key_message(key_name, keystore, is_public): password = input( "Enter keystore password and press ENTER (can be left empty)" ) - if not password: - generate_and_write_unencrypted_rsa_keypair( - filepath=str(Path(keystore) / key_name), bits=length - ) - else: - generate_and_write_rsa_keypair( - password=password, - filepath=str(Path(keystore) / key_name), - bits=length, - ) - public_key = read_public_key_from_keystore(keystore, key_name, scheme) - private_key = read_private_key_from_keystore( - keystore, key_name, key_num=key_num, scheme=scheme, password=password + private_pem = generate_and_write_rsa_keypair( + path=Path(keystore, key_name), key_size=length, password=password ) + signer = load_signer_from_pem(private_pem) else: - rsa_key = keys.generate_rsa_key(bits=length) - private_key_val = rsa_key["keyval"]["private"] - print(f"{role_name} key:\n\n{private_key_val}\n\n") - public_key = rsa_key - private_key = rsa_key + _, private_pem = generate_rsa_keypair(key_size=length) + print(f"{role_name} key:\n\n{private_pem.decode()}\n\n") + signer = load_signer_from_pem(private_pem) - return public_key, private_key + return signer def _setup_yubikey( @@ -544,7 +503,7 @@ def _setup_yubikey( scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, certs_dir: Optional[Union[Path, str]] = None, key_size: int = 2048, -) -> Dict: +) -> Tuple[Dict, str]: print(f"Registering keys for {key_name}") while True: use_existing = click.confirm("Do you want to reuse already set up Yubikey?") @@ -573,14 +532,14 @@ def _setup_yubikey( if certs_dir is not None: yk.export_yk_certificate(certs_dir, key) - return key + return key, serial_num def _load_and_verify_yubikey( yubikeys: Optional[Dict], role_name: str, key_name: str, public_key -) -> bool: +) -> Optional[str]: if not click.confirm(f"Sign using {key_name} Yubikey?"): - return False + return None while True: yk_public_key, _ = yk.yubikey_prompt( key_name, @@ -596,5 +555,5 @@ def _load_and_verify_yubikey( if yk_public_key["keyid"] != public_key["keyid"]: print("Public key of the inserted key is not equal to the specified one.") if not click.confirm("Try again?"): - return False - return True + return None + return yk.get_serial_num() diff --git a/taf/keystore.py b/taf/keystore.py index f60aee1ac..55b9e69ba 100644 --- a/taf/keystore.py +++ b/taf/keystore.py @@ -3,19 +3,24 @@ from getpass import getpass from os import getcwd from pathlib import Path -from typing import Dict, List, Optional +from typing import List, Optional import click import securesystemslib -from securesystemslib.interface import ( - import_rsa_privatekey_from_file, - import_rsa_publickey_from_file, +from taf.tuf.keys import ( + load_public_key_from_file, + load_signer_from_file, + load_signer_from_pem, ) -from taf.repository_tool import Repository -from tuf.repository_tool import import_rsakey_from_pem from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME from taf.exceptions import KeystoreError +from taf.tuf.repository import MetadataRepository as TUFRepository + +from securesystemslib.signer._crypto_signer import CryptoSigner + +from securesystemslib.signer._key import SSlibKey + def default_keystore_path() -> str: keystore_path = str(Path(getcwd(), "keystore")) @@ -47,55 +52,42 @@ def _from_public_pem(pem: str) -> str: def key_cmd_prompt( key_name: str, role: str, - taf_repo: Repository, + taf_repo: TUFRepository, loaded_keys: Optional[List] = None, scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, -) -> Optional[Dict]: +) -> CryptoSigner: def _enter_and_check_key(key_name, role, loaded_keys, scheme): pem = getpass(f"Enter {key_name} private key without its header and footer\n") pem = _form_private_pem(pem) try: - key = import_rsakey_from_pem(pem, scheme) + signer = load_signer_from_pem(pem, scheme) except Exception: print("Invalid key") return None - public_key = import_rsakey_from_pem(key["keyval"]["public"], scheme) + public_key = signer.public_key if not taf_repo.is_valid_metadata_yubikey(role, public_key): print(f"The entered key is not a valid {role} key") return None - if loaded_keys is not None and key in loaded_keys: + if loaded_keys is not None and public_key in loaded_keys: print("Key already entered") return None - return key + return signer while True: - key = _enter_and_check_key(key_name, role, loaded_keys, scheme) - if key is not None: - return key - + pem = _enter_and_check_key(key_name, role, loaded_keys, scheme) + if pem is not None: + return pem -def load_tuf_private_key( - key_str: str, key_name: str, scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME -) -> Dict: - if not key_str: - key_str = getpass( - f"Enter {key_name} private key without its header and footer\n" - ) - key_pem = _form_private_pem(key_str) - return import_rsakey_from_pem(key_pem, scheme) - - -def new_public_key_cmd_prompt(scheme: Optional[str]) -> Dict: +def new_public_key_cmd_prompt(scheme: Optional[str]) -> SSlibKey: def _enter_and_check_key(scheme): pem = getpass("Enter public key without its header and footer\n") pem = _from_public_pem(pem) try: - key = import_rsakey_from_pem(pem, scheme) + return load_public_key_from_file(pem, scheme) except Exception: print("Invalid key") return None - return import_rsakey_from_pem(key["keyval"]["public"], scheme) while True: key = _enter_and_check_key(scheme) @@ -103,13 +95,12 @@ def _enter_and_check_key(scheme): return key -def read_private_key_from_keystore( +def load_signer_from_private_keystore( keystore: str, key_name: str, - key_num: Optional[int] = None, scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME, password: Optional[str] = None, -) -> Dict: +) -> CryptoSigner: key_path = Path(keystore, key_name).expanduser().resolve() if not key_path.is_file(): raise KeystoreError(f"{str(key_path)} does not exist") @@ -117,44 +108,42 @@ def read_private_key_from_keystore( def _read_key(path, password, scheme): def _read_key_or_keystore_error(path, password, scheme): try: - return import_rsa_privatekey_from_file( - str(Path(keystore, key_name)), password or None, scheme=scheme - ) - except ( - securesystemslib.exceptions.FormatError, - securesystemslib.exceptions.Error, - ) as e: - if "password" in str(e).lower(): - return None + return load_signer_from_file(path, password or None, scheme=scheme) + except TypeError: + raise + except Exception as e: raise KeystoreError(e) try: # try to load with a given password or None return _read_key_or_keystore_error(path, password, scheme) - except securesystemslib.exceptions.CryptoError: + except TypeError: password = getpass( f"Enter {key_name} keystore file password and press ENTER" ) - return _read_key_or_keystore_error(path, password, scheme) + try: + return _read_key_or_keystore_error(path, password, scheme) + except Exception: + return None except Exception: return None while True: - key = _read_key(key_path, password, scheme) - if key is not None: - return key + signer = _read_key(key_path, password, scheme) + if signer is not None: + return signer if not click.confirm(f"Could not open keystore file {key_path}. Try again?"): raise KeystoreError(f"Could not open keystore file {key_path}") def read_public_key_from_keystore( keystore: str, key_name: str, scheme: Optional[str] = DEFAULT_RSA_SIGNATURE_SCHEME -) -> Dict: +) -> SSlibKey: pub_key_path = Path(keystore, f"{key_name}.pub").expanduser().resolve() if not pub_key_path.is_file(): raise KeystoreError(f"{str(pub_key_path)} does not exist") try: - return import_rsa_publickey_from_file(str(pub_key_path), scheme) + return load_public_key_from_file(str(pub_key_path), scheme) except ( securesystemslib.exceptions.FormatError, securesystemslib.exceptions.Error, diff --git a/taf/log.py b/taf/log.py index a65387a11..ad531ee09 100644 --- a/taf/log.py +++ b/taf/log.py @@ -2,12 +2,10 @@ import sys import logging from typing import Dict -import securesystemslib from pathlib import Path -import tuf.log -import tuf.repository_tool -import tuf.exceptions +# import tuf.log +# import tuf.exceptions from loguru import logger as taf_logger import taf.settings as settings @@ -46,7 +44,7 @@ def formatter(record): def disable_console_logging(): try: taf_logger.remove(console_loggers["log"]) - disable_tuf_console_logging() + # disable_tuf_console_logging() except ValueError: # will be raised if this is called twice pass @@ -55,26 +53,26 @@ def disable_console_logging(): def disable_file_logging(): try: taf_logger.remove(file_loggers["log"]) - disable_tuf_console_logging() + # disable_tuf_console_logging() except ValueError: # will be raised if this is called twice pass -def disable_tuf_console_logging(): - try: - tuf.log.set_console_log_level(logging.CRITICAL) - except securesystemslib.exceptions.Error: - pass +# def disable_tuf_console_logging(): +# try: +# tuf.log.set_console_log_level(logging.CRITICAL) +# except securesystemslib.exceptions.Error: +# pass -def disable_tuf_file_logging(): - if tuf.log.file_handler is not None: - tuf.log.disable_file_logging() - else: - logging.getLogger("tuf").setLevel(logging.CRITICAL) - logging.getLogger("securesystemslib_keys").setLevel(logging.CRITICAL) - logging.getLogger("securesystemslib_util").setLevel(logging.CRITICAL) +# def disable_tuf_file_logging(): +# if tuf.log.file_handler is not None: +# tuf.log.disable_file_logging() +# else: +# logging.getLogger("tuf").setLevel(logging.CRITICAL) +# logging.getLogger("securesystemslib_keys").setLevel(logging.CRITICAL) +# logging.getLogger("securesystemslib_util").setLevel(logging.CRITICAL) def _get_log_location(): @@ -93,10 +91,10 @@ def initialize_logger_handlers(): console_loggers["log"] = taf_logger.add( sys.stdout, format=formatter, level=VERBOSITY_LEVELS[settings.VERBOSITY] ) - tuf.log.set_console_log_level(logging.ERROR) - else: - # if console logging is disable, remove tuf console logger - disable_tuf_console_logging() + # tuf.log.set_console_log_level(logging.ERROR) + # else: + # if console logging is disable, remove tuf console logger + # disable_tuf_console_logging() if settings.ENABLE_FILE_LOGGING: log_location = _get_log_location() @@ -112,13 +110,13 @@ def initialize_logger_handlers(): format=_FILE_FORMAT_STRING, level=settings.ERROR_LOGGING_LEVEL, ) - try: - tuf.log.set_filehandler_log_level(settings.FILE_LOGGING_LEVEL) - except tuf.exceptions.Error: - pass - else: - # if file logging is disabled, also disable tuf file logging - disable_tuf_file_logging() + # try: + # tuf.log.set_filehandler_log_level(settings.FILE_LOGGING_LEVEL) + # except tuf.exceptions.Error: + # pass + # else: + # # if file logging is disabled, also disable tuf file logging + # disable_tuf_file_logging() initialize_logger_handlers() diff --git a/taf/messages.py b/taf/messages.py index 3a0698bb1..6fd3d0009 100644 --- a/taf/messages.py +++ b/taf/messages.py @@ -10,7 +10,7 @@ "update-expiration-dates": "Update expiration date of {roles}", "add-role": "Add new role {role}", "remove-role": "Remove role {role}", - "add-role-paths": "Delegate paths {paths} to role {role}", + "add-role-paths": "Delegate path(s) {paths} to role {role}", "add-roles": "Add new roles {roles}", "add-signing-key": "Add new signing key to role {role}", "remove-role-paths": "Remove delegations {paths} from role {role}", diff --git a/taf/repositoriesdb.py b/taf/repositoriesdb.py index 6e03f428c..d824ee54e 100644 --- a/taf/repositoriesdb.py +++ b/taf/repositoriesdb.py @@ -2,8 +2,8 @@ from typing import Callable, Dict, List, Optional, Type import fnmatch from pathlib import Path -from tuf.repository_tool import TARGETS_DIRECTORY_NAME from taf.auth_repo import AuthenticationRepository +from taf.constants import TARGETS_DIRECTORY_NAME from taf.exceptions import ( InvalidOrMissingMetadataError, RepositoriesNotFoundError, diff --git a/taf/repository_tool.py b/taf/repository_tool.py deleted file mode 100644 index 1f5a649a2..000000000 --- a/taf/repository_tool.py +++ /dev/null @@ -1,1729 +0,0 @@ -import datetime -import json -import operator -import os -import shutil -from cryptography.hazmat.primitives import serialization -from fnmatch import fnmatch -from functools import partial, reduce -from pathlib import Path -from typing import Dict - -import securesystemslib -import tuf.roledb -from securesystemslib.exceptions import Error as SSLibError -from securesystemslib.interface import import_rsa_privatekey_from_file -from tuf.exceptions import Error as TUFError, RepositoryError -from tuf.repository_tool import ( - METADATA_DIRECTORY_NAME, - TARGETS_DIRECTORY_NAME, - import_rsakey_from_pem, - load_repository, -) -from tuf.roledb import get_roleinfo - -from taf import YubikeyMissingLibrary -from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME -from taf.exceptions import ( - InvalidKeyError, - MetadataUpdateError, - RootMetadataUpdateError, - SigningError, - SnapshotMetadataUpdateError, - TargetsError, - TargetsMetadataUpdateError, - TimestampMetadataUpdateError, - YubikeyError, - InvalidRepositoryError, - KeystoreError, -) -from taf.git import GitRepository -from taf.utils import ( - default_backend, - normalize_file_line_endings, - on_rm_error, - get_file_details, -) - -try: - import taf.yubikey as yk -except ImportError: - yk = YubikeyMissingLibrary() # type: ignore - - -# Default expiration intervals per role -expiration_intervals = {"root": 365, "targets": 90, "snapshot": 7, "timestamp": 1} - -# Loaded keys cache -role_keys_cache: Dict = {} - - -DISABLE_KEYS_CACHING = False -HASH_FUNCTION = "sha256" -MAIN_ROLES = ("root", "targets", "snapshot", "timestamp") - - -def get_role_metadata_path(role: str) -> str: - return f"{METADATA_DIRECTORY_NAME}/{role}.json" - - -def get_target_path(target_name: str) -> str: - return f"{TARGETS_DIRECTORY_NAME}/{target_name}" - - -def is_delegated_role(role: str) -> bool: - return role not in ("root", "targets", "snapshot", "timestamp") - - -def is_auth_repo(repo_path: str) -> bool: - """Check if the given path contains a valid TUF repository""" - try: - Repository(repo_path)._repository - return True - except Exception: - return False - - -def load_role_key(keystore, role, password=None, scheme=DEFAULT_RSA_SIGNATURE_SCHEME): - """Loads the specified role's key from a keystore file. - The keystore file can, but doesn't have to be password protected. - - NOTE: Keys inside keystore should match a role name! - - Args: - - keystore(str): Path to the keystore directory - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - password(str): (Optional) password used for PEM decryption - - scheme(str): A signature scheme used for signing. - - Returns: - - An RSA key object, conformant to 'securesystemslib.RSAKEY_SCHEMA'. - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.CryptoError: If path is not a valid encrypted key file. - """ - if not password: - password = None - key = role_keys_cache.get(role) - if key is None: - try: - if password is not None: - key = import_rsa_privatekey_from_file( - str(Path(keystore, role)), password, scheme=scheme - ) - else: - key = import_rsa_privatekey_from_file( - str(Path(keystore, role)), scheme=scheme - ) - except FileNotFoundError: - raise KeystoreError(f"Cannot find {role} key in {keystore}") - if not DISABLE_KEYS_CACHING: - role_keys_cache[role] = key - return key - - -def root_signature_provider(signature_dict, key_id, _key, _data): - """Root signature provider used to return signatures created remotely. - - Args: - - signature_dict(dict): Dict where key is key_id and value is signature - - key_id(str): Key id from targets metadata file - - _key(securesystemslib.formats.RSAKEY_SCHEMA): Key info - - _data(dict): Data to sign (already signed remotely) - - Returns: - Dictionary that comforms to `securesystemslib.formats.SIGNATURE_SCHEMA` - - Raises: - - KeyError: If signature for key_id is not present in signature_dict - """ - from binascii import hexlify - - return {"keyid": key_id, "sig": hexlify(signature_dict.get(key_id)).decode()} - - -def yubikey_signature_provider(name, key_id, key, data): # pylint: disable=W0613 - """ - A signatures provider which asks the user to insert a yubikey - Useful if several yubikeys need to be used at the same time - """ - from binascii import hexlify - - def _check_key_and_get_pin(expected_key_id): - try: - inserted_key = yk.get_piv_public_key_tuf() - if expected_key_id != inserted_key["keyid"]: - return None - serial_num = yk.get_serial_num() - pin = yk.get_key_pin(serial_num) - if pin is None: - pin = yk.get_and_validate_pin(name) - return pin - except Exception: - return None - - while True: - # check if the needed YubiKey is inserted before asking the user to do so - # this allows us to use this signature provider inside an automated process - # assuming that all YubiKeys needed for signing are inserted - pin = _check_key_and_get_pin(key_id) - if pin is not None: - break - input(f"\nInsert {name} and press enter") - - signature = yk.sign_piv_rsa_pkcs1v15(data, pin) - return {"keyid": key_id, "sig": hexlify(signature).decode()} - - -class Repository: - def __init__(self, path, name="default"): - self.path = Path(path) - self.name = name - - _framework_files = ["repositories.json", "test-auth-repo"] - - @property - def targets_path(self): - return self.path / TARGETS_DIRECTORY_NAME - - @property - def metadata_path(self): - return self.path / METADATA_DIRECTORY_NAME - - _tuf_repository = None - - @property - def _repository(self): - if self._tuf_repository is None: - self._load_tuf_repository(self.path) - return self._tuf_repository - - @property - def repo_id(self): - return GitRepository(path=self.path).initial_commit - - @property - def certs_dir(self): - certs_dir = self.path / "certs" - certs_dir.mkdir(parents=True, exist_ok=True) - return str(certs_dir) - - def _add_delegated_key( - self, role, keyid, pub_key, keytype="rsa", scheme=DEFAULT_RSA_SIGNATURE_SCHEME - ): - """ - Adds public key of a new delegated role to the list of all keys of - delegated roles. - Args: - - role (str): parent target role's name - - keyid (str): keyid of the new signing key - - pub_key(str): public component of the new signing key - - keytype (str): key's type - - sheme (str): signature scheme - """ - roleinfo = tuf.roledb.get_roleinfo(role, self.name) - keysinfo = roleinfo["delegations"]["keys"] - if keyid in keysinfo: - return - key = {"public": pub_key.strip()} - key_metadata_format = securesystemslib.keys.format_keyval_to_metadata( - keytype, scheme, key - ) - keysinfo[keyid] = key_metadata_format - tuf.roledb.update_roleinfo(role, roleinfo, repository_name=self.name) - - def _add_target(self, targets_obj, file_path, custom=None): - """ - - Normalizes line endings (converts all line endings to unix style endings) and - registers the target file as a TUF target - - targets_obj: TUF targets objects (instance of TUF's targets role class) - file_path: full path of the target file - custom: custom target data - """ - file_path = str(Path(file_path).absolute()) - targets_directory_length = len(targets_obj._targets_directory) + 1 - relative_path = file_path[targets_directory_length:].replace("\\", "/") - normalize_file_line_endings(file_path) - - targets_obj.add_target(relative_path, custom) - - def add_metadata_key(self, role, pub_key_pem, scheme=DEFAULT_RSA_SIGNATURE_SCHEME): - """Add metadata key of the provided role. - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - pub_key_pem(str|bytes): Public key in PEM format - - Returns: - None - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this - targets object. - - securesystemslib.exceptions.UnknownKeyError: If 'key_id' is not found in the keydb database. - - """ - if isinstance(pub_key_pem, bytes): - pub_key_pem = pub_key_pem.decode("utf-8") - - if is_delegated_role(role): - parent_role = self.find_delegated_roles_parent(role) - tuf.roledb._roledb_dict[self.name][role]["keyids"] = self.get_role_keys( - role, parent_role - ) - - key = import_rsakey_from_pem(pub_key_pem, scheme) - self._role_obj(role).add_verification_key(key) - - if is_delegated_role(role): - keyids = tuf.roledb.get_roleinfo(role, self.name)["keyids"] - self.set_delegated_role_property("keyids", role, keyids, parent_role) - self._add_delegated_key(parent_role, keyids[-1], pub_key_pem, scheme=scheme) - - def _load_tuf_repository(self, path): - """ - Load tuf repository. Should only be called directly if a different set of metadata files - should be loaded (and not the one located at repo path/metadata) - """ - # before attempting to load tuf repository, create empty targets directory if it does not - # exist to avoid errors raised by tuf - targets_existed = True - if not self.targets_path.is_dir(): - targets_existed = False - self.targets_path.mkdir(parents=True, exist_ok=True) - current_dir = self.metadata_path / "current" - previous_dir = self.metadata_path / "previous" - if current_dir.is_dir(): - shutil.rmtree(current_dir) - if previous_dir.is_dir(): - shutil.rmtree(previous_dir) - try: - self._tuf_repository = load_repository(str(path), self.name) - except RepositoryError: - if not targets_existed: - self.targets_path.rmdir() - raise InvalidRepositoryError(f"{self.name} is not a valid TUF repository!") - - def reload_tuf_repository(self): - """ - Reload tuf repository. Should be called after content on the disk is called. - """ - tuf.roledb.remove_roledb(self.name) - self._load_tuf_repository(self.path) - - def _role_obj(self, role): - """Helper function for getting TUF's role object, given the role's name - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - Returns: - One of metadata objects: - Root, Snapshot, Timestamp, Targets or delegated metadata - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this - targets object. - """ - if role == "targets": - return self._repository.targets - elif role == "snapshot": - return self._repository.snapshot - elif role == "timestamp": - return self._repository.timestamp - elif role == "root": - return self._repository.root - try: - return self._repository.targets(role) - except tuf.exceptions.UnknownRoleError: - return - - def _try_load_metadata_key(self, role, key): - """Check if given key can be used to sign given role and load it. - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - key(securesystemslib.formats.RSAKEY_SCHEMA): Private key used to sign metadata - - Returns: - None - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this - targets object. - - InvalidKeyError: If metadata cannot be signed with given key. - """ - if not self.is_valid_metadata_key(role, key): - raise InvalidKeyError(role) - self._role_obj(role).load_signing_key(key) - - def add_existing_target(self, file_path, targets_role="targets", custom=None): - """Registers new target files with TUF. - The files are expected to be inside the targets directory. - - Args: - - file_path(str): Path to target file - - targets_role(str): Targets or delegated role: a targets role (the root targets role - or one of the delegated ones) - - custom(dict): Custom information for given file - - Returns: - None - - Raises: - - securesystemslib.exceptions.FormatError: If 'filepath' is improperly formatted. - - securesystemslib.exceptions.Error: If 'filepath' is not located in the repository's targets - directory. - """ - targets_obj = self._role_obj(targets_role) - self._add_target(targets_obj, file_path, custom) - - def get_all_roles(self): - """ - Return a list of all defined roles, main roles combined with delegated targets roles - """ - all_target_roles = self.get_all_targets_roles() - all_roles = ["root", "targets", "snapshot", "timestamp"] + all_target_roles - return all_roles - - def get_all_target_files_state(self): - """Create dictionaries of added/modified and removed files by comparing current - file-system state with current signed targets (and delegations) metadata state. - - Args: - - None - Returns: - - Dict of added/modified files and dict of removed target files (inputs for - `modify_targets` method.) - - Raises: - - None - """ - added_target_files = {} - removed_target_files = {} - - # current fs state - fs_target_files = self.all_target_files() - # current signed state - signed_target_files = self.get_signed_target_files() - - # existing files with custom data and (modified) content - for file_name in fs_target_files: - target_file = self.targets_path / file_name - _, hashes = get_file_details(str(target_file)) - # register only new or changed files - if hashes.get(HASH_FUNCTION) != self.get_target_file_hashes(file_name): - added_target_files[file_name] = { - "target": target_file.read_text(), - "custom": self.get_target_file_custom_data(file_name), - } - - # removed files - for file_name in signed_target_files - fs_target_files: - removed_target_files[file_name] = {} - - return added_target_files, removed_target_files - - def get_signed_target_files(self): - """Return all target files signed by all roles. - - Args: - - None - - Returns: - - Set of all target paths relative to targets directory - """ - all_roles = self.get_all_targets_roles() - return self.get_singed_target_files_of_roles(all_roles) - - def get_singed_target_files_of_roles(self, roles): - """Return all target files signed by the specified roles - - Args: - - roles whose target files will be returned - - Returns: - - Set of paths of target files of a role relative to targets directory - """ - if roles is None: - roles = self.get_all_targets_roles() - return set( - reduce( - operator.iconcat, - [self._role_obj(role).target_files for role in roles], - [], - ) - ) - - def get_signed_targets_with_custom_data(self, roles): - """Return all target files signed by the specified roles and and their custom data - as specified in the metadata files - - Args: - - roles whose target files will be returned - - Returns: - - A dictionary whose keys are parts of target files relative to the targets directory - and values are custom data dictionaries. - """ - if roles is None: - roles = self.get_all_targets_roles() - target_files = {} - for role in roles: - roles_targets = self._role_obj(role).target_files - for target_file, custom_data in roles_targets.items(): - target_files.setdefault(target_file, {}).update(custom_data) - return target_files - - def modify_targets(self, added_data=None, removed_data=None): - """Creates a target.json file containing a repository's commit for each repository. - Adds those files to the tuf repository. - - Args: - - added_data(dict): Dictionary of new data whose keys are target paths of repositories - (as specified in targets.json, relative to the targets dictionary). - The values are of form: - { - target: content of the target file - custom: { - custom_field1: custom_value1, - custom_field2: custom_value2 - } - } - - removed_data(dict): Dictionary of the old data whose keys are target paths of - repositories - (as specified in targets.json, relative to the targets dictionary). - The values are not needed. This is just for consistency. - - Content of the target file can be a dictionary, in which case a json file will be created. - If that is not the case, an ordinary textual file will be created. - If content is not specified and the file already exists, it will not be modified. - If it does not exist, an empty file will be created. To replace an existing file with an - empty file, specify empty content (target: '') - - Custom is an optional property which, if present, will be used to specify a TUF target's - - Returns: - - Role name used to update given targets - """ - added_data = {} if added_data is None else added_data - removed_data = {} if removed_data is None else removed_data - data = dict(added_data, **removed_data) - if not data: - raise TargetsError("Nothing to be modified!") - - target_paths = list(data.keys()) - targets_role = self.get_role_from_target_paths(data) - if targets_role is None: - raise TargetsError( - f"Could not find a common role for target paths:\n{'-'.join(target_paths)}" - ) - targets_obj = self._role_obj(targets_role) - # add new target files - for path, target_data in added_data.items(): - target_path = (self.targets_path / path).absolute() - self._create_target_file(target_path, target_data) - custom = target_data.get("custom", None) - self._add_target(targets_obj, str(target_path), custom) - - # remove existing target files - for path in removed_data.keys(): - target_path = (self.targets_path / path).absolute() - if target_path.exists(): - if target_path.is_file(): - target_path.unlink() - elif target_path.is_dir(): - shutil.rmtree(target_path, onerror=on_rm_error) - - try: - targets_obj.remove_target(path) - except Exception: - continue - - return targets_role - - def all_target_files(self): - """ - Return a set of relative paths of all files inside the targets - directory - """ - targets = [] - for root, _, filenames in os.walk(str(self.targets_path)): - for filename in filenames: - filepath = Path(root) / filename - if filepath.is_file(): - targets.append( - str( - Path( - os.path.relpath(str(filepath), str(self.targets_path)) - ).as_posix() - ) - ) - return set(targets) - - def get_target_file_custom_data(self, target_path): - """ - Return a custom data of a given target. - """ - try: - role = self.get_role_from_target_paths([target_path]) - roleinfo = get_roleinfo(role) - return roleinfo["paths"][target_path] - except Exception: - return None - - def get_target_file_hashes(self, target_path, hash_func=HASH_FUNCTION): - """ - Return hashes of a given target path. - """ - hashes = {"sha256": None, "sha512": None} - try: - role = self.get_role_from_target_paths([target_path]) - role_dict = json.loads((self.metadata_path / f"{role}.json").read_text()) - hashes.update(role_dict["signed"]["targets"][target_path]["hashes"]) - except Exception: - pass - - return hashes.get(hash_func, hashes) - - def get_role_from_target_paths(self, target_paths): - """ - Find a common role that can be used to sign given target paths. - - NOTE: Currently each target has only one mapped role. - """ - targets_roles = self.map_signing_roles(target_paths) - roles = list(targets_roles.values()) - - try: - # all target files should have at least one common role - common_role = reduce( - set.intersection, - [set([r]) if isinstance(r, str) else set(r) for r in roles], - ) - except TypeError: - return None - - if not common_role: - return None - - return common_role.pop() - - def check_if_role_exists(self, role_name): - role = self._role_obj(role_name) - return role is not None - - def check_roles_expiration_dates( - self, interval=None, start_date=None, excluded_roles=None - ): - """Determines which metadata roles have expired, or will expire within a time frame. - Args: - - interval(int): Number of days to look ahead for expiration. - - start_date(datetime): Start date to look for expiration. - - excluded_roles(list): List of roles to exclude from the search. - - Returns: - - A dictionary of roles that have expired, or will expire within the given time frame. - Results are sorted by expiration date. - """ - if start_date is None: - start_date = datetime.datetime.now() - if interval is None: - interval = 30 - expiration_threshold = start_date + datetime.timedelta(days=interval) - - if excluded_roles is None: - excluded_roles = [] - - target_roles = self.get_all_targets_roles() - main_roles = ["root", "targets", "snapshot", "timestamp"] - existing_roles = list(set(target_roles + main_roles) - set(excluded_roles)) - - expired_dict = {} - will_expire_dict = {} - for role in existing_roles: - expiry_date = self.get_expiration_date(role) - if start_date > expiry_date: - expired_dict[role] = expiry_date - elif expiration_threshold >= expiry_date: - will_expire_dict[role] = expiry_date - # sort by expiry date - expired_dict = { - k: v for k, v in sorted(expired_dict.items(), key=lambda item: item[1]) - } - will_expire_dict = { - k: v for k, v in sorted(will_expire_dict.items(), key=lambda item: item[1]) - } - - return expired_dict, will_expire_dict - - def _collect_target_paths_of_role(self, target_roles_paths): - all_target_relpaths = [] - for target_role_path in target_roles_paths: - try: - if (self.targets_path / target_role_path).is_file(): - all_target_relpaths.append(target_role_path) - continue - except OSError: - pass - for filepath in self.targets_path.rglob(target_role_path): - if filepath.is_file(): - file_rel_path = str( - Path(filepath).relative_to(self.targets_path).as_posix() - ) - all_target_relpaths.append(file_rel_path) - return all_target_relpaths - - def _create_target_file(self, target_path, target_data): - # if the target's parent directory should not be "targets", create - # its parent directories if they do not exist - target_dir = target_path.parents[0] - target_dir.mkdir(parents=True, exist_ok=True) - - # create the target file - content = target_data.get("target", None) - if content is None: - if not target_path.is_file(): - target_path.touch() - else: - with open(str(target_path), "w") as f: - if isinstance(content, dict): - json.dump(content, f, indent=4) - else: - f.write(content) - - def delete_unregistered_target_files(self, targets_role="targets"): - """ - Delete all target files not specified in targets.json - """ - targets_obj = self._role_obj(targets_role) - target_files_by_roles = self.sort_roles_targets_for_filenames() - if targets_role in target_files_by_roles: - for file_rel_path in target_files_by_roles[targets_role]: - if file_rel_path not in targets_obj.target_files: - (self.targets_path / file_rel_path).unlink() - - def find_delegated_roles_parent(self, role_name): - """ - A simple implementation of finding a delegated targets role's parent - assuming that every delegated role is delegated by just one role - and that there won't be many delegations. - Args: - - role_name: Role - - Returns: - Parent role's name - """ - - def _find_delegated_role(parent_role_name, role_name): - delegations = self.get_delegations_info(parent_role_name) - if len(delegations): - for role_info in delegations.get("roles"): - # check if this role can sign target_path - delegated_role_name = role_info["name"] - if delegated_role_name == role_name: - return parent_role_name - parent = _find_delegated_role(delegated_role_name, role_name) - if parent is not None: - return parent - return None - - return _find_delegated_role("targets", role_name) - - def find_keys_roles(self, public_keys, check_threshold=True): - """Find all roles that can be signed by the provided keys. - A role can be signed by the list of keys if at least the number - of keys that can sign that file is equal to or greater than the role's - threshold - """ - - def _map_keys_to_roles(role_name, key_ids): - keys_roles = [] - delegations = self.get_delegations_info(role_name) - if len(delegations): - for role_info in delegations.get("roles"): - # check if this role can sign target_path - delegated_role_name = role_info["name"] - delegated_roles_keyids = role_info["keyids"] - delegated_roles_threshold = role_info["threshold"] - num_of_signing_keys = len( - set(delegated_roles_keyids).intersection(key_ids) - ) - if ( - not check_threshold - or num_of_signing_keys >= delegated_roles_threshold - ): - keys_roles.append(delegated_role_name) - keys_roles.extend(_map_keys_to_roles(delegated_role_name, key_ids)) - return keys_roles - - keyids = [key["keyid"] for key in public_keys] - return _map_keys_to_roles("targets", keyids) - - def find_associated_roles_of_key(self, public_key): - """ - Find all roles whose metadata files can be signed by this key - Threshold is not important, as long as the key is one of the signing keys - """ - roles = [] - key_id = public_key["keyid"] - for role in MAIN_ROLES: - key_ids = self.get_role_keys(role) - if key_id in key_ids: - roles.append(role) - roles.extend(self.find_keys_roles([public_key], check_threshold=False)) - return roles - - def get_key_length_and_scheme_from_metadata(self, parent_role, keyid): - try: - metadata = json.loads( - Path( - self.path, METADATA_DIRECTORY_NAME, f"{parent_role}.json" - ).read_text() - ) - metadata = metadata["signed"] - if "delegations" in metadata: - metadata = metadata["delegations"] - scheme = metadata["keys"][keyid]["scheme"] - pub_key_pem = metadata["keys"][keyid]["keyval"]["public"] - pub_key = serialization.load_pem_public_key( - pub_key_pem.encode(), backend=default_backend() - ) - return pub_key, scheme - except Exception: - return None, None - - def generate_roles_description(self) -> Dict: - roles_description = {} - - def _get_delegations(role_name): - delegations_info = {} - delegations = self.get_delegations_info(role_name) - if len(delegations): - for role_info in delegations.get("roles"): - delegations_info[role_info["name"]] = { - "threshold": role_info["threshold"], - "number": len(role_info["keyids"]), - "paths": role_info["paths"], - "terminating": role_info["terminating"], - } - pub_key, scheme = self.get_key_length_and_scheme_from_metadata( - role_name, role_info["keyids"][0] - ) - delegations_info[role_info["name"]]["scheme"] = scheme - delegations_info[role_info["name"]]["length"] = pub_key.key_size - inner_roles_data = _get_delegations(role_info["name"]) - if len(inner_roles_data): - delegations_info[role_info["name"]][ - "delegations" - ] = inner_roles_data - return delegations_info - - for role_name in MAIN_ROLES: - role_obj = self._role_obj(role_name) - roles_description[role_name] = { - "threshold": role_obj.threshold, - "number": len(role_obj.keys), - } - pub_key, scheme = self.get_key_length_and_scheme_from_metadata( - "root", role_obj.keys[0] - ) - roles_description[role_name]["scheme"] = scheme - roles_description[role_name]["length"] = pub_key.key_size - if role_name == "targets": - delegations_info = _get_delegations(role_name) - if len(delegations_info): - roles_description[role_name]["delegations"] = delegations_info - return {"roles": roles_description} - - def get_all_targets_roles(self): - """ - Return a list containing names of all target roles - """ - - def _traverse_targets_roles(role_name): - roles = [role_name] - delegations = self.get_delegations_info(role_name) - if len(delegations): - for role_info in delegations.get("roles"): - # check if this role can sign target_path - delegated_role_name = role_info["name"] - roles.extend(_traverse_targets_roles(delegated_role_name)) - return roles - - return _traverse_targets_roles("targets") - - def get_delegated_role_property(self, property_name, role_name, parent_role=None): - """ - Extract value of the specified property of the provided delegated role from - its parent's role info. - Args: - - property_name: Name of the property (like threshold) - - role_name: Role - - parent_role: Parent role - - Returns: - The specified property's value - """ - # TUF raises an error when asking for properties like threshold and signing keys - # of a delegated role (see https://github.com/theupdateframework/tuf/issues/574) - # The following workaround presumes that one every delegated role is a deegation - # of exactly one delegated role - if parent_role is None: - parent_role = self.find_delegated_roles_parent(role_name) - delegations = self.get_delegations_info(parent_role) - for delegated_role in delegations["roles"]: - if delegated_role["name"] == role_name: - return delegated_role[property_name] - return None - - def get_expiration_date(self, role: str) -> datetime.datetime: - return self._role_obj(role).expiration - - def get_role_keys(self, role, parent_role=None): - """Get keyids of the given role - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - parent_role(str): Name of the parent role of the delegated role. If not specified, - it will be set automatically, but this might be slow if there - are many delegations. - - Returns: - List of the role's keyids (i.e., keyids of the keys). - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this - targets object. - """ - role_obj = self._role_obj(role) - if role_obj is None: - return None - try: - return role_obj.keys - except KeyError: - pass - return self.get_delegated_role_property("keyids", role, parent_role) - - def get_role_paths(self, role, parent_role=None): - """Get paths of the given role - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - parent_role(str): Name of the parent role of the delegated role. If not specified, - it will be set automatically, but this might be slow if there - are many delegations. - - Returns: - Defined delegated paths of delegate target role or * in case of targets - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this - """ - if role == "targets": - return "*" - return self.get_delegated_role_property("paths", role, parent_role) - - def get_role_repositories(self, role, parent_role=None): - """Get repositories of the given role - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - parent_role(str): Name of the parent role of the delegated role. If not specified, - it will be set automatically, but this might be slow if there - are many delegations. - - Returns: - Repositories' path from repositories.json that matches given role paths - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this - """ - role_paths = self.get_role_paths(role, parent_role=parent_role) - - target_repositories = self._get_target_repositories() - return [ - repo - for repo in target_repositories - if any([fnmatch(repo, path) for path in role_paths]) - ] - - def get_delegations_info(self, role_name): - # load repository is not already loaded - self._repository - return tuf.roledb.get_roleinfo(role_name, self.name).get("delegations") - - def get_role_threshold(self, role, parent_role=None): - """Get threshold of the given role - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - parent_role(str): Name of the parent role of the delegated role. If not specified, - it will be set automatically, but this might be slow if there - are many delegations. - - Returns: - Role's signatures threshold - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this - """ - role_obj = self._role_obj(role) - if role_obj is None: - return None - try: - return role_obj.threshold - except KeyError: - pass - return self.get_delegated_role_property("threshold", role, parent_role) - - def get_signable_metadata(self, role): - """Return signable portion of newly generate metadata for given role. - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - Returns: - A string representing the 'object' encoded in canonical JSON form or None - - Raises: - None - """ - try: - from tuf.keydb import get_key - - signable = None - - role_obj = self._role_obj(role) - key = get_key(role_obj.keys[0]) - - def _provider(key, data): - nonlocal signable - signable = securesystemslib.formats.encode_canonical(data) - - role_obj.add_external_signature_provider(key, _provider) - self.writeall() - except (IndexError, TUFError, SSLibError): - return signable - - def _get_target_repositories(self): - repositories_path = self.targets_path / "repositories.json" - if repositories_path.exists(): - repositories = repositories_path.read_text() - repositories = json.loads(repositories)["repositories"] - return [str(Path(target_path).as_posix()) for target_path in repositories] - - def is_valid_metadata_key(self, role, key, scheme=DEFAULT_RSA_SIGNATURE_SCHEME): - """Checks if metadata role contains key id of provided key. - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - key(securesystemslib.formats.RSAKEY_SCHEMA): Role's key. - - Returns: - Boolean. True if key id is in metadata role key ids, False otherwise. - - Raises: - - securesystemslib.exceptions.FormatError: If key does not match RSAKEY_SCHEMA - - securesystemslib.exceptions.UnknownRoleError: If role does not exist - """ - - if isinstance(key, str): - key = import_rsakey_from_pem(key, scheme) - - securesystemslib.formats.RSAKEY_SCHEMA.check_match(key) - - return key["keyid"] in self.get_role_keys(role) - - def is_valid_metadata_yubikey(self, role, public_key=None): - """Checks if metadata role contains key id from YubiKey. - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one - - public_key(securesystemslib.formats.RSAKEY_SCHEMA): RSA public key dict - - Returns: - Boolean. True if smart card key id belongs to metadata role key ids - - Raises: - - YubikeyError - - securesystemslib.exceptions.FormatError: If 'PEM' is improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If role does not exist - """ - securesystemslib.formats.NAME_SCHEMA.check_match(role) - - if public_key is None: - public_key = yk.get_piv_public_key_tuf() - - return self.is_valid_metadata_key(role, public_key) - - def map_signing_roles(self, target_filenames): - """ - For each target file, find delegated role responsible for that target file based - on the delegated paths. The most specific role (meaning most deeply nested) whose - delegation path matches the target's path is returned as that file's matching role. - If there are no delegated roles with a path that matches the target file's path, - 'targets' role will be returned as that file's matching role. Delegation path - is expected to be relative to the targets directory. It can be defined as a glob - pattern. - """ - - def _map_targets_to_roles(role_name, target_filenames): - roles_targets = {} - delegations = self.get_delegations_info(role_name) - if len(delegations): - for role_info in delegations.get("roles"): - # check if this role can sign target_path - delegated_role_name = role_info["name"] - for path_pattern in role_info["paths"]: - for target_filename in target_filenames: - if fnmatch( - target_filename.lstrip(os.sep), - path_pattern.lstrip(os.sep), - ): - roles_targets[target_filename] = delegated_role_name - roles_targets.update( - _map_targets_to_roles(delegated_role_name, target_filenames) - ) - return roles_targets - - roles_targets = { - target_filename: "targets" for target_filename in target_filenames - } - roles_targets.update(_map_targets_to_roles("targets", target_filenames)) - return roles_targets - - def remove_metadata_key(self, role, key_id): - """Remove metadata key of the provided role. - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - key_id(str): An object conformant to 'securesystemslib.formats.KEYID_SCHEMA'. - - Returns: - None - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by this - targets object. - - securesystemslib.exceptions.UnknownKeyError: If 'key_id' is not found in the keydb database. - - """ - from tuf.keydb import get_key - - key = get_key(key_id) - self._role_obj(role).remove_verification_key(key) - - def roles_keystore_update_method(self, role_name): - return { - "timestamp": self.update_timestamp_keystores, - "snapshot": self.update_snapshot_keystores, - "targets": self.update_targets_keystores, - }.get(role_name, self.update_targets_keystores) - - def roles_yubikeys_update_method(self, role_name): - return { - "timestamp": self.update_timestamp_yubikeys, - "snapshot": self.update_snapshot_yubikeys, - "targets": self.update_targets_yubikeys, - }.get(role_name, self.update_targets_yubikeys) - - def set_metadata_expiration_date(self, role, start_date=None, interval=None): - """Set expiration date of the provided role. - - Args: - - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) - - start_date(datetime): Date to which the specified interval is added when calculating - expiration date. If a value is not provided, it is set to the - current time. - - interval(int): A number of days added to the start date. - If not provided, the default value is set based on the role: - - root - 365 days - targets - 90 days - snapshot - 7 days - timestamp - 1 day - all other roles (delegations) - same as targets - - Returns: - None - - Raises: - - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. - - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by - this targets object. - """ - role_obj = self._role_obj(role) - if start_date is None: - start_date = datetime.datetime.now() - if interval is None: - try: - interval = expiration_intervals[role] - except KeyError: - interval = expiration_intervals["targets"] - - expiration_date = start_date + datetime.timedelta(interval) - role_obj.expiration = expiration_date - - def set_delegated_role_property(self, property_name, role, value, parent_role=None): - """ - Set property of a delegated role by modifying its parent's "delegations" property - Args: - - property_name: Name of the property (like threshold) - - role_name: Role - - value: New value of the property - - parent_role: Parent role - """ - if parent_role is None: - parent_role = self.find_delegated_roles_parent(role) - - roleinfo = tuf.roledb.get_roleinfo(parent_role, self.name) - delegated_roles_info = roleinfo["delegations"]["roles"] - for delegated_role_info in delegated_roles_info: - if delegated_role_info["name"] == role: - delegated_role_info[property_name] = value - tuf.roledb.update_roleinfo( - parent_role, roleinfo, repository_name=self.name - ) - break - - def sort_roles_targets_for_filenames(self): - rel_paths = [] - for filepath in self.targets_path.rglob("*"): - if filepath.is_file(): - file_rel_path = str( - Path(filepath).relative_to(self.targets_path).as_posix() - ) - rel_paths.append(file_rel_path) - - files_to_roles = self.map_signing_roles(rel_paths) - roles_targets = {} - for target_file, role in files_to_roles.items(): - roles_targets.setdefault(role, []).append(target_file) - return roles_targets - - def update_root(self, signature_dict): - """Update root metadata. - - Args: - - signature_dict(dict): key_id-signature dictionary - - Returns: - None - - Raises: - - InvalidKeyError: If wrong key is used to sign metadata - - SnapshotMetadataUpdateError: If any other error happened during metadata update - """ - from tuf.keydb import get_key - - try: - for key_id in signature_dict: - key = get_key(key_id) - self._repository.root.add_external_signature_provider( - key, partial(root_signature_provider, signature_dict, key_id) - ) - self.writeall() - except (TUFError, SSLibError) as e: - raise RootMetadataUpdateError(str(e)) - - def sign_role_keystores(self, role_name, signing_keys, write=True): - """Load signing keys of the specified role and sign the metadata file - if write is True. Should be used when the keys are not stored on Yubikeys. - Args: - - role_name(str): Name of the role which is to be updated - - signing_keys(list[securesystemslib.formats.RSAKEY_SCHEMA]): A list of signing keys - - write(bool): If True timestmap metadata will be signed and written - - Returns: - None - - Raises: - - InvalidKeyError: If at least one of the provided keys cannot be used to sign the - role's metadata - - SigningError: If the number of signing keys is insufficient - """ - threshold = self.get_role_threshold(role_name) - if len(signing_keys) < threshold: - raise SigningError( - role_name, - f"Insufficient number of signing keys. Signing threshold is {threshold}.", - ) - for key in signing_keys: - self._try_load_metadata_key(role_name, key) - if write: - self._repository.write(role_name) - - def sign_role_yubikeys( - self, - role_name, - public_keys, - signature_provider=yubikey_signature_provider, - write=True, - pins=None, - ): - """Register signature providers of the specified role and sign the metadata file - if write is True. - - Args: - - role_name(str): Name of the role which is to be updated - - public_keys(list[securesystemslib.formats.RSAKEY_SCHEMA]): A list of public keys - - signature_provider: Signature provider used for signing - - write(bool): If True timestmap metadata will be signed and written - - pins(dict): A dictionary mapping serial numbers of Yubikeys to their pins. If not - provided, pins will either be loaded from the global pins dictionary - (if it was previously populated) or the user will have to manually enter - it. - Returns: - None - - Raises: - - InvalidKeyError: If at least one of the provided keys cannot be used to sign the - role's metadata - - SigningError: If the number of signing keys is insufficient - """ - role_obj = self._role_obj(role_name) - threshold = self.get_role_threshold(role_name) - if len(public_keys) < threshold: - raise SigningError( - role_name, - f"Insufficient number of signing keys. Signing threshold is {threshold}.", - ) - - if pins is not None: - for serial_num, pin in pins.items(): - yk.add_key_pin(serial_num, pin) - - for index, public_key in enumerate(public_keys): - if public_key is None: - public_key = yk.get_piv_public_key_tuf() - - if not self.is_valid_metadata_yubikey(role_name, public_key): - raise InvalidKeyError(role_name) - - if len(public_keys) == 1: - key_name = role_name - else: - key_name = f"{role_name}{index + 1}" - - role_obj.add_external_signature_provider( - public_key, partial(signature_provider, key_name, public_key["keyid"]) - ) - - if write: - self._repository.write(role_name) - - def roles_targets_for_filenames(self, target_filenames): - """Sort target files by roles - Args: - - target_filenames: List of relative paths of target files - Returns: - - A dictionary mapping roles to a list of target files belonging - to the provided target_filenames list delegated to the role - """ - targets_roles_mapping = self.map_signing_roles(target_filenames) - roles_targets_mapping = {} - for target_filename, role_name in targets_roles_mapping.items(): - roles_targets_mapping.setdefault(role_name, []).append(target_filename) - return roles_targets_mapping - - def unmark_dirty_role(self, role): - """ - Unmakes one dirty role. This means that the corresponding metadata file - will not be updated. - Args: - - role which should be unmaked - """ - self.unmark_dirty_roles([role]) - - def unmark_dirty_roles(self, roles): - """ - Unmakes dirty roles. This means that the corresponding metadata files - will not be updated. - Args: - - roles which should be unmaked - """ - self._repository.unmark_dirty(roles) - - def update_role_keystores( - self, role_name, signing_keys, start_date=None, interval=None, write=True - ): - """Update the specified role's metadata's expiration date by setting it to a date calculated by - adding the specified interval to start date. Load the signing keys and sign the file if - write is set to True. - Should be used when the keys are not stored on Yubikeys. - - Args: - - role_name: Name of the role whose metadata is to be updated - - signing_keys: list of signing keys of the specified role - - start_date(datetime): Date to which the specified interval is added when - calculating expiration date. If no value is provided, - it is set to the current time - - interval(int): Number of days added to the start date. If not provided, - the default expiration interval of the specified role is used - - write(bool): If True metadata will be signed and written - - Returns: - None - - Raises: - - InvalidKeyError: If a wrong key is used to sign metadata - - MetadataUpdateError: If any other error happened while updating and signing - the metadata file - """ - try: - self.set_metadata_expiration_date(role_name, start_date, interval) - self.sign_role_keystores(role_name, signing_keys, write) - except (YubikeyError, TUFError, SSLibError, SigningError) as e: - raise MetadataUpdateError(role_name, str(e)) - - def update_role_yubikeys( - self, - role_name, - public_keys, - start_date=None, - interval=None, - write=True, - signature_provider=yubikey_signature_provider, - pins=None, - ): - """Update the specified role's metadata expiration date by setting it to a date calculated by - adding the specified interval to start date. Register Yubikey signature providers and - sign the metadata file if write is set to True. - - Args: - - role_name: Name of the role whose metadata is to be updated - - public_keys: list of public keys of the specified role - - start_date(datetime): Date to which the specified interval is added when - calculating expiration date. If no value is provided, - it is set to the current time - - interval(int): Number of days added to the start date. If not provided, - the default expiration interval of the specified role is used - - write(bool): If True timestamp metadata will be signed and written - - signature_provider: Signature provider used for signing - - pins(dict): A dictionary mapping serial numbers of Yubikeys to their pins. If not - provided, pins will either be loaded from the global pins dictionary - (if it was previously populated) or the user will have to manually enter - it. - Returns: - None - - Raises: - - InvalidKeyError: If a wrong key is used to sign metadata - - MetadataUpdateError: If any other error happened while updating and signing - the metadata file - """ - try: - self.set_metadata_expiration_date(role_name, start_date, interval) - self.sign_role_yubikeys( - role_name, - public_keys, - signature_provider=signature_provider, - write=write, - pins=pins, - ) - except (YubikeyError, TUFError, SSLibError, SigningError) as e: - raise MetadataUpdateError(role_name, str(e)) - - def update_timestamp_keystores( - self, timestamp_signing_keys, start_date=None, interval=None, write=True - ): - """Update timestamp metadata's expiration date by setting it to a date calculated by - adding the specified interval to start date. Load the signing keys and sign the file if - write is set to True. - Should be used when the keys are not stored on Yubikeys. - - Args: - - timestamp_signing_keys: list of signing keys of the timestamp role - - start_date(datetime): Date to which the specified interval is added when - calculating expiration date. If no value is provided, - it is set to the current time - - interval(int): Number of days added to the start date. If not provided, - the default timestamp expiration interval is used (1 day) - - write(bool): If True timestamp metadata will be signed and written - - Returns: - None - - Raises: - - InvalidKeyError: If a wrong key is used to sign metadata - - TimestampMetadataUpdateError: If any other error happened while updating and signing - the metadata file - """ - try: - self.update_role_keystores( - "timestamp", timestamp_signing_keys, start_date, interval, write - ) - except MetadataUpdateError as e: - raise TimestampMetadataUpdateError(str(e)) - - def update_timestamp_yubikeys( - self, - timestamp_public_keys, - start_date=None, - interval=None, - write=True, - pins=None, - ): - """Update timestamp metadata's expiration date by setting it to a date calculated by - adding the specified interval to start date. Register Yubikey signature providers and - sign the metadata file if write is set to True. - - Args: - - timestamp_public_keys: list of public keys of the timestamp role - - start_date(datetime): Date to which the specified interval is added when - calculating expiration date. If no value is provided, - it is set to the current time - - interval(int): Number of days added to the start date. If not provided, - the default timestamp expiration interval is used (1 day) - - write(bool): If True timestamp metadata will be signed and written - - pins(dict): A dictionary mapping serial numbers of Yubikeys to their pins. If not - provided, pins will either be loaded from the global pins dictionary - (if it was previously populated) or the user will have to manually enter - it. - - Returns: - None - - Raises: - - InvalidKeyError: If a wrong key is used to sign metadata - - TimestampMetadataUpdateError: If any other error happened while updating and signing - the metadata file - """ - try: - self.update_role_yubikeys( - "timestamp", - timestamp_public_keys, - start_date, - interval, - write=write, - pins=pins, - ) - except MetadataUpdateError as e: - raise TimestampMetadataUpdateError(str(e)) - - def update_snapshot_keystores( - self, snapshot_signing_keys, start_date=None, interval=None, write=True - ): - """Update snapshot metadata's expiration date by setting it to a date calculated by - adding the specified interval to start date. Load the signing keys and sign the file if - write is set to True. - Should be used when the keys are not stored on Yubikeys. - - Args: - - snapshot_signing_keys: list of signing keys of the snapshot role - - start_date(datetime): Date to which the specified interval is added when - calculating expiration date. If no value is provided, - it is set to the current time - - interval(int): Number of days added to the start date. If not provided, - the default snapshot expiration interval is used (7 days) - - write(bool): If True snapshot metadata will be signed and written - - Returns: - None - - Raises: - - InvalidKeyError: If a wrong key is used to sign metadata - - SnapshotMetadataUpdateError: If any other error happened while updating and signing - the metadata file - """ - try: - self.update_role_keystores( - "snapshot", snapshot_signing_keys, start_date, interval, write - ) - except MetadataUpdateError as e: - raise SnapshotMetadataUpdateError(str(e)) - - def update_snapshot_yubikeys( - self, - snapshot_public_keys, - start_date=None, - interval=None, - write=True, - pins=None, - ): - """Update snapshot metadata's expiration date by setting it to a date calculated by - adding the specified interval to start date. Register Yubikey signature providers and - sign the metadata file if write is set to True - - Args: - - snapshot_public_keys: list of public keys of the snapshot role - - start_date(datetime): Date to which the specified interval is added when - calculating expiration date. If no value is provided, - it is set to the current time - - interval(int): Number of days added to the start date. If not provided, - the default snapshot expiration interval is used (7 days) - - write(bool): If True snapshot metadata will be signed and written - - pins(dict): A dictionary mapping serial numbers of Yubikeys to their pins. If not - provided, pins will either be loaded from the global pins dictionary - (if it was previously populated) or the user will have to manually enter - it. - - Returns: - None - - Raises: - - InvalidKeyError: If a wrong key is used to sign metadata - - SnapshotMetadataUpdateError: If any other error happened while updating and signing - the metadata file - """ - try: - self.update_role_yubikeys( - "snapshot", - snapshot_public_keys, - start_date, - interval, - write=write, - pins=pins, - ) - except MetadataUpdateError as e: - raise SnapshotMetadataUpdateError(str(e)) - - def update_targets_keystores( - self, - targets_signing_keys, - added_targets_data=None, - removed_targets_data=None, - start_date=None, - interval=None, - write=True, - ): - """Update a targets role's metadata. The role can be either be main targets role or a delegated - one. If targets_data is specified, updates metadata corresponding to target files contained - if that dictionary. Set the new expiration date by to a value calculated by adding the - specified interval to start date. Load the signing keys and sign the file if write is set to True. - Should be used when the keys are not stored on Yubikeys. - - Args: - - targets_signing_keys: list of signing keys of the targets role - - start_date(datetime): Date to which the specified interval is added when - calculating expiration date. If no value is provided, - it is set to the current time - - added_targets_data(dict): Dictionary containing targets data that should be added - - removed_targets_data(dict): Dictionary containing targets data that should be removed - - interval(int): Number of days added to the start date. If not provided, - the default targets expiration interval is used (90 days) - - write(bool): If True targets metadata will be signed and written - - Returns: - None - - Raises: - - TargetsMetadataUpdateError: If any other error happened while updating and signing - the metadata file - """ - try: - targets_role = self.modify_targets(added_targets_data, removed_targets_data) - self.update_role_keystores( - targets_role, targets_signing_keys, start_date, interval, write - ) - except Exception as e: - raise TargetsMetadataUpdateError(str(e)) - - def update_targets_yubikeys( - self, - targets_public_keys, - added_targets_data=None, - removed_targets_data=None, - start_date=None, - interval=None, - write=True, - pins=None, - ): - """Update a targets role's metadata. The role can be either be main targets role or a delegated - one. If targets_data is specified, updates metadata corresponding to target files contained - if that dictionary. Set the new expiration date by to a value calculated by adding the - specified interval to start date. Register Yubikey signature providers and - sign the metadata file if write is set to True. - - Args: - - targets_public_keys: list of signing keys of the targets role - - start_date(datetime): Date to which the specified interval is added when - calculating expiration date. If no value is provided, - it is set to the current time - - added_targets_data(dict): Dictionary containing targets data that should be added - - removed_targets_data(dict): Dictionary containing targets data that should be removed - - interval(int): Number of days added to the start date. If not provided, - the default targets expiration interval is used (90 days in case of - "targets", 1 in case of delegated roles) - - write(bool): If True targets metadata will be signed and written - - pins(dict): A dictionary mapping serial numbers of Yubikeys to their pins. If not - provided, pins will either be loaded from the global pins dictionary - (if it was previously populated) or the user will have to manually enter - it. - Returns: - None - - Raises: - - TargetsMetadataUpdateError: If error happened while updating and signing - the metadata file - """ - try: - targets_role = self.modify_targets(added_targets_data, removed_targets_data) - self.update_role_yubikeys( - targets_role, - targets_public_keys, - start_date, - interval, - write=write, - pins=pins, - ) - except Exception as e: - raise TargetsMetadataUpdateError(str(e)) - - def writeall(self): - """Write all dirty metadata files. - - Args: - None - - Returns: - None - - Raises: - - tuf.exceptions.UnsignedMetadataError: If any of the top-level and delegated roles do not - have the minimum threshold of signatures. - """ - self._repository.writeall() - - -def _tuf_patches(): - from functools import wraps - import tuf.repository_lib - import tuf.repository_tool - - from taf.utils import normalize_file_line_endings - - # Replace staging metadata directory name - tuf.repository_tool.METADATA_STAGED_DIRECTORY_NAME = ( - tuf.repository_tool.METADATA_DIRECTORY_NAME - ) - - # Replace get_metadata_fileinfo with file-endings normalization - def get_targets_metadata_fileinfo(get_targets_metadata_fileinfo_fn): - @wraps(get_targets_metadata_fileinfo_fn) - def normalized(filename, storage_backend, custom=None): - normalize_file_line_endings(filename) - return get_targets_metadata_fileinfo_fn( - filename, storage_backend, custom=None - ) - - return normalized - - tuf.repository_lib.get_targets_metadata_fileinfo = get_targets_metadata_fileinfo( - tuf.repository_lib.get_targets_metadata_fileinfo - ) - - -_tuf_patches() diff --git a/taf/tests/conftest.py b/taf/tests/conftest.py index 9dc1bc1ca..3b3cc7bb9 100644 --- a/taf/tests/conftest.py +++ b/taf/tests/conftest.py @@ -1,11 +1,12 @@ -import os +import pytest +import json +import re import shutil -from contextlib import contextmanager from pathlib import Path +from taf.tuf.keys import load_signer_from_file -from pytest import fixture -from taf.tests import TEST_WITH_REAL_YK +# from taf.tests import TEST_WITH_REAL_YK from taf.utils import on_rm_error TEST_DATA_PATH = Path(__file__).parent / "data" @@ -19,54 +20,118 @@ CLIENT_DIR_PATH = TEST_DATA_REPOS_PATH / "client" HANDLERS_DATA_INPUT_DIR = TEST_DATA_PATH / "handler_inputs" TEST_INIT_DATA_PATH = Path(__file__).parent / "init_data" +REPOSITORY_DESCRIPTION_INPUT_DIR = TEST_DATA_PATH / "repository_description_inputs" +NO_YUBIKEYS_INPUT = REPOSITORY_DESCRIPTION_INPUT_DIR / "no_yubikeys.json" +WITH_DELEGATIONS_NO_YUBIKEY = ( + REPOSITORY_DESCRIPTION_INPUT_DIR / "with_delegations_no_yubikeys.json" +) +REPOSITORIES_JSON_PATH = TEST_INIT_DATA_PATH / "repositories.json" +MIRRORS_JSON_PATH = TEST_INIT_DATA_PATH / "mirrors.json" + + +@pytest.fixture(scope="session", autouse=True) +def repo_dir(): + path = CLIENT_DIR_PATH + if path.is_dir(): + shutil.rmtree(path, onerror=on_rm_error) + path.mkdir(parents=True) + yield path + shutil.rmtree(path, onerror=on_rm_error) + + +@pytest.fixture(scope="session") +def keystore(): + """Create signer from some rsa test key.""" + return TEST_DATA_PATH / "keystores" / "keystore" + + +@pytest.fixture(scope="session") +def keystore_delegations(): + """Create signer from some rsa test key.""" + return TEST_DATA_PATH / "keystores" / "keystore_delegations" + + +@pytest.fixture(scope="session") +def mirrors_json_path(): + return MIRRORS_JSON_PATH + + +@pytest.fixture(scope="session") +def no_yubikeys_input(): + return json.loads(NO_YUBIKEYS_INPUT.read_text()) + + +@pytest.fixture(scope="session") +def with_delegations_no_yubikeys_input(): + return json.loads(WITH_DELEGATIONS_NO_YUBIKEY.read_text()) + + +@pytest.fixture(scope="session") +def with_delegations_no_yubikeys_path(): + return WITH_DELEGATIONS_NO_YUBIKEY + + +@pytest.fixture(scope="session") +def signers(keystore): + return _load_signers_from_keystore(keystore) + + +@pytest.fixture(scope="session") +def signers_with_delegations(keystore_delegations): + return _load_signers_from_keystore(keystore_delegations) + + +@pytest.fixture(scope="session") +def public_keys(signers): + return { + role_name: [signer.public_key for signer in signers] + for role_name, signers in signers.items() + } -def pytest_generate_tests(metafunc): - if "repositories" in metafunc.fixturenames: - # When running tests with real yubikey, use just rsa-pkcs1v15-sha256 scheme - schemes = ( - ["rsa-pkcs1v15-sha256"] - if TEST_WITH_REAL_YK - else ["rsassa-pss-sha256", "rsa-pkcs1v15-sha256"] - ) - metafunc.parametrize("repositories", schemes, indirect=True) - - -@contextmanager -def origin_repos_group(test_group_dir, scheme_suffix=None): - all_paths = {} - test_group_dir = str(TEST_DATA_REPOS_PATH / test_group_dir) - for test_dir in os.scandir(test_group_dir): - if test_dir.is_dir(): - if ( - scheme_suffix is not None and test_dir.name.endswith(scheme_suffix) - ) or scheme_suffix is None: - all_paths[test_dir.name] = _copy_repos(test_dir.path, test_dir.name) - - yield all_paths - - for test_name in all_paths: - test_dst_path = str(TEST_DATA_ORIGIN_PATH / test_name) - shutil.rmtree(test_dst_path, onerror=on_rm_error) - - -def _copy_repos(test_dir_path, test_name): - paths = {} - for root, dirs, _ in os.walk(test_dir_path): - for dir_name in dirs: - if dir_name == "git": - repo_rel_path = Path(root).relative_to(test_dir_path) - dst_path = TEST_DATA_ORIGIN_PATH / test_name / repo_rel_path - # convert dst_path to string in order to support python 3.5 - shutil.rmtree(dst_path, ignore_errors=True) - shutil.copytree(root, str(dst_path)) - (dst_path / "git").rename(dst_path / ".git") - repo_rel_path = Path(repo_rel_path).as_posix() - paths[repo_rel_path] = str(dst_path) - return paths - - -@fixture(scope="session", autouse=True) +@pytest.fixture(scope="session") +def public_keys_with_delegations(signers_with_delegations): + return { + role_name: [signer.public_key for signer in signers] + for role_name, signers in signers_with_delegations.items() + } + + +def _load_signers_from_keystore(keystore): + def normalize_base_name(name): + return re.sub(r"\d+$", "", name) + + signers = {} + + for file in keystore.iterdir(): + if file.is_file() and file.suffix == "": + normalized_base_name = normalize_base_name(file.stem) + + if normalized_base_name not in signers: + signers[normalized_base_name] = [] + signers[normalized_base_name].append(load_signer_from_file(file)) + return signers + + +@pytest.fixture(scope="session") +def repositories_json_template(): + return json.loads(Path(REPOSITORIES_JSON_PATH).read_text()) + + +@pytest.fixture(autouse=True) +def repo_path(request, repo_dir): + # Get the base directory path + + # Append the test name + test_name = request.node.name + full_path = repo_dir / test_name + full_path.mkdir(parents=True) + + yield full_path + shutil.rmtree(full_path, onerror=on_rm_error) + + +@pytest.fixture(scope="session", autouse=True) def output_path(): shutil.rmtree(TEST_OUTPUT_PATH, ignore_errors=True) TEST_OUTPUT_PATH.mkdir() @@ -74,23 +139,17 @@ def output_path(): shutil.rmtree(TEST_OUTPUT_PATH, onerror=on_rm_error) -@fixture +@pytest.fixture(scope="session") def client_dir(): return CLIENT_DIR_PATH -@fixture +@pytest.fixture(scope="session") def origin_dir(): return TEST_DATA_ORIGIN_PATH -@fixture -def keystore(): - """Keystore path.""" - return str(KEYSTORE_PATH) - - -@fixture +@pytest.fixture(scope="session") def wrong_keystore(): """Path of the wrong keystore""" return str(WRONG_KEYSTORE_PATH) diff --git a/taf/tests/data/keystores/keystore/root1 b/taf/tests/data/keystores/keystore/root1 index b7afb0c0a..f3f912a09 100644 --- a/taf/tests/data/keystores/keystore/root1 +++ b/taf/tests/data/keystores/keystore/root1 @@ -1,27 +1,39 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpgIBAAKCAQEA5EGVh9xqVFFHnGGIofkscA3vHWFs1QP60QTX+ZJUPiUJdDb8 -wuJ6mu9d8bKojE3SEVHCLpJeV4+muMnLtZWqAipiuFUU9QDpOYaqQ5SD5n/9sZfi -WDzjVsqZA4WMj0OCd/Bkn+umz3ljHFe0EJUECxYRvmArC05UyJej7fCaQ/cD7QEL -rpmBaE2qLcG0Vfirz9NekaXixGiKNiIjHAj6YwIfES9SycVo42LEOskGFciqgfZJ -VtSaTIurW+KnOToStazEWY8okon91s+5ltINOS68TtBLtph5PXcLhqSozE8SqMW3 -gZni6zXHHQtuouFLdGkgw+0V2YLX15Ka78zjhQIDAQABAoIBAQCUKvaUAMKNBU4E -91MoQYVVH9ZuLgXlqPWxpQFFonVI+eXPKLqfD0EjPeqvsJe0q/eHApmYfa78C+Xf -4i54KzT2vujiW2iFOhgrHX187PVKNR9LnxpwyOWSO2VkYdbCUMJqdQP8w42+9D8f -8NaURQcg4yyVdfu7FRf4NmdVV2/sWTy8vHOrsdG+K4a3GxgT41Hnf7QijfzJOckM -klaeur1gTXSjNUaHMrB1lccvtiMsusxDx+hExIt8iieRnjS24fdiqEIZ8Roz/RAF -hYCUpN2DNsZSZH3xN8SzFnfbguwc6PvduKmZXAxD4kiolyNnXLvYuvEZ/RMKIXqb -D/h1fbhpAoGBAPPYqasJoXvq0Kr3p18JM5a0Lc95LwK7mUZVNI6fQBRMxJed8tDo -NuaPnl3/luLBxp7nHInS/3SmnsG6KJiTvt1ygcQRVC48YAm/bX4K4OaeezrvqqVw -3ro0Kpqa78o86W+1TDPi9RKx+fpamWAovPbNpi/1y9ueMCUlU2XiUv9nAoGBAO+i -AAYaXOdRbpLOipolq9V8NQtefwn4O9hCDjZUdXJBEYjwQhffW+Qoz++5Wj7xkpHU -YKyONsyCWgXU3ZVA0Kf3PYGx8KXX2OJxvAzo1S4dH+KDMxQnuUDXq6tvkjXaKjbY -01xZTJ83f0ovTgkL1ruRPOTcV57HPaHOxEuDdK4zAoGBAMkuOl2IppiMFPjZNlds -SgnOQfVor+Z7TGwApEn/DWkyJQhKIilFTPZQC4LV+nC/GtXDK4JyeJyPU2/V3OR1 -EQW3EWToPyGeYkXoj7dr1j2vB1CKp6mzQ68wlu3TYn7iXl3xoBs25qcz+2AYG26A -bdbZuIDdNAHPsz0SXIo0ffGFAoGBAJfFnwY+hEDtzn6k2hwvZ9naxS3iN8v0sNKT -Y7T9YTVwCM8WfIXqLaUgRDKszn+3OQGr5V7k48g7dxDidUUmvADmEsqmDKi9QNyK -9HOos/x07dDlD+DgF/D9p/j4vT3mY35Bbfy7glAFMlWmCGKqYOKDZnH9LHGf92UY -NDMvmyMJAoGBAPGYc/JOXAjh9ZHWUBxMZbBG1lwA6jGGxh78qaRn/7fA4ht/GEZP -XT5hV6FhhT1zm6N4dH/Tdo1enxlYHlHPFTZA/IBD3Ut6zR3mRft2Sca6V1iR8HE5 -yDempKdPGkGPt2KSGuj1gUmuc5frVwgv9M2uRf+qs7YyC3H/JI+BDtfm +MIIG4wIBAAKCAYEAwnsabFAhR4VSc+5r+lZbKPlcO/gUmae1EzY5b/oLI4HlFCdK +WSjr/963baN/kTKMVCaNBNjhIpkz6qp03pJCPRQ5gECB1WoYHxNhpTec67IOpSnC +6q5wR9FcxjlydRlbk84sMmnRqHrpBsVj6d6Ux+HiGF64HQI3hybGWsyYKs9TC+Ma +VJM9tYoItHua0OretgwXkIdV9Zdn+7S4NVYGU67wJvGeiRQ1IKttYC0+djzUcVlZ +GkmPNzMIpzctcB/J5oBPRDVMoxWV7rxQqx1voS5xY7iM2XcnqH0Jwrt0r+zA0BTv +LEZzhvtCw2aj2GUYHd7L5bmZcCwY9t2vGKgVenRmQ3JnjGBBcbMc7M2heP0NUk5T +MSD+knA5lNHuufb2oN+i/fOvWhFA+kTOg3jj3I3MgwpoXTsYtKHerbe9KNxTL9qu +PPdjwGjtaJuEnrxxkvz1ZxDJbemBuYjBqasYbLWfHn+XWmpzPd1qKLwawCpvV2bg +NhRqAV7GbASCCBtVAgMBAAECggGAG5vdzawXeV+KK8aYYh7RzLCPwTyv8ftOt7Y+ +M7EX1TfaxUBpq9wlGrsrp58rHDoElWquoNZIKcD9j44YzsMNL74YBqbBt8IawAig +l1OcjZJGxXg3AVl3u55TcRmVL94Ec+h0Okju+F/QhoNNspUEYpbk4chKk2Wt69wb +kybR4Fvz4m9gXMrVWxkIMNUOTqPVL5tqWfx4fce7fY5zizDV75nZYnHxK20ouKVV +fu6VXDQ5BYllXpe8Qt4WF6T76Ju+bq/kbb99dFVcKOEQMCtPzhHGKfEuZGoFKjCJ ++rqlld/GeBG8tdpq84qLM8i+/hoJghkIBbcPRNdDW6w2eIoEEeL9bqaB9toqA0mA +yFl9m0+lYYsH330gF6GclrVgKBxLAgwVRsK0oQ3DkYLUoBZzB3AOrHrmJ2WkpLnn +Lit6zjELSm2nHmRjXOnBqx0pP2MSKKaeWzwvTczPOzZ9l/oEE/iwjhKFd4nV2FoX +O89ukSG3dJGkuWwXUpMGWmDcSP1BAoHBANPF67OslgfjcVOhRyGBDE81+/iKb7Sa +57GLVXkPRd7oKlFzDDy/HfqPE3IGt6nfynwxtBQqhR0KEgTSiVzP43hXDv3P9XAK +MlLSQ8+izKXWKPODNUn+TuJ3xPvye/wMIVbnYWJUMEimur8ITlbZ6uAtEZMVe8xQ +/2mt8E7CAGYlHwUdwvmEnkBs2FqjJLN5kcDpcw5hdsUav+JagcNq932UmA4Cgh+O +5iOGhC+R9DbP4GnAkuWqBke3BJsvADXslQKBwQDrGK6tx1ct8VKnYqGot61uLAta +ZlcMX6uC3PrvHx1SnwD/sIKigijieLKkRjjb0Hdq3RWKsJLMAkZ7L+lSo2V8cPdj +rvZXdsy4MF+pzoYilwU/Fz3Vm6S434boMCYamUetLOfc0nqxWQHWp7gU7Ybm0R2K +A//Bzwduh4yM4R1s/MqsE9VMOcW7f4CVPFJkxqOmt6sL2k7wNT7ptpwCaO7c0trB +vH+1HZ6qpBBifZMsisU8k3BRvAr0aZ8e+tdvA8ECgcEAhgA91bJGOPWdFvr9JGEg +5dpV9v26E0DVjM2KpxCX+KVVabZvrtyL3qi7+DHx82atHIri1MPW+PoPTsfdrUHK +QLJtxQLa3itFjoyH5hGwhtsNjJCgnpJxXfHFTlswQtt2GSRNxcdZyg7eKdTapTA8 +498AuN4mOLGj/D3Yyi0NzZR9nWIopnRZIpD9EdUbewlYxgWyDQ509eGoO1VjuMCt +m+PzlyHVLpzgWOhcKjGjoy9EZAY7rWE5mhVfr8Y8zuJFAoHAVQZKNoM/nlgGwo7D +VJeJW60GNh2JIep/xwZQoqaoHjdvTwnxVQCp9K4ePZc//Q+6AKYQomYV0T6Jawf6 +5G4/x++7KQwf/6XxiDPGhU0x6dSgix7GuDhgLJR64AJ55WjGKXVyLcTZpsZACfgC +dV8qSNQcUMv9dYSAdZMEW/cWg1IxomZR4A2M27DTOiXkzpmgmi0W6WR85Bb9t9zZ +M23r5WVExIh9z2z081X+rwAneBaAGtZf6s+NTrPcXoHt5DKBAoHAShLxLWwxdI9y +pk8FsJAkQk5cjQIjEPB0MdtuoaQSevIbg7bAlfMzurCTr1063UetNdOnvja9uQEM +O+6Atg+0dSC8pyGn8azrZk04wbZiZLu6PXT5IEiZ5pRXMfW4XNfw4Shu0M3MopRT +6rXlqbQ651UFMLRf/xmXUEkL3j79wrVHLazcywJr5LnW17JLBnBDsTGhy9nuA9NA +0c/1JWuubGkAg2Ojs+srNpL1iLqCqi6v1is/F6hHs7fq9l3V3Iaw -----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/root1.pub b/taf/tests/data/keystores/keystore/root1.pub index 0648022df..38ff5292e 100644 --- a/taf/tests/data/keystores/keystore/root1.pub +++ b/taf/tests/data/keystores/keystore/root1.pub @@ -1,9 +1,11 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5EGVh9xqVFFHnGGIofks -cA3vHWFs1QP60QTX+ZJUPiUJdDb8wuJ6mu9d8bKojE3SEVHCLpJeV4+muMnLtZWq -AipiuFUU9QDpOYaqQ5SD5n/9sZfiWDzjVsqZA4WMj0OCd/Bkn+umz3ljHFe0EJUE -CxYRvmArC05UyJej7fCaQ/cD7QELrpmBaE2qLcG0Vfirz9NekaXixGiKNiIjHAj6 -YwIfES9SycVo42LEOskGFciqgfZJVtSaTIurW+KnOToStazEWY8okon91s+5ltIN -OS68TtBLtph5PXcLhqSozE8SqMW3gZni6zXHHQtuouFLdGkgw+0V2YLX15Ka78zj -hQIDAQAB +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwnsabFAhR4VSc+5r+lZb +KPlcO/gUmae1EzY5b/oLI4HlFCdKWSjr/963baN/kTKMVCaNBNjhIpkz6qp03pJC +PRQ5gECB1WoYHxNhpTec67IOpSnC6q5wR9FcxjlydRlbk84sMmnRqHrpBsVj6d6U +x+HiGF64HQI3hybGWsyYKs9TC+MaVJM9tYoItHua0OretgwXkIdV9Zdn+7S4NVYG +U67wJvGeiRQ1IKttYC0+djzUcVlZGkmPNzMIpzctcB/J5oBPRDVMoxWV7rxQqx1v +oS5xY7iM2XcnqH0Jwrt0r+zA0BTvLEZzhvtCw2aj2GUYHd7L5bmZcCwY9t2vGKgV +enRmQ3JnjGBBcbMc7M2heP0NUk5TMSD+knA5lNHuufb2oN+i/fOvWhFA+kTOg3jj +3I3MgwpoXTsYtKHerbe9KNxTL9quPPdjwGjtaJuEnrxxkvz1ZxDJbemBuYjBqasY +bLWfHn+XWmpzPd1qKLwawCpvV2bgNhRqAV7GbASCCBtVAgMBAAE= -----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/root2 b/taf/tests/data/keystores/keystore/root2 index 04a62b43a..2ac70fb26 100644 --- a/taf/tests/data/keystores/keystore/root2 +++ b/taf/tests/data/keystores/keystore/root2 @@ -1,27 +1,39 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEA552O9PX6L8snG/nZdZAeuFgIUk8uJihwCJi8Wk2n2kb4+80m -MfOItJHcngpcyuPyoUKUAEj5XkK5b+nbGA67Xa9BcCEGzw1dS0RSkJsL2iStgepr -Jxmnb0tOYkgjFB3p0agvyVvOCfNWkg4BxnX9JqiGRVJkTugkzExZRqop7miJsj1m -6YEpbSmfRdWjTz1AuSsVCsXjkS9b1BIgQBZsj8x1o98pozmSBsmnc9TsruSUNQX6 -7ZCNFNAhPGKksqQA9L7WAYSN5CP39T7yJE1UCByB/qFwGuxrqofmzpsbDg70aGP/ -UK+0uaqI5Pfwq+rtxCyNr/gOO6UsXATcDxGDZQIDAQABAoIBAC+oVtsGpgUhixmR -jnJHRlruGkA9dKR7W5oZO2BlbC1YvzCopLxQfQeSn8+RGEjTIICX/3YTjeQcXKWv -e9p2ZY1AW3mkAg+mk1TCaS7CCG1JcL4zqvqvp6kZ2LYWW8lu4ka2kaagEkQv4tdI -tIrOilljAcXPzz4BPFkhOJl2uAwK6FzjgCEPEoBLxzMBKaE7Qz1dO8xTy14ClyAs -CZgh/EYrUVlVk6eNp83igyLhFxMi1rOd4GyPZw/2okJeG8uBXt9YPpDEsFWYO+Tn -CpVwbmHNQ18naTP/GlPsIeyrM+FiQb7q/s5XzFwD+mikITvF7g602dMpBQXDzyQA -/DZn2x0CgYEA9BU6CLYJMzK3xusFUM9lx9mGl/Av5DPpUPG9xwxSPN+UUuw0fxBi -bnYT2CgoXLDvnayT8rS2lkY6FKEnTL/Y0qo+JyR3lG8TW0Adqxp1o5G67kDBDXfT -TQFn4oD+ccasS8H/ih6b3waO7+Jt8CLqKd4M+fT4iVYA5kd1Zz0+AQsCgYEA8uyA -grJfiabICtZkofWLfTCoUgS0feC4Uu7f9i2awV57T3NTUiS1Pt+BywRKK0IhWc+b -Dk7DJwUADU8KtAwiXg9w6LUpDMcVjsVJYa7VKvZNboZowo5JKYm8VZ2bvVV4DSXz -ggW8/QTnWHPOhJcRK7EQjPP0B8IbUxaDapRuM08CgYEAsx2EmfHj7HNSk6HSI8we -l7rUX1k9+8vwcpsDtjcfflZgBT4bBAelBASYaW6GuAaLwHxtkZT1zG86nfro2RSL -64RM2fKT4hRk8vipDO/81gzSTZatVNHS+NaIQpqAnkO6GloByXzOy6qHaBgUrz0f -85tkkGUpobbAMDzONfWmM6MCgYEAzwoivUGpi3hKJnJzclYEfL5rtvurmV1du9E7 -sGVN8GDGWADCktAWaW+0/4K4dAX4xsLaNGeMjEUGtlEXnjx5ThF6+drtEabcCMK8 -uDR6GhOyCvEjeC4szOpHSfD6O3QMzaf60mZxnHQBeLG64eafC83tfTSuV65n+3jE -qKG5CqECgYAX1tOsJ/j+umoElqtMKR2w4moN7xtHvzkj2bCQhr1NuH9r9IqI+lwo -dsbOvnAouic89gU6s7Csi/0fofAK0uxoD2EO2UCrFnOHhs1wAJ1ujBzygeS2JZYz -pxBTxRCaRJJNGcKWmva8H3Fu10EoQMSD2n1obNa5k+DW+3XkM7IvWw== +MIIG4wIBAAKCAYEArfXGbA8yFyzlX7VK/ORJqQTTWvFtIE3LVGnbNtv2PO20pTV7 +PBZwIEL39wO6jdKfaoibeaJisq0kJFZH1FlGTuOY8gAWe0i05zd/50YR4iIPcyIC +m3k0cjNKg6nMrF/LoACdh1r2PB/+nYZqKT0M6RAdkkKQ4jm/LWsroVIJrr1sw6X/ +8o3ag/OTtnVk1Loix/Ps3eK7VrXze93mW8zllWp6zBbYTotTSCsYC7JOy1lA0sUu +9dRdmhkZ5Od2w6nk9BfJ6HyMaLb789W4bRp5isVoAFNHW2a36vmZc5QLUPNpNjEm +/RGEcKfITP+Fbs5c0hEs7+AgzA2j0uA7X7KREStY1URucExgPGYDb7GNiMOpCSNd +U9YiwnHtfolHuNF5w9ve31t5gjc9/hN3wDmeT6WZnbzv0ldZAIopnUDBdFZCLHBZ +UHajoteaPezT1KcROQcdH6fjllFAghgis7zklWceS/nkxWBQVAOY3SPyFvEQzC4/ +6g5oSoBFSR9u52nrAgMBAAECggGANIJJYHi9v+0XV2pbtjYaXeBNA9h3/hY9V7+U +Id0HWKDPtEaOajbDpZlRS8heWUzIPdn6RB7V9+T3UdiRWfGQnWNp2TJZluD9agWA +oAiwgTeSvkf3zYIqaIY+6bspQqavyh4lbqPwS3nE2zulc8kvynHI20sofIC9yjHd +O5aNwab/25aRyV80JDwzzBFnXCbLNNvWFavIrIXDdxIl5HPWoOFBK7WBmUPI4bHQ +UkeCLTNFs9k9MYrmrgsBm+yaFrmDGKDxl0rZ/T9SiEAd2j2IYfPVsSfbhd2ts+9L +Rm7uM6qt1S0M35H15TcrXyeluqY0HBMwl1Hm+4sYIGqeoSFxI4WMzYY0wQclIKXG +6qXi40G9wHcgo6QqnQFxK0uQexZZ1VOF5MouMmw3MV+wdSoPAOnAMNtU3/JIxQhy +m0QHmWIegqCqQ2DbLVoVTOJizT6zCqgFdfQzfhNZRo9Mg4K7nQ+l6zcfmzjfJ9yx +I8pxfoCU4WEJOm4zYKZEfx0+LrkxAoHBAOY8O6euGekx2caxmuxIZJuYMkuI+s33 +WfMNJTDs4yAXqJGqJH6MCb00JsgfEq09oX+ur1qk1BeLFPFem0ccGaeyhvSFVGGI +DyNgNGeWdYY9fJFuVxnp8as9NVJ4BYPoANdnTF6VLLSbtPK1nXU8p4h/rg0vCU/C +vd/HrvYFiTkZyKsyPLUhp+oZzGdy0cv103LzF9+y1S1i5h04X32CylZ07ow79VM7 +yiuadMSCwVSbaF0rel2wCGEgCiZIOW/7FwKBwQDBbV9nSZPpIMP4kOwdkhfW+Vi8 +3ww2jyFHp06u3QkMBEpWYLq9sFjU+ysAKnxNgsV9aO00tfoYuXv3ptswKlp2nHSP +GesksLjWAI9vDfOhdUJ2+JaWNTOwh+b7vGuBkGZsEAElIAVB1ruSVJbOpM6siBOl +8GlGn10Y7XK2DbUsBWy8PRc/pJ2IsBqeFWHhVQUFyUV9U//BzKMZHBRx/57Kdc9u +MyURsyEupnf5UVPX0NbDXJnDPwINVKw5GkdMvE0CgcA2mK/4ymNgli6zXGiFgYFC +GGxM1zXKY86TwVlBadtOP+38ZOF0lNa2ZEiSCjROmp/SfGUe1Jlq39NejXW6/iHj +T4WLNJbW7gHQ/L5QljBWXfxNLGJBReXGGqSrYsTEC98vNVK51xwb1BSrvX+STojX +6Jcojy/hFygZieumcZehz8hzOF2HAm0kKWv8WBECEdBLoPPXWzwMIDi7UyPpynsa +122+GXXKgBIoFt97vhoEaznrZiUFVHoYNhXSECx2ro8CgcEAlHrk9WChzh98z95P +ohN3gWo/GB0QPwF4RozD9a9vNm5EsjHmp54rUrLLu4Dhko6EE1TsYb4fkcMwylan +gz2/27UWNJNs0elmucAMWu+WyaY9sx34Wq3UU/q+8RceX4L9XI6ckmcWIgg4TIfq +jA4vKHn8uzDlX3UN/gioOeAj5vrzETzED/LJixfEFv3K+TJOfLaYRTCp75aqzKel +ei0DM99jr/BK0F91ZV4cUqJ/ffeuJKF810gSxzDsU5k8ikcxAoHATsfqWWrGvI2e +6VeOQaDv+es+Vh3NVAwhpC5EZqtLEISJpu9HtjqjJwcPm6KjHmPBctMAwxfWwDZ7 +go86hKTyHzb+p/3Epc5ehcNcXFd8YQaulvmigSwcgl1pVBWuEBIs9vnbIuDejKg4 +sYQxJeaBBWyw19HhbO7uVq94xa0cfPTcjUI7k3+oGlRcKm+5WAnzec5zuBTfYbed +jGZiCk94kpVXCycRddxaT4/oMjUf4b+PHtHKKTyjMbqcGJrklAXt -----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/root2.pub b/taf/tests/data/keystores/keystore/root2.pub index 7f1c1d5bb..129243443 100644 --- a/taf/tests/data/keystores/keystore/root2.pub +++ b/taf/tests/data/keystores/keystore/root2.pub @@ -1,9 +1,11 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA552O9PX6L8snG/nZdZAe -uFgIUk8uJihwCJi8Wk2n2kb4+80mMfOItJHcngpcyuPyoUKUAEj5XkK5b+nbGA67 -Xa9BcCEGzw1dS0RSkJsL2iStgeprJxmnb0tOYkgjFB3p0agvyVvOCfNWkg4BxnX9 -JqiGRVJkTugkzExZRqop7miJsj1m6YEpbSmfRdWjTz1AuSsVCsXjkS9b1BIgQBZs -j8x1o98pozmSBsmnc9TsruSUNQX67ZCNFNAhPGKksqQA9L7WAYSN5CP39T7yJE1U -CByB/qFwGuxrqofmzpsbDg70aGP/UK+0uaqI5Pfwq+rtxCyNr/gOO6UsXATcDxGD -ZQIDAQAB +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEArfXGbA8yFyzlX7VK/ORJ +qQTTWvFtIE3LVGnbNtv2PO20pTV7PBZwIEL39wO6jdKfaoibeaJisq0kJFZH1FlG +TuOY8gAWe0i05zd/50YR4iIPcyICm3k0cjNKg6nMrF/LoACdh1r2PB/+nYZqKT0M +6RAdkkKQ4jm/LWsroVIJrr1sw6X/8o3ag/OTtnVk1Loix/Ps3eK7VrXze93mW8zl +lWp6zBbYTotTSCsYC7JOy1lA0sUu9dRdmhkZ5Od2w6nk9BfJ6HyMaLb789W4bRp5 +isVoAFNHW2a36vmZc5QLUPNpNjEm/RGEcKfITP+Fbs5c0hEs7+AgzA2j0uA7X7KR +EStY1URucExgPGYDb7GNiMOpCSNdU9YiwnHtfolHuNF5w9ve31t5gjc9/hN3wDme +T6WZnbzv0ldZAIopnUDBdFZCLHBZUHajoteaPezT1KcROQcdH6fjllFAghgis7zk +lWceS/nkxWBQVAOY3SPyFvEQzC4/6g5oSoBFSR9u52nrAgMBAAE= -----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/root3 b/taf/tests/data/keystores/keystore/root3 index 4e829da43..d55c68bc5 100644 --- a/taf/tests/data/keystores/keystore/root3 +++ b/taf/tests/data/keystores/keystore/root3 @@ -1,27 +1,39 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAvkrFf48hTimH2vfqgD5dtB5tRFQnZaat5wSmczTgz01wzl/T -0/nL6rxnSw4yACnyUcJyxTP8bzLm3aJz63elIm91ef65/OVPBbXowoDB/u70lhn8 -mvT5LTWs9yBKOPQG92cHt2UwcGgPhWwA0wVnu1TFtca5hONGNNkpd/bNnbCCfw1a -wvYXF+FD7WCnzhvq/mZwgklN5ZHNZJp0KBuDXi3walJ/0nffvjVSCcTAYMHPLd8S -KF+N9yjSDerJ+opk6/8+TnihgXdcCyvh9O+/NhVF1BWh+Hv++Ery63tl7N793MSU -bJqXsX3Mmf1v7h+8uDRHWwVtN5VHy9XNmysmIwIDAQABAoIBADVcrmmI76QFjW1g -HEh+NLSv26BPoQSmaxnfefXQnEJFyx50TOiiogZfcu/fOTJGkQdQafLXEzDzqz33 -sl4TnSE89EqTngBHJZPKYU054izlQX1eKDIkBEQjSy+5xFaYR+PU5psNKzo6VC/s -C4cheudTbGX/JkMXoLZtN23Grf5L5rtKh5nRhI96pRQe2DIk5yma+THjSIZQH4h+ -rpF9117mFAaSO5akjfQ/qYvFbv65xeIbYsKcKVRlqT+Iu/Swu9gEopyva3Wop7iV -Sey6flqnGE4qgoR5SMIyhOH8GEy22qCp48cxaYoax2dINfoVGqa2VLdkaW9YtOt9 -mN8sN4ECgYEA9JZapnDO74FkAFpHpYm2MN4q/IfTp0mDVm0Hc43Cmp8IRn2m6GL7 -8BXmiqV+qSfw6zUWqxwKs6EaZwoXmF4MrBTS2DazN0pQj4zkAEkOLhzgoDwdDyfS -OaVyCzRlWnp/+DYDcgkbkKMbM4AOckLaIrk40VNzvV2SBEpvQqkUrQMCgYEAxyvZ -eORX7mDtQD+o7RSMJ6JVb0k2ICpv1eAdFinmrHLZEL6WVSVSBv4QddPIBCn0yvSr -eO8YF6Wb5JrEdpljnD8N8JBDOdYkvu+1zsEwDzrW8T4Aa5psdoRAhuyzq1IQ6dq7 -nK0jzkHyzh3sPj43E5rXh8ek17jGRphZeL4kiGECgYEAvEZA4X5UzOi9Ichc/oBT -Tqq2TE4CDvP3tb+XzMuC0aM5q4ltwdTwOo+hN3jNV0j3mxbyrCSZ2ExbFpYeM5uy -BYTCCM2Shy0ddmLt34pc8AIqpy2e8NumZ9mDQDzFCDDj8R0i6dU48s2bUrlwZWQw -pioOIpQqs8ojbEof+yBMWiECgYAe3WC6J0ipHEQn7LWU59ZAXhu3PzUwDuN91Vks -khm5J6MTwTUyxLHNe5m5aLRaUNYqjXf1KbgmEffymTlQ17xj/jF+0hxY3iKbpDIc -dDuqYIfmoqEWC7w7MYt+XTgKmJEebFMemIYv9HBYGLL/gkyusRQtanbVJ0Eyt3FG -ENFAgQKBgQCY4s+7eNcH27ozWAq+xMEfnhLUvyit/TiJLrCC2WW8oneTasTFMTVO -8DoxxFw0Y5ArUtgoK7PBaDP+NrMTwKXKDd+dAHFM0uonuOH2jzI6tFWMr3OAHFjA -u2W2/00iYLtGF7FnpwO0eT7+A0G5ptuDbJWEUCOIRvB5/dx9ZaGxQg== +MIIG5AIBAAKCAYEA0eMDRBYDd+Ojjvq/eW/cjMB0z1++ylVw4Y71oOjzUeMrTKuZ +2IvjY5jP2G/G3+SPcFqdpUyvtIYyyNbJsnL6XZ0KrnWOs/klzV64UR+36+ma5Nw9 +oel7d0mKZfVrNUwgpPsX0EYDd1bwSuOiUporvIBBErFx3a/mTzWCgBZrHCb/YXBR +Twr6xkFAA1YCM15mv74l29lQY51dEWUH+Cl6FuHLVKRW7OUuSwQ1cbViOdRYmxNU +hKZxLi9CARhuI4beHHrJRcY9ZJkO8jMibUz+LX45GZ7DjlXOBRlhcp3bJvII3CBg +jfSJR0SdzJMxrm3lr+5pFY4dGkD1BO/Zz6xyeVXMrZjjwTCpASdqoMoqV++PQhaz +n0gDqNa6tDnsUBvnD4OtI+X2CRvHc6SbauhqbtrkYfiTU4TYPX4GTUR3TibXOpD7 +dD939oV1YxCm3u9QW756jtHD05lZKKmBQivkm76aB1QwLhSh1I8wzId0B+/g8P+x +ilIS0JRa0MLIY9oBAgMBAAECggGABtbOWvAasdPllvmdtp/KAH4e8Eju5xnsoTTu +1QzyLMdpuEhZLYC1ap/mmedehBonAGK7g1Dh4tCCpB+3l8x+UwGUgQXMnhmuvSfq +ep49eH72sKFqkrWQc90eGN9r3GM8JxQVfRBi+YcIMnCDcAydAznspObKTo52Qzt7 +op/YYqT0qmCmDZzOehpTMyigzrqzP2k7Q5QrtetBRplTrqbvVwKJhRsLyBFZtlEP +SsK9ziOYtYjmNqJTysz4ah+5KwgwcnspAZiLPea2GC0fryaagnwFjVU1KQeWpz33 +gGHgX8VwHUvD8IlcLwzmgTvwCslBNTV/dhxQprE5VVIZ2EBAazxOEeYJ+qdR7/nU +jNcSDi2A/Q6k2zVSkbz+VB71JQJpc/G6LfEC1cfF+m0zHIiCfr3FzrMC0/E+tire +KkP4G9mJDN8CwsxI296H4xKSPBf8PI41RfAu/4Wt0ZJfF7/QXzCKaH0eBV1/xjYF +6VKa+Pl6atiUGF/6tO+va8w0NDypAoHBANmc3blHxBMRrhULDLj66JL4oprHTfLU +9THrccInO7OYnYdTVKeqjhuTc/AtgDR+jSvp4pkPAsaJmAYsJ/3uT/OSz/MJtZ1R +AmnE6NWq7jNXVuxiHthbrTIRkgAoH8PhCHDlHh3cENG2Y4HH/dZay5ZrrOOrU/lX +32F85mlXMenXjQQixv71NjuiwZ+4w72ruOdvTzEtOyPTBg8bCoHIRfWJzRfUUYc/ +pmABXMdMgCBISH4ASddeGhkxMjTZGN+C3QKBwQD26UAIQydUDUhsFdHwtGzdSk2/ +L2QTpsQ55pRcNB6fqrXeE3Jb+Td66+WxquPMYCbj9J79CGRZ2FOjqjNdkbMY4qiM +wLRhdIdT3HrhSPcQNUzyT3lnDyENB670DNoobK78OQHJatf+rj7RiIQyt9Bx6AxX +Luo+iPXQIH4omdnSo++YiyPCEQ5X/81I5IcLLhgE1EE53T51ErTFQmGjcyEi4975 +RDqpDBwJd5N8BxHswWHdoT9s72gIjs+4qys9B3UCgcEAjgage22IXf27BUbp7czs +gAfAcI5FpIgy43rMCzB5+ZRQs+LCLI/XIc5R6952f0xdLN0AJG80m4lv7A9jpoqk +Kc+W4wNiQiN+FLQMVm+x+VY2iB7eDM2As13eUTXezYQQc0ZGKqzXWVfVh/2UARPP +LgRmmUzXiLQ+Oa0/4F6lV/5zrdBY2kwGMlPeVTVMo3zxODNglzLzF0WB/dfjOqMQ +bdmbPsM21rPHDX+2Iukd8nPaxEnB58sl8201XGKYpkANAoHACXbHTYnFaCNaM0pi +0acYxSKj+EAIxfgObWm5Jg+ZXOVeMzTrnTrgNYX1N+ok8SB+XR5zOZ+ouQjhq9RK +Q7vh8YI+k6aPQ20EAuLgkuIJFkX0vRTuwlSCH827lv8nHYWM733/44iE3u4u2jkx +WABTrQoH7w+NSvhU87VLIKNFBh3igSZUKIwe0KCtba3Uv0j1ArpgBafFTRd6dlUl +CO7QxlWVplhHJ1Off31l2csrlLeU2LnlhHdotWtD6wAkmCJBAoHBAK7NTBeXj5ry +eY3w9v0Ab98Dl/36McPsNPs0r4ADec/ghFnPPhGiDW3So3CjzBA8rTx8q5X255mC +zSxYALJ6EgRmpSKIZYrbuHpQXHicSkqq4AFlwVDYrlm36Xsc047K2bhsMZDl7SAI +yKhjmQnx6wor6QWqAn1wfg8/2b721o6FU8I5r8qUrm8GpD1EXt35ynAkkvd8uuei +VHhVA17DvmEK1wWQicC6bfQ8NXzrBePy4XxO6QBhJC6GEbSbGlAhoA== -----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/root3.pub b/taf/tests/data/keystores/keystore/root3.pub index 3f7aaab9c..ebb6b8068 100644 --- a/taf/tests/data/keystores/keystore/root3.pub +++ b/taf/tests/data/keystores/keystore/root3.pub @@ -1,9 +1,11 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvkrFf48hTimH2vfqgD5d -tB5tRFQnZaat5wSmczTgz01wzl/T0/nL6rxnSw4yACnyUcJyxTP8bzLm3aJz63el -Im91ef65/OVPBbXowoDB/u70lhn8mvT5LTWs9yBKOPQG92cHt2UwcGgPhWwA0wVn -u1TFtca5hONGNNkpd/bNnbCCfw1awvYXF+FD7WCnzhvq/mZwgklN5ZHNZJp0KBuD -Xi3walJ/0nffvjVSCcTAYMHPLd8SKF+N9yjSDerJ+opk6/8+TnihgXdcCyvh9O+/ -NhVF1BWh+Hv++Ery63tl7N793MSUbJqXsX3Mmf1v7h+8uDRHWwVtN5VHy9XNmysm -IwIDAQAB +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0eMDRBYDd+Ojjvq/eW/c +jMB0z1++ylVw4Y71oOjzUeMrTKuZ2IvjY5jP2G/G3+SPcFqdpUyvtIYyyNbJsnL6 +XZ0KrnWOs/klzV64UR+36+ma5Nw9oel7d0mKZfVrNUwgpPsX0EYDd1bwSuOiUpor +vIBBErFx3a/mTzWCgBZrHCb/YXBRTwr6xkFAA1YCM15mv74l29lQY51dEWUH+Cl6 +FuHLVKRW7OUuSwQ1cbViOdRYmxNUhKZxLi9CARhuI4beHHrJRcY9ZJkO8jMibUz+ +LX45GZ7DjlXOBRlhcp3bJvII3CBgjfSJR0SdzJMxrm3lr+5pFY4dGkD1BO/Zz6xy +eVXMrZjjwTCpASdqoMoqV++PQhazn0gDqNa6tDnsUBvnD4OtI+X2CRvHc6Sbauhq +btrkYfiTU4TYPX4GTUR3TibXOpD7dD939oV1YxCm3u9QW756jtHD05lZKKmBQivk +m76aB1QwLhSh1I8wzId0B+/g8P+xilIS0JRa0MLIY9oBAgMBAAE= -----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/snapshot b/taf/tests/data/keystores/keystore/snapshot index f1dbcea20..df8f44459 100644 --- a/taf/tests/data/keystores/keystore/snapshot +++ b/taf/tests/data/keystores/keystore/snapshot @@ -1,27 +1,39 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAtWRrSKtnvbgwzS7VuBVRqiYac4pIREIakkofd+NtMYiMtNlV -6Dh1KX327Fa2HxFZKr+krcdi0zTVo1tURNME61QEVwMNANpDv1mYuBmdDpm/fXVi -Fi32Yw3OQB3Auw9vFLx3VkVdltrtmGHs1Sg4gtdVWsFcGDv1D4N3z3m/fCef39Ol -hVfOmwe3nJJsvZAlBJINa34PvXnkrZ3r+YCDb0RNHyJYdAdt/dcpwq+h83NwfHA4 -bDegjoA7k3B00YPqaQECD5U+thqqF+uaMoVZnCcdtMDQQ0EoqKG+N+cp8+ivdESq -tUVuUUaD3gBVtDolByuNW/7/uBG4fRE1Jph9HwIDAQABAoIBAAbF1Benhr0XtoLC -v+oaqazvtUchH6ekzDcwG1KvpDEYRyCtiL6d9QnykRir+Cray/iDpVNzwWXfcCak -T1Yuht1+ipbxHzgr7iGj58bf9fRIm1TE4D+xwaRbLJtKQRr67YvZqZ8IAgGS9RIe -fehLkyiXf7FezOB+xJyqrPuLMTIifIRywKx9fjrmcVwFtZV0IJRtmzsIBbDZ71xk -I18kZ4iMAwDGOj1Ze+8oTP9g4WeWwQkqwXd8WjEpnhp2MKJHkH9DzE8x94yrnWbM -P5dxb7XvhSC6kmmKTDQrAWv7nowCAYh8KrLeA835O/CDQbGxCnjcL4lEk2GFtuE5 -mwtKTPkCgYEA314yFinkWU+K/ieRDiej7tY2bGO6UfG8SXR2KmCl+cS/NBH6Q5Ji -H7cmzSuzY2os2fqsuPTf7l2NM/fBE52fREJ45hFYGFxWaDZFqdsgMHNJki2B1zks -RwpYclIjSlSeJcgejUJ1ya2v9BJHy+gw8a4WpNe51YUBxJDw2HcQ6GUCgYEAz+Rc -tWmpXZwujDalWNCJ+NEft/rD+s0jy7taNPYXdZWk2BsmuFa990WDduHnjXlAqfld -HYTAqVl01SyM2IXJyRxaVM0k57jzpEig+yY4yWU0r2Le0G+XXdsMI06WhL+PbKRV -fNs/7rWu15cT2RpRXquObsxx35i9rluZKuX/3TMCgYBaF0L6X4EjaIq2Ab1mySQ8 -k5e11e9zV53KvrdeVkb7W5iG5u1azbLX+eYjgInFAjD+5jU+ED41hPQLztTIFZ4E -SQ88NCilArEzLRih7qioAgfddo9VAFFUgd60lV54f3Kd6H4yGWkqo+xA9BKTMp5z -C/VEHWJttUzGPHN3y2Y9ZQKBgQCf1mBBSt/hDTfsrgcq5gtutrrAZZlQt3CSL5YH -qj4XNdrsHNQEXwznlRaizMWPTG6fQQ6Kp4rJqfHeBMa1owemDJqXILMDRnxtDzpW -XujCT4HWZxoQ//tNOiF28/FeVzoaua7QtHHPQvkO4SVtgoKVWynDnoTe+Ty9VcfJ -59R1aQKBgQCmD9om4pNKPSfW3zarO+5R0PwyncgBQSTvGUGtKjIMzsCuCKtj22UQ -dXrT7nZVpYaaq64/ljybNrycycZcuuZTqJAH5j/BItoxBz4eXgaIXY+Xvzt1zWxZ -2x5GX83rs64/B3ikxvpmlyI+RslQ674uKKkTzCDpas4VcZqYbGbE3w== +MIIG5QIBAAKCAYEA62ujakruXem++OLeF7s8Ha0yMjhowyCKqXnh/FlT/DHTn6Oz +1UngkwXe6uoDO7ctEmMvQl/7qURP0WdqH+EaibmyiJHEaeULXHx87evVWaM8GrjR +ah2JPWeddecOHJQKr+2s0Ah/azDjxo7zKodR5jCdTdfe5qAh9JDdqiPgKWPSyJSm +gNjH+2cRVh8omlPJYuUa9L4Nqgs9BjCkBy1E/7VQON9VIHnO51sXlp8aiehW2wFC +1/Vz62w3Kz7P2sWhkx1i5NHfdb9VWf7SXrk1eARylWmSMeQLZxrMzSyASf2Bx+rd +mzQ522/ueVhd2mwqx4iunBkJ/4egw7f8bmLSeaG+kyxK+wh0asF5y1eSr8WO7U3m +bx3YwHz2GYr4g0YVcVcD63m3PTOuL/XPopXS77YLCbTOuWTYq2Ie0zIK6zBoRmmX +IdJggZV9JcEHsDfdS43bb0w76lut/+0TafZTkMSRO5pgksHtzUczq2nw2g57wgbr +YtgiWcFaNSaQ/UvVAgMBAAECggGADxR4BUkDd9SPPRYbL934fdYoTvs6CrW87Bo4 +lZeLP65ZZfJwhIsU7ZYEr3uJ9XtIUdM0pcXMMw2DJ2C+dYhP0N6qRwE/WaEoVyZK +QltG8VT5dqS8FVYLAnnupizExKPfA2HwHetNbipVjNR/UwwT/PDEQsY/Kvq68hWN +fWaK51vTlrGe8MXyGXKCs8ePLEONtN4EGgVKjsflgs3+087cipyspNf5dfkXfc5h +9m3+nzLYzXKJO5gncr8d0ZFWcycRkQsXWmX+xbRz46bU7dtpxOUXtPCPhg+65AW0 +il6asiQ4LOpAJPd4m0bc+feCJ4o7CnP0B61ULG4ITiuN+QW2RwiaYQA+boxR2SoL +mFlUbuBzeDKp9flt3esR1PGaB7JY5OBsB5oaH1wN27sAkXpEONWbIuk2S6dSMHpp +NuTRAL7rmdgrCs5uhVdZCbivacyJk4D7g9rstMpE8gso8dxb4SkVxTke2oZYxP21 +AHq1RHE05BnkX0FgIWDr+7hPVNbBAoHBAO+msoukUXuUCLy6VyorcUPneaMFsf/L +b/7h7HJGHr+8VpnVBgQPOvkzllSMF/Len8CDWbODRLadB9HQhyYCJHVSE8BIIh8K +sLi0EJcIaindROwQwZqgNBeierh4Awr0DbSqQrlDCeW7QAPs51PurxVthIQjGpKq +pub3/XwbUC7jEmymFcgRKhYHYurmnVHB2spvWzI6oQW+NM/W4GHYUkmHoMMOGJ3p +GG9WicyWA20Wfn8AQeEEsgeh1TQuD3URfQKBwQD7ew4rPNm8A+4WNe6pfsmsUORV +SSM8wJ0hNBXkZ3mFcTPkZM85AzzqzjJI3o9iWJNms3cUpxk1wXN9cCt1xF24Rk/d +GSBGDZhuICWc5Zzc71eAzcg4qNPmJMXGlOlwP3SyeL5Ef/5bmzzKSkLleFMbbAS4 +xbVRcAzyW6KpxxgQVtPKp4WPVBjMCSPMvNTQIiMwGgxSoR7/BYYYyQ79jITnzeV5 +tpj2HYqk5LYtY7yxPS7SKaL5HvihF0PWJNYaszkCgcEA1kFSn0XpE3Ll3NU72Je+ +S9dHCFivKuHW3yldG01VcFYRlra9CiQTtXhJjo0xXBFtAdBtAfD6HcmGlC66pWCE +997Jib7zwozsMjXKHz2GrKcGV4cjj/pqmDbLQOEK12AaYMtXnAozbxBZyyiiKIfc +QGwJbZl0yGuJjDVqiupgZYrdjgVus8+ksM0pwpkrTUzjLtkfz2hbTacf0DFrqg6c +guCe+cRAfe1Hy0KzMBVuOrlBnom8XFC2Wdx1oJENgLyBAoHBAOS06xPjiVl2cYb9 +kYnQZvUxtBbkJwnPWpeh2O8aM+hqJXlnPRZqnXImCJFA50HXsGZMfNXpigHbZ38D +DmNSLLG0MFmxyiornx84WTyxjdFYUkov3BG7aMr7UmrhbtPIwga1zMRbayZAri6D +DwfGQD7GJB0uoVHpB706HVsuV/I0JPU/GTZakxqsjURbz2diRIIwjlhvc9MWYPgV +km6A5zYxiKsCp2XdRAPmhNAOzsKaFATKHQ9XXWKT1/vfEGDD8QKBwQC4yQ3Gt5ql +ynzeBB8gkazZiglg5I7yH/oXR4rrTbbDvgldcsp0uW173Oa74FYhhEyFOu14g6F9 +yEu9iTuzQ2zTTzlY2OOzxzcRFXB2K8RA1XnpcHjh2HlEy22XjMXhD/TXzcQ39EVc +62RVRjwoVVorMRzNZzjOv5uzqARHtkivj3ko1uTfbtDuHYNkRSLVbmlGWBs2njei +e4R02EfC6hPED6Wzt3AkE17cah9EE5agiU+1oJV+jKwbq8mOahrIs7E= -----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/snapshot.pub b/taf/tests/data/keystores/keystore/snapshot.pub index 75f16f0f4..f34c71a4a 100644 --- a/taf/tests/data/keystores/keystore/snapshot.pub +++ b/taf/tests/data/keystores/keystore/snapshot.pub @@ -1,9 +1,11 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtWRrSKtnvbgwzS7VuBVR -qiYac4pIREIakkofd+NtMYiMtNlV6Dh1KX327Fa2HxFZKr+krcdi0zTVo1tURNME -61QEVwMNANpDv1mYuBmdDpm/fXViFi32Yw3OQB3Auw9vFLx3VkVdltrtmGHs1Sg4 -gtdVWsFcGDv1D4N3z3m/fCef39OlhVfOmwe3nJJsvZAlBJINa34PvXnkrZ3r+YCD -b0RNHyJYdAdt/dcpwq+h83NwfHA4bDegjoA7k3B00YPqaQECD5U+thqqF+uaMoVZ -nCcdtMDQQ0EoqKG+N+cp8+ivdESqtUVuUUaD3gBVtDolByuNW/7/uBG4fRE1Jph9 -HwIDAQAB +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA62ujakruXem++OLeF7s8 +Ha0yMjhowyCKqXnh/FlT/DHTn6Oz1UngkwXe6uoDO7ctEmMvQl/7qURP0WdqH+Ea +ibmyiJHEaeULXHx87evVWaM8GrjRah2JPWeddecOHJQKr+2s0Ah/azDjxo7zKodR +5jCdTdfe5qAh9JDdqiPgKWPSyJSmgNjH+2cRVh8omlPJYuUa9L4Nqgs9BjCkBy1E +/7VQON9VIHnO51sXlp8aiehW2wFC1/Vz62w3Kz7P2sWhkx1i5NHfdb9VWf7SXrk1 +eARylWmSMeQLZxrMzSyASf2Bx+rdmzQ522/ueVhd2mwqx4iunBkJ/4egw7f8bmLS +eaG+kyxK+wh0asF5y1eSr8WO7U3mbx3YwHz2GYr4g0YVcVcD63m3PTOuL/XPopXS +77YLCbTOuWTYq2Ie0zIK6zBoRmmXIdJggZV9JcEHsDfdS43bb0w76lut/+0TafZT +kMSRO5pgksHtzUczq2nw2g57wgbrYtgiWcFaNSaQ/UvVAgMBAAE= -----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/targets b/taf/tests/data/keystores/keystore/targets index a905e967a..0f4c5f782 100644 --- a/taf/tests/data/keystores/keystore/targets +++ b/taf/tests/data/keystores/keystore/targets @@ -1,27 +1,39 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAwN5AWXl26xlAy+Mii9tAwXobOP+zUsoqwNKZu355MCzpMRzH -qhWe07iDPyeC+ewbSmeWvpIEOwCWh2DyHsFyV7FsDHJiiuFHZcAbxTu1zVBf2FwN -cQNfNXUr3ShmcyFZrKq6ZaaslD0mhSqdFwVenEke0ufF9yroV4U3IC00KaMOxDT0 -EH3q1S8SbNtNh4VIQaSwn5CaNpIXek080oQRkXLxJivHJfHIq0iFmXdjNr6TXYNy -gCBGf2nE0R3X+bVt7xF8/dbanfWn+Z04+ZKsaTaMuOEGLgfchv33neLcCBKp+fKo -jEcEpVE6g18KPt2So+s3hSHODzP3V3oUYo8ElQIDAQABAoIBAFUO76RGPFrs1TXW -Izs44/MwDedyZbyian6FosUcvwevFtzRC4GIbXaETmXA4DOmnFaRHttG/FSlKr3j -1IQZ3nqsRbGrlKgZOGq4ccbnUYON6ec6mbb4vLmPxluP4Lbvw2OyG+iOvFfYLC/Y -nlUzygj0+oIbM6SRKMzIdIpdRT8C5YRrh+DgcfLXw1It7hcvPHx0HmGeq7V4rBCn -ZC3QIlOHWs1KSLDA+AEchWF9dorQfbHj4SPQslypLzFfJNIMAvA0ECpC/VlSP028 -mzmUn2QYABidx8SVFDtlDX0qP+155y3vYuA8OS6jylFaJiCGeniAqXgzbK1/tN4B -pTFDXRUCgYEA5EqF7ZDtQ1DIHSlSojS4gDV8/r0IC6xJcckHoCEP4jl3yM2JYBCS -HLSc/mU8afzuzyqCVfd2+YLdwhroqb+yQiM9LRkIPKTrsiGE1YVGerRqu5++j3xt -Upk+Ue/uZzK302hsg8emRosSL1hg5I4Kk2KFgWaWd/o+soRBMOMqCPcCgYEA2EcQ -df+Ft533dkdJf0jMF+700gw5TvP289GtKclo6tYMcabTOUqXQwE/72r6abyNdzV/ -OqIi2MAJ2KccsE1LyFq5BQ5qupi4ZcgeHpQ2JhjRM0Zg2/tMCfklNHt/aFITIhqs -REkPX9PbtdqgjH/P2A25IP3csx5jOlc3eoXUJ9MCgYAQXIr2uNFYZrzA4kpK1851 -WeAIfdHKzGFDJ25FerkhtI6yNJDo8qcWKZeq3+SRkBAphtlqgd7kCQ4NsFIGgHet -J8tlpQqjFgrSbHaRuwiPGMkhg1RsAjXvmo4N301N1iO4oh5M3406NxNpk0L2fnuh -jokU+h5EoQnHT5VAhLdphwKBgQCTmlRio6Pnv7hekaJYax9XCi8tl0gZWSjmF+h9 -R0cCVlkhy4AGbqCzCwxOYo1KUnOdsvYE1xi/IrjVkp9ity4MK9Zv2/n9JTNby2q6 -5d3avD8yJkr+dw/bEp1QpyQ51yHVuaxt4grLFLSy9OVzXdtEkYESQg84c3m3HETx -qpozHwKBgQCIpa3Vyq8B8mmtE7g5Ms+5smsjNgA+ymCRr/gcBHAUQ6PQGvuqsdZM -4bLQesvtfFHpJbvxDNOF+HuMfdNwNunwCM0K1PFnAC26pEXgyg5pv3IY8O4OI1EZ -4qnt2OjLfHMQP8KuoijF8KQy7oHxc3YjjZNIsjb1y6UDfAyiP91/ww== +MIIG4gIBAAKCAYEAry2/cNvYnAlLLt67okcll4uzLXGR4lkbp456xCSNIN50iN+g +yVov8zj0wGyfelprzJY6JsJUCH0l9P4PLeNyn1EIUjJ3lp3l/lQjfqHybEnAbgA0 +6gbIUMtesc/JsIzmcuTGLXHW813a5cApz/YqIfrvdWexUDV2rZYKR7OUSVCzwLNN +47q069SdjzE9ghwI234xzQEtbL+rdMUOOOmKkXq1RoL6XbnA0xtP6erFlDvrvGXQ +yUaHoKNG4VVcFfC2qikJFGt9319QIfc2bOUKbpkoQPbMcI/75BfMZo2PE8ZZ57OB +R75QSknoEpISsc6XbZNCW2wUrrPpwIeSJKzLqYChxbj43ZTAVDvIfXSWrSdb3/7N +7K0ulLnhJVW6mNpMHXvBPUKd9Q1/P0u6JpNBleY+2iyxV6CZA/JqoeLBF164jeD0 +pBrX9jWzdDkDK3bpQ1sPRb9rP7daMBPqoExW8zTqrO0/zs1zRdzexT2IL8cjOsU/ +joV6EZzlHKE9gBRhAgMBAAECggGAJ1Y6CYFMpElP+S/p6XhZgCzOKPO6Qx4oYBlW +BwqAKHPbrkqtQ9m9L7xH9ZfOvf5k+5V2bHKxxRA5QEj2pqLO/+iF2lNb2FYPqetB +5zM9iUSMcgcY2r54J/BrDLmwvDT/oKgvuk+4aYDXYUUj/n90GZpMQExvHChNRJCP +MWepckctfiWlZXBtJRHi6Z8whTF/aa5uR28uwJ9PxJJlbbE/vQhVgYZy6y4Fl0Io +UUo3YOCNwIoKdtAgL5nKlloBKioZszuio0lT0oNldvYCNUqP88Bjzw7BXzCw4lAc +dhFnkmvP5SCg1S0Tif9KkB/aXFpFCqpV6D6vvIL2RmyOdVd53rRBwj/F2IJNAL50 +sMFSLfUuQdoH21W49ipsviheQh1JxGk/Wfgob0CWo49oNbhKJW2620cHIFUYBqJn +X+37LNGss0D24pldlelbazPk0OA6Mr1W8IIsStPPBRMZfDLMtbTmIr3QVvYLd64+ +qGawuvWHG+r2cLaefOEqgxyZQ9rZAoHBAOSxiGdEGIuk5tq3cg2kOUa1s/xaUD5k +CY8l4qXTqBKc+AjcY2ehGrquu2KZB8nmEJcNcL3HDZQfqJUud4omMxN5FQM7AFMf +TaJM21rEDDx450cv10nsnJPv48Uah25J9UChLBB8DAGLWbgyOzyrKnMCzD9q4RmA +I23T7JHnXqea4crAtcspneYbf9sVbaLyJQp4CmX9/kqwysdI+7xC9upDcTFydmUR +w6NEkYgmkl6g52DPYN6ZXhanW5iyEE+ftQKBwQDEGG4brSoz5j+F5jQmZDigi8e0 +xqTrbpiQBRzmqMYsdf656MzDj6H30z9qQNwks/6Lu7D0V4XPC283kAX7q/dqBohp +KEDQYsqMyTtFq/DZ2Ri9XmBijY/N8+xNBBwnA6xSsvFQlYIJMzmx9g553wwNNQtz +DdMSZkdEXtaHo5aBLjG92i7VdXa3SnoTJSqxyd5cBCd8I3y3pxr5mVZ1QeutPcYQ +NibSXmVEBVtGMudZnuwTrWB4tUi4rgj7/Ks4VX0CgcBRixvf9l/qKvpFsnNwecYS +eGec63cBSBpAeHnANyAOwvmN70dihAdL2VHnbjlgvC/eLGSuxnMJBeDOkKr/D2/W +2a2sYTVUbiz4Wf889fqG9XVB5MUXDs8l0LueZD82DBju2okjt5dwVYfALekBUObp +6214j1uEBDSdzJrly2Hs0UUBToWD02sByXxlWdal60FZ4kOS6mXpq/Ah7twT3Ky+ +Cx4pS277ysG/TYu2yEoYg7b8xfT8aiMqYLJAV/2I5qECgcAgy/k2dcrWLU84hNz6 +As8ZwucezA5vNescQ06nIVkrvHxi+ZWtq4sqWNGFYt2u4c/T7QtWgoDltQLf5x2p +DwTtXbRY6huU/sDjtRBNwckhlla17V/ve7+ucXp3ExXmTI34sub7VFYQVdnzcrTP +G0f3uYR1tL01mZeXzsjQnMKiTmiRWTl2CBRX6YPrSc8PNzUSbLtx3rmQOcmgL04v +hFv3eJp0wanSi2kibEbswbzB13uiet/ksGU+RhVIl+THIj0CgcBWi+u+iwBCahdF +SXW81rYJQVM0VFySCLOqXUpudCft0ZdFdFZwQxfGEJ3UCOqMZVvCxSmZ0iWY/+vS +BcHv0Rrz0hX93skmIp2WQL7WhDGG2e1Rh3b0LIT2MwTGpVXq3/mdT9w23Rv5LrGa +MvPVOptVBtkYgyyair1Jr0XpeJLp7C+pVZ4Wkm9ISunJkwrwRKDE9guaAaYcQEN1 +I5koeSlEUdHitENj84i72KkGgHj988W2Lkmwi/GHCV07H/Aee0g= -----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/targets.pub b/taf/tests/data/keystores/keystore/targets.pub index dfdccba0e..9c1084232 100644 --- a/taf/tests/data/keystores/keystore/targets.pub +++ b/taf/tests/data/keystores/keystore/targets.pub @@ -1,9 +1,11 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwN5AWXl26xlAy+Mii9tA -wXobOP+zUsoqwNKZu355MCzpMRzHqhWe07iDPyeC+ewbSmeWvpIEOwCWh2DyHsFy -V7FsDHJiiuFHZcAbxTu1zVBf2FwNcQNfNXUr3ShmcyFZrKq6ZaaslD0mhSqdFwVe -nEke0ufF9yroV4U3IC00KaMOxDT0EH3q1S8SbNtNh4VIQaSwn5CaNpIXek080oQR -kXLxJivHJfHIq0iFmXdjNr6TXYNygCBGf2nE0R3X+bVt7xF8/dbanfWn+Z04+ZKs -aTaMuOEGLgfchv33neLcCBKp+fKojEcEpVE6g18KPt2So+s3hSHODzP3V3oUYo8E -lQIDAQAB +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAry2/cNvYnAlLLt67okcl +l4uzLXGR4lkbp456xCSNIN50iN+gyVov8zj0wGyfelprzJY6JsJUCH0l9P4PLeNy +n1EIUjJ3lp3l/lQjfqHybEnAbgA06gbIUMtesc/JsIzmcuTGLXHW813a5cApz/Yq +IfrvdWexUDV2rZYKR7OUSVCzwLNN47q069SdjzE9ghwI234xzQEtbL+rdMUOOOmK +kXq1RoL6XbnA0xtP6erFlDvrvGXQyUaHoKNG4VVcFfC2qikJFGt9319QIfc2bOUK +bpkoQPbMcI/75BfMZo2PE8ZZ57OBR75QSknoEpISsc6XbZNCW2wUrrPpwIeSJKzL +qYChxbj43ZTAVDvIfXSWrSdb3/7N7K0ulLnhJVW6mNpMHXvBPUKd9Q1/P0u6JpNB +leY+2iyxV6CZA/JqoeLBF164jeD0pBrX9jWzdDkDK3bpQ1sPRb9rP7daMBPqoExW +8zTqrO0/zs1zRdzexT2IL8cjOsU/joV6EZzlHKE9gBRhAgMBAAE= -----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/timestamp b/taf/tests/data/keystores/keystore/timestamp index 27c5ae478..66672089a 100644 --- a/taf/tests/data/keystores/keystore/timestamp +++ b/taf/tests/data/keystores/keystore/timestamp @@ -1,27 +1,39 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEAwv8CwlU44Y6ERLZI4OYbOKL7YgdJzwgDHBBqVw0IOwEvPrK5 -2YJgIUlgkX/POqb3qQnOkwQza5ZZgn2akn3gI6Zs9ZCV0t7ZNLX955Uzoul0WfA+ -EFUA1VI5ujMBH8E9YOKiokCa6rFxgY+9RTrHPuIZTySLOTN8je9E9DsdKOkXQXtU -voZlOqM8AbKcywR1CVSKAqmXNkf55txhdXg7NoDoK4T1w7Qxfed9Wgruch/12b5c -vY6VsQKGOPZ+HbQBN5+wXopezyPBUj1k7qjnF+i9FBjKHM62G4mQ3s1iAs7qg6xC -jQP4pW3Q6gN5i0iStgmHy1FoynouVtQAc++N/QIDAQABAoIBAFq4wHTfp44xe1Jo -qLGR/Vo1YdWy5GEhLikxbfhARPMG0w9NofATm1wBQp+PIj/8jL8lo+l8i9vjYJO4 -kmDTlaOge5MoiLxKGC5Q+edz4ElMamipwIZitfeJwPfjYQOAKWlZKCdq/Whx1Ahe -csWx2h9knDfZHbkoPivfBWrH0gJE19kRVFS05V6GxPdE93mGC53JeTJxltabgU5r -sFZr5AbgE3rnLWPO2uqksiedoSHNw0qE4/fS7F7EHlyWpdcZT8qBhXDMOq4kU477 -aPEZPItZ6Lp11IPLXIQE0MTAn3rBYrTNd8/AnXnU4V42LlLfgdZpaiOZ9Mu50ozM -IBb65HUCgYEA7UuNE3BkMOhot2Gla5lZ2MhCwb8gYMo0mThrrVgYli3s73mYKsoj -49QgRcOso1IApShu9PV0xNgGhUSPhPtUaYKRSXKpxVKtuAcLYDwuG0S0DjSbp9bN -R7ZzlWaJcZkLJdYNm+0w1Nj7nJ4zUMZn2qU9j9STd4CGo97Yjb7uRKcCgYEA0l3l -V/t3KXym6eV+qCKIWpUrrw9ZRyUrVPpl7wLdo3LaSu7oTHCoYptZTs7Q3+w4OaBs -qT0XK2InH8UqrbDPFTx2iX484AaMeQQBs1HVLmes6XkyVbfqAQbDaQPV+/RQuTdY -TgDnOJD92hkWuPOk/iwW+0WNvPwmSJSoMfCmWLsCgYB3/w2fN+WiidRyb5GMQOcb -ZeHEQhdoerhwhwSEixkb0KuRSib19HSDwIB1ZwcFK/GhkznQ69MZu7hIaiw9bi74 -kAtSXgaV/0JT3lQVXTlflrWKvXW9QTVbv1rhwRFd/auSfZUyNZbM+9D5GVMP1NUt -zwO7mR7dfoQXmBhgTZ4F3wKBgGWsYhtq+4X+rEGh3NxwjEyTimB636CGM3JH75pc -XTkRWrYa0AWZ8ZhvEvQG+2cuqWIYykvlrdwW/WfaiK0YJo5SAcykSdHQ+HXI3PWJ -WKqsCyNwo0ZQtHW4ihuocfTreVR7jl9tClQJp9eQhq3vfFAoiRb63+12RR6RUtWI -RS3fAoGAafCasU0RUyD7hLCf2dq6xT/YSP0Mi+MqROThTUS+FnJAGjOE87brYuAT -0aZl7QTr59+0ChnokpehnZ73pCerhHf7HSV2/e1Cel9RONO05iOAKTv55/H07oPg -8/s8+bPKUiIwccFeHryGd6By+QS5JFJpLTGPhXBZhybDAwYJeH8= +MIIG4wIBAAKCAYEApJByr6DYnW+DhVH+evlojvday2ELWYBeHVcc0YC/Y+wBNdVX +SvxUSjwjgTVmHv7kJ9cfDBZX1bafWXOKx3BM8ouhxeDjOQ5TBZv6EBl8SKE+IcqY +DhkmawceFWL2tayPZ/TPx5Rjrt6RvfmLOKWjGCZ18RF5OBOVNb9MjltKQe0T7JKk +4XMJ/M7Vi+DlwbITiSfQUoyaQDVER0ulnLVzGZWwvAcjGG/3ZXzKxt0jbE+5fpfK +tcht8JONrNP8uk3ZdJvh6aENXrVplcK3UddwExoh2cUGhnJbNqtgBV0GVA0ZeqsX +tf//d9Ra2qFHfCDUKcMtV5fP1O37dkY51+vVgMC1jEkcInxdPhoB+HawjCAC5Vix +DvCgdhi5eSjJjkaUdLxUHCoq+n62FDPrES+BqkjHGcNpKQEF1scrrunYU6ozlFkV +PQrKOmV/tnMW9wQ0AdQe0RdSrLeuSYjLlW6qqiU9Hjji836htF/7OEHF5GeLlZMA +O3df13D1cKgFrzX7AgMBAAECggGAElQm/I9fpk6l9BK+fe01dhGawo2GeWt7ZVfZ +1S5lIribJzx3F9pO0Q3YWSscuqsNDQWVZv/ovIbgl1KadxLM9IlqH+NSVifVm17/ +VQ0MSKfyMZ/3m5UK2wop5vE6JTXuVa0bT1FPC5+tKomWtgfMyIMlc7oh1DBqLVhR +1dvZGMqnrhu50tprQbBlHHU/Yc7MWjmy/DQTd2n3YYbNZUzYYFXJyhzJYzllRp/F +k1dMpg2jIrRpVsyCDN+CUhOHpysbCqWZQ8kbHh48p95jd+d/uythRVbSugRdEZAb +/9afX0J20gLES2Hjj+glSLJwriU+t5uwLRH5ksYGrep74Kog7XRluNQRKL1rmuXY +bpTxXrrLIMJ9dSyh6hsapgjCnJ16j55/XAQ0qHyf76k39o5naqWnASX10ormQZTc +VzJYKpjBNQAsyBXyjBtpRaag6iwQBGTDTv3dU+k3V6qCs7NymH8nRYhEESKFfOxG +dOPebQ80d6zOcoTqkvrPDrEcd4BBAoHBALwtLlncHQ0yq+edU950efHmC77D5lyj +T7LFRvIRi3VX5qSSEtbNXJKCIZrYLdJ+HzdHklhPhG8UbvQP0ziGKe0nlTXeLPKt +iYaX+nvtycfMoMEbl+lZ8YmeWOyL2l1Zoo4tNAUOl6e7mffoaEKZdvvw+q4iLCf5 +EqgZw4KWwgP2nL91r/QjUDZSpjYcRHHUtMqvUzmaAtqBy1sRzHSvxVsIitxh++4h +auvuGhHtQCsEMaZEhLxym9d5QX/9BN4WsQKBwQDf4JgQSEkfr002m8Ra8VeJEfsx +JJ2qyaEWPywKD5TxrPcyoZ/QOjm2FALtujpyIaLX+lC8Skhg+ilN9i4d74Qrq1iA +uLlJz5AoV1XeUC41LkJV4+Q/QgdfPmDKODuHbr01MxAaWX0KSEwaGnh1AAeC1wcI +P+RZOQW06oEqYh7EA4NFKangOYWuYhwrof8IgabOmkvAmWGfPnJd/3uUCGVGoi/0 +Fw0JS34da5ChiY0mc1xP62ON3VR/uGirnhpZ2msCgcBkKZh2dFdyYvplurSdwFn4 +jH7L9/JydOtDOQbeasBUoYk/KBGnDICt615/0XnyhPeQsSQQpaLUjYfRmWrQt3kx +ptQhbDV4py6A2fyWYqf5Fc6re0iNCTcsDYE/x+Fftwpzq1P5LR9ERPNbpfV5Hb7b +tBV7Au2GCWoI2E3dAOocufQNZVNXHETh5XRbcQhtns7s5A3kpznFnTjlLMArjDP8 +lLt1OyKiSl9jXcW6rRJu0ziqS+ZreIXDV+OpgMBKhsECgcEAmO0TEnQ+Nv2JMdc/ +TpvzHneA7bXEWah3d/nY/FpedKOhDB3pS9SqHV0YDwmZ6OJfGUcspSHcxRm84ztZ +jytQToAx6WPFdczp/RSDXGPK3Jrnx0HvZOKWpJG4jgnRaBbV+iQSSN1+E2sFSQNx +6wIFH3QAorr6IZRY+JcDek8iEuUPY0wtdTP1xAPSmF+FFWty5UfynPJpA90lRF5D +LQB7Jb+eIA8q4YGG+VPDrQSHvY8prJHvJDXfBYuTPD+4Yk5XAoHAd7zMxdnf//tR +6pLr30/HZTw02Lap0JX4QNF7fAHYuX9tgxfGfK7glZgZl16h5uksLtjdVL+H2hgW +iK6XxIMP9Wn3TrOdzcjiv1BMqBY2RDlAoqQh00QoBQWGl1np9Uq76vyL15XulQaD +C1K4WxUxyuPFxjy8zYpD0HJl9YHiFlzVBBUroIDVxvIJ8dxwPplASz3SXRrE+r6V +8yWa867enyUr1MR90k5Ttwe5z/62yd3VmQNJvVSVVhwfBEygVIjH -----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore/timestamp.pub b/taf/tests/data/keystores/keystore/timestamp.pub index 705601f4e..bb09d0a5b 100644 --- a/taf/tests/data/keystores/keystore/timestamp.pub +++ b/taf/tests/data/keystores/keystore/timestamp.pub @@ -1,9 +1,11 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwv8CwlU44Y6ERLZI4OYb -OKL7YgdJzwgDHBBqVw0IOwEvPrK52YJgIUlgkX/POqb3qQnOkwQza5ZZgn2akn3g -I6Zs9ZCV0t7ZNLX955Uzoul0WfA+EFUA1VI5ujMBH8E9YOKiokCa6rFxgY+9RTrH -PuIZTySLOTN8je9E9DsdKOkXQXtUvoZlOqM8AbKcywR1CVSKAqmXNkf55txhdXg7 -NoDoK4T1w7Qxfed9Wgruch/12b5cvY6VsQKGOPZ+HbQBN5+wXopezyPBUj1k7qjn -F+i9FBjKHM62G4mQ3s1iAs7qg6xCjQP4pW3Q6gN5i0iStgmHy1FoynouVtQAc++N -/QIDAQAB +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEApJByr6DYnW+DhVH+evlo +jvday2ELWYBeHVcc0YC/Y+wBNdVXSvxUSjwjgTVmHv7kJ9cfDBZX1bafWXOKx3BM +8ouhxeDjOQ5TBZv6EBl8SKE+IcqYDhkmawceFWL2tayPZ/TPx5Rjrt6RvfmLOKWj +GCZ18RF5OBOVNb9MjltKQe0T7JKk4XMJ/M7Vi+DlwbITiSfQUoyaQDVER0ulnLVz +GZWwvAcjGG/3ZXzKxt0jbE+5fpfKtcht8JONrNP8uk3ZdJvh6aENXrVplcK3Uddw +Exoh2cUGhnJbNqtgBV0GVA0ZeqsXtf//d9Ra2qFHfCDUKcMtV5fP1O37dkY51+vV +gMC1jEkcInxdPhoB+HawjCAC5VixDvCgdhi5eSjJjkaUdLxUHCoq+n62FDPrES+B +qkjHGcNpKQEF1scrrunYU6ozlFkVPQrKOmV/tnMW9wQ0AdQe0RdSrLeuSYjLlW6q +qiU9Hjji836htF/7OEHF5GeLlZMAO3df13D1cKgFrzX7AgMBAAE= -----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/delegated_role1 b/taf/tests/data/keystores/keystore_delegations/delegated_role1 new file mode 100644 index 000000000..9ddd045cd --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/delegated_role1 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4gIBAAKCAYEAuORhNgvRwRbtldqmD0S9PmzuLP1cnoi0pe09gmAD0FOQflZy +4APsoYYPOCr6gplCP9gElhuAd+1ldzAAwgjILGWxwWhEFdjJ7r2nhtNoXAgjHRJx +4f2YjRIIpXRfDPwMW04MxZXudh9WM3zOdhcspJ93CEFF7fxkJunrpkhjVNOrTDWY +W7QUsEj2/ifxvscNL0RIbXX9967HNFULsnJ2/nfe9Y/DJdHkUDiP9bpelcIlJ2wY +n1tvTIzT2JbzRrIKLgTQyx1DdB5kSADugYdh3JaSkH28qA67zFgm9RAgMyfPkrVz +k1mKP/z6wYkbEy+vyyueXCVcwnGW+RZMlw8dDU1ZJrYPKyAvxioyOHNxxYM1to1m +9LDvAUc96dnvVurGrVxvHpaipynD1nYsMUmBJCeZgYlTi9muXh+pgXk+yDOc24jH +hrpfC7QAJKO+4qVdst2I3zCLUxifkpzqeL2557GkBI0cma6VbQYlahqLaVsMeE8T +FDp3Kz4wmvuF5uazAgMBAAECggGAEh1mHNp5mZZ6fqUmgfZ1KCmaCFRmf63bLSqa +TSzFEuMtFAO6S5J227h7w0AKvULwx7qNcHuPUbCzsULFwD0GB7uK9+0URqOv3TE9 +uar63ZF6hz2oZMDo8mFi8Xr+WRJUz5lNDQrMi0w0sOS4gb9xg0uQaQGkLVX+JgXj +La6H9OasMNJLdCinokHz2SDmwY9VDl19TyQxVtQL9meitsAaQoJSGPMV5p2y5d00 +1ZmF7NxRsZQYsXxO4kwl8WGQwkttIrtWFYC75hk/Z4kHjc1qG5NJ1F3BW5ANcwDQ +lYg8MAqbyEof2ER2DeaCTbDDJlXdgPGco8BZC+2ba0B8E51xtKosdQRJiezMYy5J +gIVn79CLjVEBGkLUxZZUwD/iBVumqFkiJyIbih7oUseJJca1aTRKmIDiZAhg2p81 +cwKqDErHHLNg3L9fXTMLOysfp35/6FGxBHqzqIgXcXyzJZ/dl/2v17ZBePmgovLg +pQ5ke8Wo7qRv3WJa0FthcUsbx+qZAoHBAP8He7m86f/NXpybBIOAIpmXm/gbrwpC +qg3rm7xeiL1tCVVXZ2MHQ41rjrgdSdP9QKrGMn07Pjc4tt1bqzLvHV18oo64fzXy +8kdoluxKSfUCNW9G85PtJrRhpAvSnoto4j9kRNDtJ4kUWPqE7mliwrcktx9OuEqE +RpqjfzCrMHzZea29sR6o87vfRX6dHTR9GwsMzQHF8bYoUHMXdstuiLyKrmXsz/Ra ++q5MwrbfraCv9OWDDgs/Qk+YNaI5E0IUNQKBwQC5mIzkIdGMCGZ7BP0OdKbXnMoJ +B65GyUcqlBxKpF3CFlIvQeUFh5GEfydfxnJGSwovdk152L6RVgGGOTO0/7Ej4Rg5 +yjBNl9aDjbWonv2Vjtxm1FQR8jBXnhokpsgS7RmTQWKMU3TPH/cNOez+VBj44lvp +w9ckW6EipnayPZuDQXE5QY5oYKy24GTDCVmIRoFMF6XPeS/KerIsysJTcZco3lMO +nWGwAe2R+G9XXq/tgHGgN9h37a7UTf9ALuOXnEcCgcAbai2FsOYipmwGP6/DhxGx +GxgcGrW9T59CMdKi9DKU0lTPhL7LaWt8l1RXPGbEUBQUh4vD5ItymjkmIIWNyyCH +/S7oUrLyFLSwsnCO5AmBOgSOer0SaMrhVyGwV6rNZ6/yio/POb8nQDW0cHfEgmZW +E69PwUGUWRXR58NzcuOaeDJZV+vjVNwmlQC+dJtAGja/AFhFWYb7QugrBxmxEqfG +RM4sjMFqDiGmfP/tcqwSevfDeEwZL2qsbbtOPf5w+wUCgcAtQcrRcoGzoPTEeNHw +bXelyiDmFM5lin1lH5rKhMwsIN9HkMz1DTrp0UvbqfuBspi4PCPmW3kU3aEfhuFZ ++KPMeP48UVZ4BVeU2sB6btKtXpnWJV6exa0OIIqFd3oAS3raEq6iQ1OPkl7fBcoJ +tp4kSqZZGZ1jy0g+t9Ln4egDGLkwWhEM2M4lBhDsEmKXvYGX+YhAUG/b8xFxpLvA +N0nB+HzOaohAsCerWaZk6r0BsDmE9Tk+/WGNebuNfiGXfc8CgcBb25p6CR73MfUi +np7aZeW/LdkvzxfQ8yms3Nhrl3mdmH1Ass9cH4sGlKAGYKwPWciE6lHycycSOVpq +sjvoZrxvUQ1Y4rV0Rs8vayLPOs4BcdJeHXKFVeevaCgRQnuMMdIIzvup6E5IJc2v +lcKn22Y/Ac3qpOcDloCHm5j17UeGzTTYMcC1p77QU+Y87f7C83m8N99R5iD6kiGN +a0KBzHlkpHClTVMxioVIGNv3dmcc7tjxJZ9jhHC59nE/HIOyrxM= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/delegated_role1.pub b/taf/tests/data/keystores/keystore_delegations/delegated_role1.pub new file mode 100644 index 000000000..898b4f135 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/delegated_role1.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAuORhNgvRwRbtldqmD0S9 +PmzuLP1cnoi0pe09gmAD0FOQflZy4APsoYYPOCr6gplCP9gElhuAd+1ldzAAwgjI +LGWxwWhEFdjJ7r2nhtNoXAgjHRJx4f2YjRIIpXRfDPwMW04MxZXudh9WM3zOdhcs +pJ93CEFF7fxkJunrpkhjVNOrTDWYW7QUsEj2/ifxvscNL0RIbXX9967HNFULsnJ2 +/nfe9Y/DJdHkUDiP9bpelcIlJ2wYn1tvTIzT2JbzRrIKLgTQyx1DdB5kSADugYdh +3JaSkH28qA67zFgm9RAgMyfPkrVzk1mKP/z6wYkbEy+vyyueXCVcwnGW+RZMlw8d +DU1ZJrYPKyAvxioyOHNxxYM1to1m9LDvAUc96dnvVurGrVxvHpaipynD1nYsMUmB +JCeZgYlTi9muXh+pgXk+yDOc24jHhrpfC7QAJKO+4qVdst2I3zCLUxifkpzqeL25 +57GkBI0cma6VbQYlahqLaVsMeE8TFDp3Kz4wmvuF5uazAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/delegated_role2 b/taf/tests/data/keystores/keystore_delegations/delegated_role2 new file mode 100644 index 000000000..a0736ce74 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/delegated_role2 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4wIBAAKCAYEAmvqUhn3+ZEswkaIjgSMdCVnw+/h6CFxpVJmIelmxWYXEhuJi +mELHWDExC2GQzziPpqo9ITTQBf5E8P76lxDkeifMUYsMCLOenMrdkdThXkv1tjSM +CyTJ7betkJw9zMdWabAfClUuRQWNgTa2pbieSYHqBXJMyWZqCR2H8mTQ+mEmln7y +lKOWjXMBBYLCtc2ElIAgXV8A4C01kq+xTsXKxzYlLRtOfH+pRvcOLDESFQ2li9Dl +czltKN5mRAJqopTBW7Ia9xOwmuNfzspJosyNKMrGHAtHf4uOB3oEoCac46QiIi81 +Pl4XR5ZLsxmp+HFHnBcIvGlfzZdgKxNK7w0409NI5Vgb/p+c3YnDnv+qQ2DnH2kN +hsvVTIB80Xw9QTvUK9dcwkj/EXleYDiZc2Nb7E/w76CunIqSRskdPL4nl3stTB09 +RYL+VZQxwMLriHxkqIm50z6MnK5hxUv6q6DvUG0rBg91CUYTDLzdQoBjKRne4Wrb +FfUljcvSaqgQrU6HAgMBAAECggGAKIIa1FSWa8yjc014DkcJTepubM3zx7+v4GcJ +H0HWc1ndlowRzU6XIFwrP5hO63sTQTL6K3XMceSWTI+5HEdUEQHaC+5WROf+K2lz +JK0KA0XDgc6WVEtXZIVAHq5YEPCBi7p3QpIlN/FNnVqZvxNUfE4yxx2rKHFWge9w +G1Fyth8yoN+ptGRV8779o10cW7zOTKp4yy8L4YyvlhnKNJbKe+uRKAsdJrmPm3b0 +A2UIHuykOrltYALAn5ASFvCywrAyufS8BYDe195u0QR4GypaFWJvgQonLXW65IVM +4tJes1z0exZ0cTUpJ+BBiK77ILeZTKBFmjd9Br+PwoiU2ICu++3no3yE6Fk/YnSk +yyj8jKnKadNgCMwHPuR3A5rIWsEixmHul68d8CTTRpzMBpoZm7ngNiW5aI7sAF87 +rT8ieCW8tlvcZlwvV928ejemGXn0JVH1UwpzkwAor1jtA++hb1k63/gmkKgFVloN +j7ScNQ8hLbL0Op9ukHVgiXqABMQxAoHBANAiMu6/jbE2HFvJsLJ9q/tT2fEA9RRR +RbSOqh/mJzrvLsRQUtsdxXhtkMJO38UUynrtMeDem6n9wNjVCJD6rGc6Xbs/R2Ua +EbDFPr4BzaPn6hD+0RDD/rxNSLLA36VhaFhAe+IFb900IfgHsuQoL8gejET+LUZk ++RtzBZqI1z08EoFfh7FYmvlnN9CeRJ5xM7NtzI0OXOg9eCQEFKj861xIreAbXuJV +mzjl6TbeZVXGBvnYNjTrQLNudzpy5748/QKBwQC+nuk5e51bebHO1Q/nGG7Tbk0b +NEhxEoZXCollJ0zVoqGHnJjs5XswqoR3+Qf0u5h5haAQR60uQv8GUeAyDYjrA871 +T33g5PvFgB05+YhAVKCV0NFOXesGBvBzOztVO6Cl0ZDmCW5HB4YP5ceiHoFyijl5 ++e/7TxsbkPkcFXTT86bZy+zXI2YE+R0Wm8kAOHqVyo8jdeDlQQFPPbsTo064to2w +Wr9fPdnbrgGtsFbuB0OVIwJoh+shnwH05Gg4UtMCgcEAxmsz/yOiYwTg+ChJSYBB +SrJfnUB6ZEoul7lCOnLhh2+qOAETXEz/ipV5YaRr86ikd5hU6rmN0PtWs+Az8HLp +lOexn+btm1bE8q6359A0SUO4g0dJ7B/NY5qR6cex7in0nd2rvIfOYyVmFNzSEGy3 +UKK+uq9OXkO4sBBxkSdPetMgGTIHXGzKIWXjcgDQDfSBg1bzoK3GqKihNkSlpYyo +nCu1h2bQiBlwh0e3k1VlaeYFlH4o/z4fSm/PPmt4voXJAoHAfAXImK3k4+950Kiv +gBxVfxr08A5EU81JurgQTNAVHaqCjklE9l0YmcFYDvboRkMIIYjfa7g25TKR2vrK +c8Z6nu4LaXAe5oQVi5qfaWkBTVnCYbdLd0GD+JfrOg3/vKTfEQQY0pKwPWaXwyAt +kz1l27AzVTlY+pmteXIJokwThxOwK2SS5CcT6YhrdJpHXO1iVLNGDjxT5tU0lOoF +HfHS9jtQVL22ZbFIXbYJQYjKBnSTdCUjG//S7D0YeM1jQcIhAoHANMhqZrkucALp +YEVxLG/vnrZoz0uc4Zpulsr3lXH0dOxOzAmhE4k1UBUImygIf7FNZeX23yMxi0VL +16EA89scd/R2b5OZ6G22uMNRbvtqOdWLKpLs1rQUnOaOP89vCCKVt/tQxu8++FWA +z98RFISRLmllcMa3jKIDxXuts/UI7dLChXuYNLjjvb2LY1/yYz6v9NinYpINq1AI +DWe9lCaBYzpCQX/1TtkHfQYBH6S/will9kTGcZXt5DP9qy4XBIfp +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/delegated_role2.pub b/taf/tests/data/keystores/keystore_delegations/delegated_role2.pub new file mode 100644 index 000000000..9574e51b3 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/delegated_role2.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAmvqUhn3+ZEswkaIjgSMd +CVnw+/h6CFxpVJmIelmxWYXEhuJimELHWDExC2GQzziPpqo9ITTQBf5E8P76lxDk +eifMUYsMCLOenMrdkdThXkv1tjSMCyTJ7betkJw9zMdWabAfClUuRQWNgTa2pbie +SYHqBXJMyWZqCR2H8mTQ+mEmln7ylKOWjXMBBYLCtc2ElIAgXV8A4C01kq+xTsXK +xzYlLRtOfH+pRvcOLDESFQ2li9DlczltKN5mRAJqopTBW7Ia9xOwmuNfzspJosyN +KMrGHAtHf4uOB3oEoCac46QiIi81Pl4XR5ZLsxmp+HFHnBcIvGlfzZdgKxNK7w04 +09NI5Vgb/p+c3YnDnv+qQ2DnH2kNhsvVTIB80Xw9QTvUK9dcwkj/EXleYDiZc2Nb +7E/w76CunIqSRskdPL4nl3stTB09RYL+VZQxwMLriHxkqIm50z6MnK5hxUv6q6Dv +UG0rBg91CUYTDLzdQoBjKRne4WrbFfUljcvSaqgQrU6HAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/inner_role b/taf/tests/data/keystores/keystore_delegations/inner_role new file mode 100644 index 000000000..3718173ce --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/inner_role @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG5AIBAAKCAYEA22LRjr+do6KCffjKXxoei7bdeJEnswRW6rZSl4Hgh4jxe7Co +iCVHE/8fVepAdje2HmY7hgLHvp5M8o/dwbiv8MPuRSXprZFKcNV5+L/g29j/UeI4 +JNfsK/wpkz6DodL7sLBIIZmFLSnRdN62537ZONEnsexf9PNgfchLkTQf9OKArb9g +N61T6MbZh51qlpwxDSLw2+lA0LEnP7cWpV4lZPNhiCWsjIUjQ7xIHmLQI3LlshTk +mRMGOKsy6m5z/Qe5vFTaFNV1a//cZSZVSpV8BqUcJuQRrSbTsZC0m/XOBn52vBXP +Uzv+IHQtuwVi15G6LsJr/bxPAICBQ3OuYk0zXUoKfMBrBgZH/+XKz4jJSqRRixNB +iIYq44NtzgurOLyEvRnsob+IZ+brs032E+HRGfQin/etzEw10XvzIuSGuXQhKNu0 +4M3p1JA6xZ7rHXCdacla5ApXMI+eMzwZO5+tgqEWnzUjcvgMfmv4GeFpTOWBP4th +atZHpd143p/1n13JAgMBAAECggGAN/7bfQN0gXkvtGaFhMueY0vL8IOgLeWcJ7Fc +mFYqkH2IIWmAQqu9HiH+hgfR5zqmDdFLPRPFluZBvqGw2MrCgYII9XZNVCNi7DTY +uoCDLKoQ1P4YFXNVUQ6+L9qDb5Dx8/Gyn3zXTKVBVIKqDaFHYWSlLJkoDtX12XT/ +sLKsu2z6qh5QOTXQ1ne2uxIXTBTWwkMaVg8Nn5av7WfWbGQAyGkEimMPTRiIXTgX +8kWHWZzweskxZc7AxkMQLlz91uYa7a/fVKjzVMuwq6AqJcSB/383MtwtYVyiCrOm +6opG9DAVqXifiEHAbTjPJd+x6IqTHWHF7gnf0hj4OQatJb0k6tUBb+G/tm99JUgO +hcNEdQ10TIpWR4YuioopMtc4FYWTxWvGCO+KxoacjInO/6BRLJAx3k+XEQye3/Gh +XSyH3eMJeZAkyTjSBxOKTvOtR7NiUQ2xbJ2PpUO8tGgm6KptCIOpyXQuI2ERLRNN +C0nuIOtpvPHXeJlkMgWNvABXeJEXAoHBAPKKOBUfne01668OoAeaE6fbG1E18jH3 +3b/eV2Qd7yOez/UlMXzBqL8ReTukyTTCOBAd0DCmPycZM3Doxe87LIbfpkZiK/fb +44WKOT3Mi6+VLGOgmDp0S4M7wCThBj175Al6q268WQe0hFJ/F28rVATnOs8pHCZK +190eoYGXPezi7jVNX/oPej/VxmjvjwxhsKfDbeBq9GafJJhSAapcSwXFSmteH6BI +nAGXWVamxqMDz3evB+Fp8pzjRH6BPT4aNwKBwQDnj6Z/bzKwWdh64ieZlAJExM30 +dWzT5Mh0gYLykuEym4zjqVJ5coKimb2hn21NzdKLKpdxO9Wtuo25lUYeqeMmDzxi +lDcEkRrgT47ROk4dLSLIM1PywCe1LTa/Y7MOvWPn7lL+qdgKqe2R+Y1o9+LhKepi +/CtkR2J16/DrJ1RY6k87Xmyh6XG/gpDKI/NfdXpEwjSSU4bk2n24QTDUZ67fIZCL +kFDotmTwPz/7klZIbo8ajDve4jM8uXjIvOlyR/8CgcAji9heWCzoKB/rnyQbGRzK +XBVr2JEve5lXVnnOZYi32r21uwa+tw9JOYFgGW2XuuNGkWgCyUq2Kz5bzPG9dxm2 +hq6y4A57nBGDb9el1AWg7Sb9TvsgjgzHJgmqHgSxHCg2r3DSoO4XcAB4qsG/fEUr +FsyKsga7IfrzIFshSA4+Wp/41ec8Geqb0nPqyzlW4jZm0ACZhHNfWvGdFV/DHRWt +udWHWNsfvaSHoyvnxDeWiqdsbg2knsd88N4IAF7+bA8CgcEAxQULY+fn1/ZJ45wi +l2BAYeSVW8bBVrSU/dPn556jLxz8TgQWITEWB2UJ3Mc6B/X0iuYtPnHrh8pvpZRl +uddQZmSWO0XiXedcV7g5SrnyFo79xhst9SAbaOLUbxlUE1l+9KppQTafk8srUIVl +FQe8qVmxjJEEFmlKVAzwyhOHh7OswFXB1i060/gyW1slSnY5FuGqO0oIPxXL3AbT +lhW1yzHSu3yJ6satsWAPf2vuL+ipp6vjkOsjLyqboyhg9BRfAoHBAK5zwEGORK/1 +9okD/dPXgEEx1k+5kZOuZAqkSDfo4VxUApas81iI0vRU4AKBirDvAdej+mvW9n95 +dVIy68JOrFIdhbL+RGTUjsM/3jVjWAH/MMiv2asvavcKXew63A4ST3EQCPXr9B4a ++jLsvJR9UuPdx2b6e23GRSpQmJKM+DoZFeTso+pGOlbHc0LpQrWeSaMTVINByr95 +ex+A0cJChmpWTiZN9P63vV/8RiAvzFbjeGtMGl36iGRXsMekyT3gTg== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/inner_role.pub b/taf/tests/data/keystores/keystore_delegations/inner_role.pub new file mode 100644 index 000000000..48dfeb183 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/inner_role.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA22LRjr+do6KCffjKXxoe +i7bdeJEnswRW6rZSl4Hgh4jxe7CoiCVHE/8fVepAdje2HmY7hgLHvp5M8o/dwbiv +8MPuRSXprZFKcNV5+L/g29j/UeI4JNfsK/wpkz6DodL7sLBIIZmFLSnRdN62537Z +ONEnsexf9PNgfchLkTQf9OKArb9gN61T6MbZh51qlpwxDSLw2+lA0LEnP7cWpV4l +ZPNhiCWsjIUjQ7xIHmLQI3LlshTkmRMGOKsy6m5z/Qe5vFTaFNV1a//cZSZVSpV8 +BqUcJuQRrSbTsZC0m/XOBn52vBXPUzv+IHQtuwVi15G6LsJr/bxPAICBQ3OuYk0z +XUoKfMBrBgZH/+XKz4jJSqRRixNBiIYq44NtzgurOLyEvRnsob+IZ+brs032E+HR +GfQin/etzEw10XvzIuSGuXQhKNu04M3p1JA6xZ7rHXCdacla5ApXMI+eMzwZO5+t +gqEWnzUjcvgMfmv4GeFpTOWBP4thatZHpd143p/1n13JAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/new_role1 b/taf/tests/data/keystores/keystore_delegations/new_role1 new file mode 100644 index 000000000..9ddd045cd --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/new_role1 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4gIBAAKCAYEAuORhNgvRwRbtldqmD0S9PmzuLP1cnoi0pe09gmAD0FOQflZy +4APsoYYPOCr6gplCP9gElhuAd+1ldzAAwgjILGWxwWhEFdjJ7r2nhtNoXAgjHRJx +4f2YjRIIpXRfDPwMW04MxZXudh9WM3zOdhcspJ93CEFF7fxkJunrpkhjVNOrTDWY +W7QUsEj2/ifxvscNL0RIbXX9967HNFULsnJ2/nfe9Y/DJdHkUDiP9bpelcIlJ2wY +n1tvTIzT2JbzRrIKLgTQyx1DdB5kSADugYdh3JaSkH28qA67zFgm9RAgMyfPkrVz +k1mKP/z6wYkbEy+vyyueXCVcwnGW+RZMlw8dDU1ZJrYPKyAvxioyOHNxxYM1to1m +9LDvAUc96dnvVurGrVxvHpaipynD1nYsMUmBJCeZgYlTi9muXh+pgXk+yDOc24jH +hrpfC7QAJKO+4qVdst2I3zCLUxifkpzqeL2557GkBI0cma6VbQYlahqLaVsMeE8T +FDp3Kz4wmvuF5uazAgMBAAECggGAEh1mHNp5mZZ6fqUmgfZ1KCmaCFRmf63bLSqa +TSzFEuMtFAO6S5J227h7w0AKvULwx7qNcHuPUbCzsULFwD0GB7uK9+0URqOv3TE9 +uar63ZF6hz2oZMDo8mFi8Xr+WRJUz5lNDQrMi0w0sOS4gb9xg0uQaQGkLVX+JgXj +La6H9OasMNJLdCinokHz2SDmwY9VDl19TyQxVtQL9meitsAaQoJSGPMV5p2y5d00 +1ZmF7NxRsZQYsXxO4kwl8WGQwkttIrtWFYC75hk/Z4kHjc1qG5NJ1F3BW5ANcwDQ +lYg8MAqbyEof2ER2DeaCTbDDJlXdgPGco8BZC+2ba0B8E51xtKosdQRJiezMYy5J +gIVn79CLjVEBGkLUxZZUwD/iBVumqFkiJyIbih7oUseJJca1aTRKmIDiZAhg2p81 +cwKqDErHHLNg3L9fXTMLOysfp35/6FGxBHqzqIgXcXyzJZ/dl/2v17ZBePmgovLg +pQ5ke8Wo7qRv3WJa0FthcUsbx+qZAoHBAP8He7m86f/NXpybBIOAIpmXm/gbrwpC +qg3rm7xeiL1tCVVXZ2MHQ41rjrgdSdP9QKrGMn07Pjc4tt1bqzLvHV18oo64fzXy +8kdoluxKSfUCNW9G85PtJrRhpAvSnoto4j9kRNDtJ4kUWPqE7mliwrcktx9OuEqE +RpqjfzCrMHzZea29sR6o87vfRX6dHTR9GwsMzQHF8bYoUHMXdstuiLyKrmXsz/Ra ++q5MwrbfraCv9OWDDgs/Qk+YNaI5E0IUNQKBwQC5mIzkIdGMCGZ7BP0OdKbXnMoJ +B65GyUcqlBxKpF3CFlIvQeUFh5GEfydfxnJGSwovdk152L6RVgGGOTO0/7Ej4Rg5 +yjBNl9aDjbWonv2Vjtxm1FQR8jBXnhokpsgS7RmTQWKMU3TPH/cNOez+VBj44lvp +w9ckW6EipnayPZuDQXE5QY5oYKy24GTDCVmIRoFMF6XPeS/KerIsysJTcZco3lMO +nWGwAe2R+G9XXq/tgHGgN9h37a7UTf9ALuOXnEcCgcAbai2FsOYipmwGP6/DhxGx +GxgcGrW9T59CMdKi9DKU0lTPhL7LaWt8l1RXPGbEUBQUh4vD5ItymjkmIIWNyyCH +/S7oUrLyFLSwsnCO5AmBOgSOer0SaMrhVyGwV6rNZ6/yio/POb8nQDW0cHfEgmZW +E69PwUGUWRXR58NzcuOaeDJZV+vjVNwmlQC+dJtAGja/AFhFWYb7QugrBxmxEqfG +RM4sjMFqDiGmfP/tcqwSevfDeEwZL2qsbbtOPf5w+wUCgcAtQcrRcoGzoPTEeNHw +bXelyiDmFM5lin1lH5rKhMwsIN9HkMz1DTrp0UvbqfuBspi4PCPmW3kU3aEfhuFZ ++KPMeP48UVZ4BVeU2sB6btKtXpnWJV6exa0OIIqFd3oAS3raEq6iQ1OPkl7fBcoJ +tp4kSqZZGZ1jy0g+t9Ln4egDGLkwWhEM2M4lBhDsEmKXvYGX+YhAUG/b8xFxpLvA +N0nB+HzOaohAsCerWaZk6r0BsDmE9Tk+/WGNebuNfiGXfc8CgcBb25p6CR73MfUi +np7aZeW/LdkvzxfQ8yms3Nhrl3mdmH1Ass9cH4sGlKAGYKwPWciE6lHycycSOVpq +sjvoZrxvUQ1Y4rV0Rs8vayLPOs4BcdJeHXKFVeevaCgRQnuMMdIIzvup6E5IJc2v +lcKn22Y/Ac3qpOcDloCHm5j17UeGzTTYMcC1p77QU+Y87f7C83m8N99R5iD6kiGN +a0KBzHlkpHClTVMxioVIGNv3dmcc7tjxJZ9jhHC59nE/HIOyrxM= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/new_role1.pub b/taf/tests/data/keystores/keystore_delegations/new_role1.pub new file mode 100644 index 000000000..898b4f135 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/new_role1.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAuORhNgvRwRbtldqmD0S9 +PmzuLP1cnoi0pe09gmAD0FOQflZy4APsoYYPOCr6gplCP9gElhuAd+1ldzAAwgjI +LGWxwWhEFdjJ7r2nhtNoXAgjHRJx4f2YjRIIpXRfDPwMW04MxZXudh9WM3zOdhcs +pJ93CEFF7fxkJunrpkhjVNOrTDWYW7QUsEj2/ifxvscNL0RIbXX9967HNFULsnJ2 +/nfe9Y/DJdHkUDiP9bpelcIlJ2wYn1tvTIzT2JbzRrIKLgTQyx1DdB5kSADugYdh +3JaSkH28qA67zFgm9RAgMyfPkrVzk1mKP/z6wYkbEy+vyyueXCVcwnGW+RZMlw8d +DU1ZJrYPKyAvxioyOHNxxYM1to1m9LDvAUc96dnvVurGrVxvHpaipynD1nYsMUmB +JCeZgYlTi9muXh+pgXk+yDOc24jHhrpfC7QAJKO+4qVdst2I3zCLUxifkpzqeL25 +57GkBI0cma6VbQYlahqLaVsMeE8TFDp3Kz4wmvuF5uazAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/new_role2 b/taf/tests/data/keystores/keystore_delegations/new_role2 new file mode 100644 index 000000000..a0736ce74 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/new_role2 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4wIBAAKCAYEAmvqUhn3+ZEswkaIjgSMdCVnw+/h6CFxpVJmIelmxWYXEhuJi +mELHWDExC2GQzziPpqo9ITTQBf5E8P76lxDkeifMUYsMCLOenMrdkdThXkv1tjSM +CyTJ7betkJw9zMdWabAfClUuRQWNgTa2pbieSYHqBXJMyWZqCR2H8mTQ+mEmln7y +lKOWjXMBBYLCtc2ElIAgXV8A4C01kq+xTsXKxzYlLRtOfH+pRvcOLDESFQ2li9Dl +czltKN5mRAJqopTBW7Ia9xOwmuNfzspJosyNKMrGHAtHf4uOB3oEoCac46QiIi81 +Pl4XR5ZLsxmp+HFHnBcIvGlfzZdgKxNK7w0409NI5Vgb/p+c3YnDnv+qQ2DnH2kN +hsvVTIB80Xw9QTvUK9dcwkj/EXleYDiZc2Nb7E/w76CunIqSRskdPL4nl3stTB09 +RYL+VZQxwMLriHxkqIm50z6MnK5hxUv6q6DvUG0rBg91CUYTDLzdQoBjKRne4Wrb +FfUljcvSaqgQrU6HAgMBAAECggGAKIIa1FSWa8yjc014DkcJTepubM3zx7+v4GcJ +H0HWc1ndlowRzU6XIFwrP5hO63sTQTL6K3XMceSWTI+5HEdUEQHaC+5WROf+K2lz +JK0KA0XDgc6WVEtXZIVAHq5YEPCBi7p3QpIlN/FNnVqZvxNUfE4yxx2rKHFWge9w +G1Fyth8yoN+ptGRV8779o10cW7zOTKp4yy8L4YyvlhnKNJbKe+uRKAsdJrmPm3b0 +A2UIHuykOrltYALAn5ASFvCywrAyufS8BYDe195u0QR4GypaFWJvgQonLXW65IVM +4tJes1z0exZ0cTUpJ+BBiK77ILeZTKBFmjd9Br+PwoiU2ICu++3no3yE6Fk/YnSk +yyj8jKnKadNgCMwHPuR3A5rIWsEixmHul68d8CTTRpzMBpoZm7ngNiW5aI7sAF87 +rT8ieCW8tlvcZlwvV928ejemGXn0JVH1UwpzkwAor1jtA++hb1k63/gmkKgFVloN +j7ScNQ8hLbL0Op9ukHVgiXqABMQxAoHBANAiMu6/jbE2HFvJsLJ9q/tT2fEA9RRR +RbSOqh/mJzrvLsRQUtsdxXhtkMJO38UUynrtMeDem6n9wNjVCJD6rGc6Xbs/R2Ua +EbDFPr4BzaPn6hD+0RDD/rxNSLLA36VhaFhAe+IFb900IfgHsuQoL8gejET+LUZk ++RtzBZqI1z08EoFfh7FYmvlnN9CeRJ5xM7NtzI0OXOg9eCQEFKj861xIreAbXuJV +mzjl6TbeZVXGBvnYNjTrQLNudzpy5748/QKBwQC+nuk5e51bebHO1Q/nGG7Tbk0b +NEhxEoZXCollJ0zVoqGHnJjs5XswqoR3+Qf0u5h5haAQR60uQv8GUeAyDYjrA871 +T33g5PvFgB05+YhAVKCV0NFOXesGBvBzOztVO6Cl0ZDmCW5HB4YP5ceiHoFyijl5 ++e/7TxsbkPkcFXTT86bZy+zXI2YE+R0Wm8kAOHqVyo8jdeDlQQFPPbsTo064to2w +Wr9fPdnbrgGtsFbuB0OVIwJoh+shnwH05Gg4UtMCgcEAxmsz/yOiYwTg+ChJSYBB +SrJfnUB6ZEoul7lCOnLhh2+qOAETXEz/ipV5YaRr86ikd5hU6rmN0PtWs+Az8HLp +lOexn+btm1bE8q6359A0SUO4g0dJ7B/NY5qR6cex7in0nd2rvIfOYyVmFNzSEGy3 +UKK+uq9OXkO4sBBxkSdPetMgGTIHXGzKIWXjcgDQDfSBg1bzoK3GqKihNkSlpYyo +nCu1h2bQiBlwh0e3k1VlaeYFlH4o/z4fSm/PPmt4voXJAoHAfAXImK3k4+950Kiv +gBxVfxr08A5EU81JurgQTNAVHaqCjklE9l0YmcFYDvboRkMIIYjfa7g25TKR2vrK +c8Z6nu4LaXAe5oQVi5qfaWkBTVnCYbdLd0GD+JfrOg3/vKTfEQQY0pKwPWaXwyAt +kz1l27AzVTlY+pmteXIJokwThxOwK2SS5CcT6YhrdJpHXO1iVLNGDjxT5tU0lOoF +HfHS9jtQVL22ZbFIXbYJQYjKBnSTdCUjG//S7D0YeM1jQcIhAoHANMhqZrkucALp +YEVxLG/vnrZoz0uc4Zpulsr3lXH0dOxOzAmhE4k1UBUImygIf7FNZeX23yMxi0VL +16EA89scd/R2b5OZ6G22uMNRbvtqOdWLKpLs1rQUnOaOP89vCCKVt/tQxu8++FWA +z98RFISRLmllcMa3jKIDxXuts/UI7dLChXuYNLjjvb2LY1/yYz6v9NinYpINq1AI +DWe9lCaBYzpCQX/1TtkHfQYBH6S/will9kTGcZXt5DP9qy4XBIfp +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/new_role2.pub b/taf/tests/data/keystores/keystore_delegations/new_role2.pub new file mode 100644 index 000000000..9574e51b3 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/new_role2.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAmvqUhn3+ZEswkaIjgSMd +CVnw+/h6CFxpVJmIelmxWYXEhuJimELHWDExC2GQzziPpqo9ITTQBf5E8P76lxDk +eifMUYsMCLOenMrdkdThXkv1tjSMCyTJ7betkJw9zMdWabAfClUuRQWNgTa2pbie +SYHqBXJMyWZqCR2H8mTQ+mEmln7ylKOWjXMBBYLCtc2ElIAgXV8A4C01kq+xTsXK +xzYlLRtOfH+pRvcOLDESFQ2li9DlczltKN5mRAJqopTBW7Ia9xOwmuNfzspJosyN +KMrGHAtHf4uOB3oEoCac46QiIi81Pl4XR5ZLsxmp+HFHnBcIvGlfzZdgKxNK7w04 +09NI5Vgb/p+c3YnDnv+qQ2DnH2kNhsvVTIB80Xw9QTvUK9dcwkj/EXleYDiZc2Nb +7E/w76CunIqSRskdPL4nl3stTB09RYL+VZQxwMLriHxkqIm50z6MnK5hxUv6q6Dv +UG0rBg91CUYTDLzdQoBjKRne4WrbFfUljcvSaqgQrU6HAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/root1 b/taf/tests/data/keystores/keystore_delegations/root1 new file mode 100644 index 000000000..42f5ed050 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/root1 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4wIBAAKCAYEAzzUxClg6ts0wp7d5szzdHYlAPmPR4Zm/YMkVSg7mhyzgJdoG +wqAIZMcthcEQLgfyQb2Mk7NfOCaK1p53/VpGh0Yk5xu0kZgid37jc9zyobAIWajp +cRz1c1+C2TzgYweBXcvtyp8e4AlzC9zCaIhqdod2aOewKJTTWgYTfosaPZeixIFx +57tfzFy+wluGADYQH/R8iknV4vIZXcVErRkZFvbnzp7ffErbjEdsvdu8iDM51kvE +9NUZBJnn6v0hFWhOkdj4wGOO6IwRV7WcUbSdGSTX/B5+52Oin8lv1NzXJYs+WgFz +Fdxn/y+7AxoGKegL+e1NFvnODp2zN72AkVhhjA82NY9OnT275ydJZfR57qM16hOl +35UAnU/o1cF/xDtMFPzY0BxXADovX1N5DQ6c7whdhBkE9sSYdTGXCJJgL8yscrRE +BV9r/NJshvzo7ZZTEWT2cM23RvdZPwWJxwC+un4LOTvuVlXSau/oHs/8+Y4A4aIM +5rVeHNXpRBkBDdvDAgMBAAECggGAG2InMfvI/qGNXYzUy4gunJmn4NbmRM9ByHOq +mZfwhUq78KSoog3uLgtYi8Wg8sRgEqoPKvHYkp4dWRGmP9gvW+88L0KtEVSusWYW +fxhjBFU0NU0qVKWEFpQ3wafW659xTEkICvAOb4MwLhAlrRTiJPnv/xsnX6WTbOFC +sEWH2T3x59BHkl1j4qkbGKppwhti9CYmU0xAtPZTvd21Hr8jXrKQnfDHDjECZL6H +s2uXtdQ3P4fR5p1G6iHA0YBUX/ThuFdgi17JLexiErBQL4+gowEl+dMqHUsiyyAC +elbPiq7yPh9qiAmiOhkNI4+BvoxZGSU7NydRYIMMs1vtIT2QoNJECbgy7PKc0KzS +ETmpH3oNe8GpuQOCv5HffqsrWjxI+qCzBtXajC4v+f4AMBzpyF4CikpM+sXz303I +Ci+rVidb+lttp9ZzHyPFhQ9/fq38P0otjCMVvuUgJ8gwoVPDF3ZCslHMdyMN0Rb9 +tj29MQaPEGGaZGITljd923QI2RbhAoHBAPIEoATDF1FQMKmM1byAE5ieDwZ8NDeD +g+MJ/gNb3Sg1CCW7dPZjeTBa1l5yxVMuEqmv6JF14nTLdntZRukJTCoE4n/K46m7 +T4m4pv33HvSiL5JcHtcB4vNqBPvuQ08IDv0awT1FNpLrvrr4FMB1FWrqy4gEj+fV +41iegazeKbyZgj/HyhrJzj7p3SocgI7Yj2KN2sKdegH+MbXQ8jVkOSTFtQHdhiQF +iWbvRuFN4ZujlNKwQ9yqOPcKA3DVJ00hMQKBwQDbLbuU5XflGh9t6zXms5mmx9ee +92PyBLXFFsUhp+/s42HFNJBU95SETuaTbn5JrIkY9P62kMMkKyucIBwQr73KtSVG +chSMqXnk2N9pgVITXAE8GwjNPstm5tV/1OQJ22L1mwudz0/lUaCrCajAbwdBrPzE +olsxbassMPiR5FjNJzg3usoKJierrKgMa3XujiYhv5W+qbmtwmlz2sD2xrA66HtS +31gtmTw2firp4DxUq+ecmGE0AHIyNVuVyb0MbzMCgcBEPXedQCEgBVtjQ1m05+we +mVqlOnpCuOuEJfogmlN2ldVxRjUJkCzIrKRLR1NKS/BpNjd+ZF3xDrmeuCKdbMi0 +BGKVI/Ejl7Qqog08COUKl3yQaTcs6tRCTD+RhbIm45/OUC/yhcSIkr5Z27+GML1U +Q1YWSSsGdLHA+BiaVJ4yFpq6PyxGd2aXKLv6tsStAnUTlen7/Ak97J25pWvWECdo +rfKGzx6Wo5UFmCxFNP+LMgmxio/n9XtQdNtZglCtl9ECgcAwo+WNFZ+V6EYxTpGX +sSPYL2FalexIOWNdacA1x98m4w8/hHrDYG5FLn1dGphMIU4Li9M7EMU9sZbr/vQ7 +f8TOx4SOLaMB1FqIvthVwa1FPpXHkPhTFCxvmaqnw8cXqOg9OTtKukcwzPyq+GnK +ytkBajJuMNmsDnp+RB/lwJc0cA+5zmon9m+3WYmxt+dkGYe81ZeVyHS8avicDV/l +ZBKYAB/eNFKNTARg038SiADbiYrM5cQslizBl7XLeAnMSKECgcEAnZbAbyFW9zeW +tLARpZvQI5GGyc7I7KjhIaSI6kyXUYXIKiWfz+xf4asb7uUoF1s5g4ccrR/LrXaI +zB2sOweykNj7vwNIafNALWB6+DtCFaiX6HUKQHQsxI1q65rrf5iY5sbNKp9eEn+M +oEu0puTFv1BHXEmOjzwjFpXteVDIXI/CIduNTbh0oB/8Z1GkMvcfGDpeOzUvfbfw +WsCnTzpGqDEtnVRiMJXrSO9whiUqLSsNfaEbGSqAocM44cqPDDlD +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/root1.pub b/taf/tests/data/keystores/keystore_delegations/root1.pub new file mode 100644 index 000000000..3f3244cbc --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/root1.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAzzUxClg6ts0wp7d5szzd +HYlAPmPR4Zm/YMkVSg7mhyzgJdoGwqAIZMcthcEQLgfyQb2Mk7NfOCaK1p53/VpG +h0Yk5xu0kZgid37jc9zyobAIWajpcRz1c1+C2TzgYweBXcvtyp8e4AlzC9zCaIhq +dod2aOewKJTTWgYTfosaPZeixIFx57tfzFy+wluGADYQH/R8iknV4vIZXcVErRkZ +Fvbnzp7ffErbjEdsvdu8iDM51kvE9NUZBJnn6v0hFWhOkdj4wGOO6IwRV7WcUbSd +GSTX/B5+52Oin8lv1NzXJYs+WgFzFdxn/y+7AxoGKegL+e1NFvnODp2zN72AkVhh +jA82NY9OnT275ydJZfR57qM16hOl35UAnU/o1cF/xDtMFPzY0BxXADovX1N5DQ6c +7whdhBkE9sSYdTGXCJJgL8yscrREBV9r/NJshvzo7ZZTEWT2cM23RvdZPwWJxwC+ +un4LOTvuVlXSau/oHs/8+Y4A4aIM5rVeHNXpRBkBDdvDAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/root2 b/taf/tests/data/keystores/keystore_delegations/root2 new file mode 100644 index 000000000..ff6962992 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/root2 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4wIBAAKCAYEAvgyaLSYL6WDJGi3mDYMjDUNJTZ66aY4U1OMmdJWhRrFRILMz ++tmKNpUVyVo1CwSBgME2AWHQwWVWt6CdY7zCKjeGRwECH5w6pJ5ZMOoNIEP+Q0of +UU5mANZQOCdUmqnOEQLIuM+uTyh0nUbb6OIi8Ff0pexWxNZut8iYUNxpfCkQyRCy +b7O89ZKs/69umZO3LqK8pPlDkwy2TIgBXEnNXmfjkCx6F9RNISdJkn4rjeNj+xsc +CGOvj4CF01jxKH18Tn67HaS1VU5Lufe6atcMAsUx9GgEIKi6vQCVPlyeIzhQZ8fx +wx8bq593J37Csq6GaEhn5VpEHfgQbtiusZXLsP/vFTltQ0+iSPOL3mALNn9rBV8k +mAfL9m1G6t3PUXmsS1A/5OHhlX1xXW4yJaz2KgWoOzpU0YvlauozRsIvOVa2/IIu +kvGQw/xRpWJpJdfn7boUtVewhldNH4ZK1083IPc+4Npa3JSNsf4ZHisKGbQAFKXQ +RMDE2oIRU4wA2jaBAgMBAAECggGAVzHoAOPuXiaSTekWHkf26oxfEvZK98gA5cXM +LHxEUO9k1fhyVlq9z5oqM0YohQQNuLms4ghzY2/vz/MokwyVFxJ/kI81XrRqsYGX +UVppKE8Z1tyorsCmCydJCeJ9rjJPQb3Bww1CH75jdo9+sQQj3Jq2O/RJwSjTBo5J +1/uwiA89TMrU22wfO5qOtgbS2zKLPqHapGRa7RpNf6J84U9ZIsHOhiTp5Yn500a3 +ujcaG5DjG+ANxgmakF/6xoONrbKYbS5I9qr495Cniyx01e6h4T+XUZSUaLcnd0ky +XmGLYRWr5Am4kcWxjUJSdE95J0w7z0yoq+L+vky5vEN5KV0t8zPR92TUb0f+K2AK +ElGPzHFNkzFTH5Bysjx5EeYcaYuyRwRhsZIFVKPG94tYCyyu05wPObb6tqv501cL +Psl2rvsiEnn6MhhFQnpjythU7Xbbbk7y5zkZoKTFGUFu87UDSd5fOaX1hItDjogs +CZICy+YRFtwaWU1a/XlTyBC/oBtzAoHBAPCclydgeNzfqQHuK/WGGSZR6QJmcKaR +tMdembCLK/RI9jqE5jTYa4MnHr3ZDeEIqtJQWrzu8CnAh6XPiHGjo4y7VNrmje7L +kjtP5/9g6eZ6rA8iRT4+Zs6IKxMaEcV7NOd/mQQMc196JqQpFk0v1hx8XfnWu0eN +wHI2lDJ7yM17DFyNFWLWKICL+1VNO0QqFihHcLvip0FkvBO/i4pieg0C4WLzQ/WI +WUagBAHRplb6egHdCaLW7BFa/n7V5wlElwKBwQDKNC3bA51XWJ0PAbpV54tE9FES +BO4+ykXzT7LkON3H5BE6XSOptKWEIKM+kmWpt/ugqI2cYZ3i2Dd7YgxBBjeVJsFs +iUCIRb7lTYkKbvAVz/w1+lebLVMidi7SRp8xiHCUy0t6Tr3XDnYRyDEyxtR4+V01 +kwS8diS9KkQa/Z10ohlvvRI9bnyx1TumSgKGuyyiZ9js1dYQj/pXY1H8M1k9pDbw +028IuNPNHRL0ZJ/51heaG1IRz1CmacpevQIcSKcCgcATIbBXHjGeBl6u25w9MoNv +a5XmbfTJGc7RB3Ga+wXsr5x8fLK9QvQRgpvMJqUW3pSOknsUiL8p4rgmdAD6YDOR +7hdKLIjekus2shzVToRqohhqP6RX1ahhBay/IRSGqkxDl/63trG5xsGpzeaLDqGs +tCrYwb00bE4ABtzzwqntxLnv5fvsVvDzf63lU3XB7sLCQyPwnI4GAhd+Tn2u7DOe +Mztunb8ql8PZfMG0z1G1msb2vPeWLhapLp4LwcBUGVMCgcEApH0YBH+HQmPquCd+ +rp1CVSCuxorOSLQBfXILI88C07Y7MZBND6PNtZNbWO581zi88K/NKzbZ2oxrbeqP +72GgW6wAU0u//FtIdH7DiYI/um7MTBjPpYOUioc7hYE/xWqpstFCIEfn9QdlkweY +xiaq95JbedaUVr+BGYVFi/NeYF/xc02KhgDYXU4KTTcNoQ6ou6Dg/aDil+yYCPjZ +2+DlqthofTZyr9SzL7uEDN3Cqdm4r3ukIqrUf9u1baYyDlInAoHAW4rNNXaB7LAu ++5b904eomfd2LWA3byP15vYtC6uyjhHurSIWNDvK32ot1yHTZTmUBdl2fC7JYtmG +kiZu9zbLki/AZnHE6TM459HVuQ1pvc20aWpvOP+iOST0n74tmIJd1Tbsy3hY9AQV +4LbITq22TVKklOpoWNJtAf1JBafs15GnoAWIhTUzEhwzmq6VLGUoPtuQyk6VwfEi +sNgs3dxmYn4Yir3LB2kf15iSLEq6RZePjg9axG7pQ2JDzJMBbSM0 +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/root2.pub b/taf/tests/data/keystores/keystore_delegations/root2.pub new file mode 100644 index 000000000..773f00884 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/root2.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvgyaLSYL6WDJGi3mDYMj +DUNJTZ66aY4U1OMmdJWhRrFRILMz+tmKNpUVyVo1CwSBgME2AWHQwWVWt6CdY7zC +KjeGRwECH5w6pJ5ZMOoNIEP+Q0ofUU5mANZQOCdUmqnOEQLIuM+uTyh0nUbb6OIi +8Ff0pexWxNZut8iYUNxpfCkQyRCyb7O89ZKs/69umZO3LqK8pPlDkwy2TIgBXEnN +XmfjkCx6F9RNISdJkn4rjeNj+xscCGOvj4CF01jxKH18Tn67HaS1VU5Lufe6atcM +AsUx9GgEIKi6vQCVPlyeIzhQZ8fxwx8bq593J37Csq6GaEhn5VpEHfgQbtiusZXL +sP/vFTltQ0+iSPOL3mALNn9rBV8kmAfL9m1G6t3PUXmsS1A/5OHhlX1xXW4yJaz2 +KgWoOzpU0YvlauozRsIvOVa2/IIukvGQw/xRpWJpJdfn7boUtVewhldNH4ZK1083 +IPc+4Npa3JSNsf4ZHisKGbQAFKXQRMDE2oIRU4wA2jaBAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/root3 b/taf/tests/data/keystores/keystore_delegations/root3 new file mode 100644 index 000000000..bf9524d03 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/root3 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG5AIBAAKCAYEA0F4d/o/dR6qYJ8GGYcs2wrSwR5dajAJtwYyFCif79desgJLu +XyF2OlbOdFv5Hm/WCkxIJfF9EB+YPGz6Il6xXfZQQj0ycGLj/D1DVKbbipqo4Z0A +CoqDYL1+/7NpJhRcbIV3UL910zYcOdQHbgoOZUTdn5UGHvkCszjAdvqGHS+7w6gZ +zEL14TWhnATOwIdAxcr7++t2HK29/L0iJbpXNs1mDVPmofDD/T5YLWuoUWq9nQxQ +o411hx+Dh3pBC4HUmtb7M10/jZOryJZ9ZtRwFM0BGUGv6m5RDAAHhLvJRSs5wjNJ +eNwvE9bNEv36LnWWxZqGZsQFKSiZVLwltq+xjC2D/ga0qoqbaDlmOJv6eS75GUPe +SgVhyXsUOaoNmQ59pr1AmwW03fTn02qhhZICHFl8QViTaXXB9epZzi8T4ZjdFG99 +mwnTe33ZyXCcyVuXbM76xzbUAGSG+F29VH+JMemH//wdmLlYOj5WmawUxHhdcNnU +6KWiz+qMNWDbpZ91AgMBAAECggGAE6wnIc8cYbVKC0rasKX6hBSCJig0jM535VOq +heRzhej4aOU2azXiDyz97f92/Dgr2aoND8QGfjy1Z1MUpKUTEt98AVz8w56ajsiL +8FSWmrXyZuanR9d/AuWxNVwPe+BlP3u0YaPJ8IiFzrHlh66cYFRJplTwEIGLDze2 ++CS7/8pvbFAVK3NQ+pPRL8VGbef3JhV9h/HZo2iF7PRAYpZ+wHZRAcYfmr98CY9W +zOcCq7krsMWmYWKsK3c+uE5DEN6Pc9Yo5qgq9wOWtoBNi/aunwihfGhkv0xF5rtA +5xKeF/bP7bbY4X4ekG1JnkcB4TNrdP/Ga9G5hWrbqc615PaDWwIcT4Hn/gDT3/fT +/xCNBMLXo8oO8aeuFqQmgbyQ/+7/T91FUA1FXQj1dcDvE0/ZjEkcd1so3+HrSTng +YOUiGgrt6QA/lS2EI8Og5+RoIuu7i6M3OwHrJBUz8hXfcYfGTM1gxdtT0LLLnZpu +6Y/k2y+1D059d32KK2Bw1GV1ljoRAoHBAPnLNdFtgQyafo+p5IYkXxqPWy1Nx5qt +bPPhgr0X7/w9t2QvaJ7Jd6n+oFTAJUKfGyHHuCaXcDoMdPEySIM9khKxEBbaREyy +yQsCfAldGVxM4FrCkb5revj4vsLkEcT3rAOJI4iPqXk9pWZv7jmvAJF8KAre6l0l +OmhyNOkDFuSvpYDWOaHScSfuHvVltYSoT9V5JqmC1yBzPLj2qgoWZpAa/TDdOIyp +Wl0tGqihie0RQNmGC3REAb/JeFCbsWYgbQKBwQDVi2t8KiNdjiImssvMOA7rqrVf +iQheRlq7tF5pszugen6ke+EA1x2AUQaNb55XNgImOU/5YK2LpwfK78z0YBdtLcm/ +pxdlZrYCyKe+Jgft3iD+Jn6j3JtQl6KcJsnZV/45M1yL+OnDvO2J52gW6Sfj6jom +ELoc70YIAvgosXsRLs9GuEBAv1iCXV71ASigFGKdE04Y5cZisKRzf+tJSNmf+p9x +4X0tYmpz/yc2qRcDJyNAcLy7pblFJST828F7ZikCgcEA2bVpx4j4I6L3UYESInPK +y9xL7DVRFZe3UOuoReR6Dk8/6jqDpXkUKX46AQOitejz/cIS1tfAQWef+KQJnRDp +og7eZfx/8JUWMdlNf9+7fb2nAJN58Qu+Fwa9RCEA97mhG0fIR3pmi7vVz20YpP/I +sAQU5jyY6OvMd0Gqqbc+mbwYtCyB+G7wnoukQd8OkHsdcYHw12ao1qh5MQAS/U2+ +wDQ1ngQBCF+F2ZW5GWYJTyxtZ+izTPcEy0Ht8dtwhwEVAoHAF0B3E64C68zuKwiM +6E+yUDbmSODC6IEAoC+jmB7L/01XPNHATjceHzqzW/MrapOW6FKVQrIkM3CciJxT +1MghxOGXdibbhU8JwoPWv/2kH2JwdTv7zhvXTY81RYtzrxbFt7S//v27dnS76Kgp +zVTV4xs9+acYnM3w8i5glw28OMLADxNA68vp90fzbvoRUlzl3/SaLFvYniZdwbXM +CM7F44WGlv/WgXqV3MuLmYgP2WgJjpq38ja5Va4VuPK0vpsBAoHBAKWpSRnzpEkG +nHzSRIX0EuGmT5vTIAmlwFTvrptGuHMJA9DCaT14JlffsyuIkycjMTFX48+j372b +c0lytjwIiXAhVxoasx0FKX7/89Jxhmv8RYCd8U45FhrVzHMVtTQY0YwpZOQTTu0k +lP8ZQy20Yq8Ymt9ZUcfy/DqzQYSNPWc2uPRPtfKZHYZ1OGwzh0PgzuLfkXOgemKk +nDexOHzqw3//zjYx66OfLrK6Rx/58sUx82X0wDqVvgYvGvzceqsJHA== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/root3.pub b/taf/tests/data/keystores/keystore_delegations/root3.pub new file mode 100644 index 000000000..f80539e46 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/root3.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0F4d/o/dR6qYJ8GGYcs2 +wrSwR5dajAJtwYyFCif79desgJLuXyF2OlbOdFv5Hm/WCkxIJfF9EB+YPGz6Il6x +XfZQQj0ycGLj/D1DVKbbipqo4Z0ACoqDYL1+/7NpJhRcbIV3UL910zYcOdQHbgoO +ZUTdn5UGHvkCszjAdvqGHS+7w6gZzEL14TWhnATOwIdAxcr7++t2HK29/L0iJbpX +Ns1mDVPmofDD/T5YLWuoUWq9nQxQo411hx+Dh3pBC4HUmtb7M10/jZOryJZ9ZtRw +FM0BGUGv6m5RDAAHhLvJRSs5wjNJeNwvE9bNEv36LnWWxZqGZsQFKSiZVLwltq+x +jC2D/ga0qoqbaDlmOJv6eS75GUPeSgVhyXsUOaoNmQ59pr1AmwW03fTn02qhhZIC +HFl8QViTaXXB9epZzi8T4ZjdFG99mwnTe33ZyXCcyVuXbM76xzbUAGSG+F29VH+J +MemH//wdmLlYOj5WmawUxHhdcNnU6KWiz+qMNWDbpZ91AgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/snapshot b/taf/tests/data/keystores/keystore_delegations/snapshot new file mode 100644 index 000000000..b34ada6d3 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/snapshot @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4gIBAAKCAYEA5SAfpjRXXlOzSPstDiD7rXhHEGqJBRE236jZkNRfQYgkYouL +4Vr0fXci+9Tx3PxVnJo47VhQQMj2pPrL/BwaJ9AGvP0KiRHbhU40JZrzLTpiXmaM +j4zuRLjbLtZ/FmMmlbS5ESfTFeUcGj6k6UKIJ8IhAePEUV5/J6JMIJ+94RU0GWZi +LFywGYRQ2fnFy3SDP8Ne8OahlGzUInP02xuwHrbIBeJvwSuYrMMByIv8PdtkRCjU +Z6clE8+f/KaTn8qBPRg2mlkfCOijIfKew9DgEq/U4nxNNDjYznbAFAvuaJnwS9E1 +S8VCuVoioeK3qCloIWfGVxbZAIlqBxgFVI6dD5R6ClDnRJu+SYJJXR+asS1TIGWu +o6ib4MiydGfMZy270CYT7V3xsP/vo66Kt7ttYJJhMAn1uRI/12GK5rB2+emVdXMS +O1M6x7lxEPZydslvTU1bZTzNLX6U2vuPXQqWYv5UFdrdDqrOm5zsSEWPIGQQTmO9 +MIkvJNuK2iGM1pMXAgMBAAECggF/Wj8iOCoQP5cNhtwSuFNFeONnGjrcEqLfz43c +zq7XgM2e3IcaZtOXI9PzyOfsW/Oyb3xPRS0DxIC4pULOFammo7J29PlgrPHbr9Cd +uYd5QNc+PPB8wg3rINEELplNyq5DBF7/20H/DSCwxlA7pE9lpu36Z5l5jz3T153q +s5mNBfApaoJpKLquogj7z4oR3jvbdmyoIzq0FJdzoXO1fe0/Rtm3me8WatTrzcsB +aNG6Xfg2sKIPB29OVf9G2hIXvgMvJYCqVbQ/KQ7SofhWDDyle3+kzbg8dFTDdFBj +ykouXTrEnANW2Svt+5Drha+hGgqaFOReT5k6qvca3T5FpFhiE3CKBpie790nZw9L +kMIiGR4Qfg21BauSGr1Y8bXKbpe9oRujU2POAs9tVCzhHRnLYqhgKlr0ATWC7/W6 ++QFtwvpDRl5Vw/UmLBAsk02NhbLXHSVX7j4Y265FTNm6Y8+vzQ6Ub6Pt7Stz/i19 +clpcjW+UYJO/pHCbZdyrTq0GxZECgcEA6uS95X9qdoUz7b9dTG+4NC5ulB7vQ3J/ +XDa6oKZl5yTX6MQ7CT/a1C+6SpRiX1c+kDYRdKXn09Jaf5RdFQW6VIIg62z8ol3O +xy15VQ0V36loPzPgvi2soBULioE9unq/RvVOL4S6qxsAJmH2JMO8odX8J84gx8/h +nmhlYvZu7YeNIcIyUZk3hlrKja74qBwJg3UcGH+MTJJRx2J75IcYfjcY6bnfBQzJ +VMOv9civVZEM4JzZEExg6mRfu5gYuiXRAoHBAPm2sxbtYtOf/HjaDV/r4DmJHnOG +T4jvQ5CE9zj4b5KcHJqdZhbo/AaayXBs1nU9i9i4ZGVGhraWofIbpE7kpLqs7OJ1 +82+A+/MwxEnyR2eEWeMCwJY9xD3MUPj8z3o31lAHDJMKZCCu7kpDKnp50+ah653c +v0tmSzuVtLUO6OdiZMbf/MUER3mIFd68XDVJCgUemM+xwhqcYm/1P7adiC/m2Jkp +y+/6Jd5siCv1HB5GMgaOSzz0qWdlpj8WyAacZwKBwCTMXv+EHY6hwYfeceRWoDn0 +iDhGPF+JoXA11rjyOIakm/qIO2NwkHyrWXjzlBGxnkiDX+qxTwc9LhZMjOSNOCqj +FDstoMpi/dDwS9DKMwIODRnRq8S/bQrLITq6kowTTMH2DiCdn4zMtxJMSH5r97I2 +zsEBptsGsybY3gFJ8AjgMnj2bmGgKjWvJYpavfPAKLFieFtSKA2a4prkz9n2XBzx +zsJW7xxga24PFhLgNK+oAKdziwHlpU0zGlhONJl88QKBwGkGupQuC57ObzW1IGLz +pj8MuM4F83W4jEZAZmqDswmKt00gXkvMehOdDpRGcnylAiiIhVFDNG2fNUXK8nRs +HgyVppwo19ZR/aXvIN+pEvcq51NfWPjXya3kPTo7ulfBHFZUYKmHeU11xateTINu +sf0SpTKkIaDoyUOqV3K/bp3C+HfcxUdn4VfwMKKZvn561cgJcmQIc4cVtyE3mTCJ +WToscXUZ6zhnkX3XT/6M/OKOy4OOXX6puIZQbneicUa2iQKBwQDpirD4lwkj5wKT +XuWPYpoShb9Qfz8FDZBYogQxIs/S7d6p6T1yHo5lfxUh6A2oT3eb41B0f27DiGA0 +Bz8gUIdImsvJABewFrbE7Bvo4R+lib0dvD4TIPcI4Bdoh7RvEEN3JDuiHyA/yM3g +0NY852e5/12L/aCnjFXrakN8yvbAxx9VLHnD/suHM7CTghfMNAT4cdAQh4vrYrm9 +6dsFPXPRqVy576RgwjQ+bpnMR1VoIRouI9et9//x2quYhe7ZlVk= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/snapshot.pub b/taf/tests/data/keystores/keystore_delegations/snapshot.pub new file mode 100644 index 000000000..8243a75b9 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/snapshot.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA5SAfpjRXXlOzSPstDiD7 +rXhHEGqJBRE236jZkNRfQYgkYouL4Vr0fXci+9Tx3PxVnJo47VhQQMj2pPrL/Bwa +J9AGvP0KiRHbhU40JZrzLTpiXmaMj4zuRLjbLtZ/FmMmlbS5ESfTFeUcGj6k6UKI +J8IhAePEUV5/J6JMIJ+94RU0GWZiLFywGYRQ2fnFy3SDP8Ne8OahlGzUInP02xuw +HrbIBeJvwSuYrMMByIv8PdtkRCjUZ6clE8+f/KaTn8qBPRg2mlkfCOijIfKew9Dg +Eq/U4nxNNDjYznbAFAvuaJnwS9E1S8VCuVoioeK3qCloIWfGVxbZAIlqBxgFVI6d +D5R6ClDnRJu+SYJJXR+asS1TIGWuo6ib4MiydGfMZy270CYT7V3xsP/vo66Kt7tt +YJJhMAn1uRI/12GK5rB2+emVdXMSO1M6x7lxEPZydslvTU1bZTzNLX6U2vuPXQqW +Yv5UFdrdDqrOm5zsSEWPIGQQTmO9MIkvJNuK2iGM1pMXAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/targets1 b/taf/tests/data/keystores/keystore_delegations/targets1 new file mode 100644 index 000000000..e15f2f6bf --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/targets1 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4wIBAAKCAYEA2nI8EYyKrmZ6SR0BDFi8Nitd+8h/2V6HbvuidarmfdvAJQnf +kAtBtX5pe7loYDY/A/9IYTifLCa4HIATB/pKSPELr90Py9MtBrbnI70z0lCfv5Mc +7cT9Fn/RKs1TfV3VVz8pQJBwbvbZfcbcwhjbYBihjj+fsnKBCBFAIvsdZyTvhilJ +P0fnzT0u/5s6xaEwQ6ouGIG155gGKSaFkceB8/LP9H+9iJXGRl049CVSDegTBaE6 +z77d/bnaq/Zl1tZD71Uk/ER+rDvzxtsNF1Nl47LAZp1od3goNpVB0IM1lRD7MHDj +k8gQeqSaV5se2fuyVlS8znWPkvA9rlxEVPF6997k6+F5oSZ2I6VYgQm7h2lTiSYc +40x5MrOLBKpVRYcw8+69B/jKTtDa85bZoLV8HgUHWd9gIKZq2BNxNHaKvPMDPJK7 +s8A8eYbikrlLKJGgHTrWOS1Ba9DNN+xZdTqwhNOV8amVfDLPLPqUkNkRPS/bWGJZ +XzqbDMLGvCi0ZrKpAgMBAAECggGABpRmRskK7FHd4RHklDCgCqmnvQu+/hcg0TD3 +JcAuDSBvWy4+86HDKupR1w4wnKVFpKMt1O/Vq4jHBuS8rgLV9fh8t6Fa9nK36nnb +4HG0e+M9zJFrz6WdUe4rqLRijWYkJOqcHXu8RztcNbOltpr1EKHtS9GSx9c3F70d +R3B05ERyioH32NYbn0z2e3B7hrRiNceMd+SATCeCF/83CrsNqQFpTh4C4XhRbpEk +RAZTwGN7HzJKCTPgj+HnOkLDsoLlnrHR+WgTcUH+LyLO+Ma5ELodRka0bYo4O9A9 +xZwiBNJCBejhYX5Xtu9kKlKDq5GmvWx7R0J9ttRTl2O/Qkdb7pUJ4rZWC9Q+NNVV +nQ7LcCLp1pwc1oxxHFq2pG3WUMqur8T0t26XlDyzBC72AzYL3R2gGLGTVGpkyRKh +7yS4ZBqYw5CEH2d9G2BB1YBBSmkUSVbrvXNyxlD9AI5rzhquu138VoMXPxKtbXqO +Dc+IK8Eai2qkD7kWgfUFL/Yuij65AoHBAPJWFB66FvHS3kX02YpdFtseyFZk3xJ7 +aaTpadeIhwHNZl1aFugOO4+vS0vtpvIZKHtAh59gi4LuIKNyBYYZ7VSx64ltyRfY +w/i497euZ2g1SqH5KjAP1F9U84/HMMtvOaF2u6IVSAJh4X20BymA46Lxm88wBZXG +67EJNlbYBjQRHo88PTwtw2tLZBa1Nqim8zROfIaEbPFu5a5azzrLuVpLZvuWjcR/ +u5XHOKIScY53ldY+cYr1153Y21oTMqt0TwKBwQDmw1LYmyd9iAWJEgVvsVYbnlf6 +9H1ugAQTjhHU8FrvC7T3BkqtUWhVrQ+JYoLJ4sIAAr0g2LceAlF4+XbUNWsmCFeR +oPs2yScBOVqCwTKKzAerAfbDq7L85ExZl08xFKlztvhFCcPP5h95QsOovOLFECaB +6Kv8g4X3IbPDFBLSrN5uZ2TMsk8vQU1+mR3AMWTAC5gohQHmDXAGqRiOJbbV4jlF +hCXIkY15om5M+0dUSwmGp7vyubXPdhdZWODdk4cCgcBrrVPDU2xehxO8gc8na7V8 +J3Fc8fUsgSmv3Qbqff9/DYUudZk4Axrz/S+3zSEg8YzLNyEL8BoNU0GtXjyWGW8a +8vN1XRK9RdPN8GIhe5z28Lb4wX29XUtAEL8oY5mKyyEQXXGB03LrnBJViGimSF7d +R/2zUeMpafnP8Af1DoezGug5PMr4slzij90pOdvPlF78HuO14aGGpX/ouPDbbyos +tNRNddgIN7liE+NWIFvUsc4iJBzPYe0sde8BVwZsqIECgcEAj3M0ePpaXirEZiUR +xBEVWi3gu1xo7NwfrJhQdXLE1H0OjdEXcw58MWZXlivq6d1Qg/kv4M9XZgxC4VUS +jXB3nzjoVtsfzzrUSGqC3W2EIcwbqC6cW57MsXCqFbd9vyD9BbXkN+aOFxsSzaq3 +PpnMznvvtCoTX/HSwYHt4YMFAHn9+9vCSY0+tD2AEwbT+7m4y7lpaSblu0D3Nuy/ +Gv5O3j63I4O2iSwSKl7S+n/qI3hR/6cdqxHO95yNfzlE7/jZAoHANjtQpKO4X/fS +6uudJ0fsZJAyM93pvHdZvHHFSIBLGwyfuxKsu02pvfhC092TFlDSqNYx929gr2Bc +Wfzhn7M+s9J/UjVcFovkbmpB7zV9vbwE27g/hIGjsSQRINVa5sBGEUNb52lgNpm5 ++zL+Ck0h2hsBxyVqGkphaqqhxKPmoswZSf9sM14HfaAOp4HozgNfyriIugAngEIs +u0g1bHMzFiREMsORmEL/gO+BA+LUrlPBu4a/3HHkqFg7SZIdxkuU +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/targets1.pub b/taf/tests/data/keystores/keystore_delegations/targets1.pub new file mode 100644 index 000000000..c3feabb64 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/targets1.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA2nI8EYyKrmZ6SR0BDFi8 +Nitd+8h/2V6HbvuidarmfdvAJQnfkAtBtX5pe7loYDY/A/9IYTifLCa4HIATB/pK +SPELr90Py9MtBrbnI70z0lCfv5Mc7cT9Fn/RKs1TfV3VVz8pQJBwbvbZfcbcwhjb +YBihjj+fsnKBCBFAIvsdZyTvhilJP0fnzT0u/5s6xaEwQ6ouGIG155gGKSaFkceB +8/LP9H+9iJXGRl049CVSDegTBaE6z77d/bnaq/Zl1tZD71Uk/ER+rDvzxtsNF1Nl +47LAZp1od3goNpVB0IM1lRD7MHDjk8gQeqSaV5se2fuyVlS8znWPkvA9rlxEVPF6 +997k6+F5oSZ2I6VYgQm7h2lTiSYc40x5MrOLBKpVRYcw8+69B/jKTtDa85bZoLV8 +HgUHWd9gIKZq2BNxNHaKvPMDPJK7s8A8eYbikrlLKJGgHTrWOS1Ba9DNN+xZdTqw +hNOV8amVfDLPLPqUkNkRPS/bWGJZXzqbDMLGvCi0ZrKpAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/targets2 b/taf/tests/data/keystores/keystore_delegations/targets2 new file mode 100644 index 000000000..325a731ab --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/targets2 @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4gIBAAKCAYEAj35ckdzQ5DnJOw7xkj+BbTUkPyXf/+FWQxCzmM30tT4Ih+w2 +VjFnXCjUPtvOTLe+R8oA3+ufOM/uvPmAdNk7UUVYWa4KH7Fh+N9wzbMIDsLjH1dk +uwe56DhcUsNIWQuJd0Vqb1erhssdRF26L5aWhl4Tb78QX22WKeRIYwhwq0fW9ae4 +6Y2eeIUKmSCZr9gYfQ8rOYOjOFRk1D5dNUL+dcd/R6R6Y/pnjTZuFz15QPUA5Oo8 +lmbCDLXLZbgwUjHxG6TgsHLUSQ3OzbMB/dzDG338/OfbYv2Y7hiz7hk7UwA5ov7T +4l7TXZg2OR+jV8NhivkAn6LYb09x5CHAqQuHInxw0j3sCcdXVqCqo6cLa6jOlJy6 +yjV1LJGj8AD55TLS/CdrQ7R4r2vV3hDHW4Ke+79HS7nCv1uXM3c04nDKByMFW0mL +46Gr5nulDVb2tzon9h1VPwbSipO//FRBevsIIGQRnlcXvrxgrjxRgOM5mRcpi+yZ +/7KmUNrEcCH6QD7DAgMBAAECggGAJOn5b26ycFvrSB2miJx8s7btja81KlLySYt0 +4FTvZGbCdBEQw2ivMdaxD0ClmDfWpAoz4mbvjYJ0ZLn80VKG/3fK7DspEJEl5ou4 +rbomUwHQwuHNII4yxaomGgZxyLJ+mSfK4zzW+/SpoUpJWO+w5n0yG9e3ow0CieFX +u95SecWf549PswmDIHb9THpF/yYk2ps53/Bc32Nakv0+JjMHWg5J0IjgEXM8C2ha +tvDSDiNZKQqXLovd1L45xn+1Mpf1D6468oR/DGyZFAzkdcDQVliIwmd3fHTOPq7t +G/trkOhySLAcpB7qOl/ab9I98+GrWZ8LR+VMtU7T7iDWMuIgUOMA/Yvd1zzNtodT +7xEH3QpKi9nAvDTxwmoGVlovSsoQfi9vR2BMZbVVyH4zbRx1KHI8lr72jARBuzvF +B4QKLltNc1eI7ahu0xV9TCINoyrJXgab09mudfOzDHvds/1YTvceQDo6Y8yoI2Vo +WVu7djguiH0uVb2NSKLfUENNs2ohAoHBAL9dEuRQNgOnRPCFM91WUenlhvTf3wER +4eYtU/D68FaAKBe37oYQ8I5KJMRShuDeXI5dZlqerGuL2kxsG3niABf5roFSi0tl +jjsfTrGSDpAMNWexTGvri6M/5x3eoXcab0nSwu3N0voA8RFuk9oD+v4xyxHYWVWj +oxwMwc7Gi94i8hkucYr027H0twIbt5wuMsASS565FfTJwEAMsWDX/x3bZAXwzXMP +FsB2AOrQZNAk08Z8kFURJnqx8U4RAbwY4QKBwQC/9grARvIa3AUBrMTJVxqKwJGf +SU2JSBvFfjfR7RRugvNc+VRW1kgKC1QRNF4z+6nSwu51v8e6bkpnX7Jxw2cAf9xX +XBmzx/gc8IoP38hu1DO2Mk9qaxNHvdLFidbsZJxFAyYQh7283Kef1R9+6kVBxwSi +ehXsG/n12dKPHrvhWnSIy/NXsK+BaHjPvdXKndVEInBZRXLql05dWyfJvDPVIkeF +ZY9BOMfMZCjeG1JrtIQO27CNC8JD3SG1uXLr2CMCgcAKhr8kSfk+qDPVmy4oLbhh +yltrGul0cJxhgfrNFbCkwXXzIA4B1+qzmQZ+uh9rPTAQMLkRoQrQ+6dtbsDwKmtg +5j4gJP8+jX6OaAF3KRad+93wL0OJ6DINL9Wxwe5V0+FtSSep1xmU4PphwBhn9LIY +y3plJ+Z6HH87asQ6cJd/B6MTmYdrYl63YkOy3P1znOLzx83bFElN5s8pdslHD3qc +FNZisUVL3/ebbKJOSFpTTMNNdsqls0TPmPwyFCNpSmECgcBqZ1CISgsTNlgUGJcv +33dX5+wQNgqjiPPT4eXBGEAWDcImDBJi2/4siyD7NGLvP5VfvSt+22IzhcT6TgJU +qvJiRX12cxfQHoz6RZ7Rs8KfJELRwEti+p1CTAcT9hbLC+3PFzK3QPa8RDcqEnGV +4PeowU9hXHjgWpWQYEAlkuyjuocT+LEXL1npSmaFCH4EBL7dOJW79hH/1QTcHJYO +baLxhkHMwIHKrlWZhv9cNhrWlsYIkl/nntf81AtGdtgrwK8CgcBnXeb+O+G4kulP +C3cnTpNcT/wAmZTTakqptCk3Or/5xTWuv5J9iGLX3qSLtgo0Cy1rDyRVAkEJbHv8 +JIONQg6gv5q9m8NTQ0ozqET2eqfPPW7TkKKgEnfTFn1HTLiaOh6chggm9fS1eBWg +TlyzUWQUiYpizvLpeHwzihSXS4LHfO3MZqvJZjjptMsS+OLKLu7/FY0HjrXV/A+X +/YkuxjNXZkh3MHOqJeG5RF9ReqYxZ6U9ENsy7OgMkQReUez+T3A= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/targets2.pub b/taf/tests/data/keystores/keystore_delegations/targets2.pub new file mode 100644 index 000000000..228bca5fc --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/targets2.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAj35ckdzQ5DnJOw7xkj+B +bTUkPyXf/+FWQxCzmM30tT4Ih+w2VjFnXCjUPtvOTLe+R8oA3+ufOM/uvPmAdNk7 +UUVYWa4KH7Fh+N9wzbMIDsLjH1dkuwe56DhcUsNIWQuJd0Vqb1erhssdRF26L5aW +hl4Tb78QX22WKeRIYwhwq0fW9ae46Y2eeIUKmSCZr9gYfQ8rOYOjOFRk1D5dNUL+ +dcd/R6R6Y/pnjTZuFz15QPUA5Oo8lmbCDLXLZbgwUjHxG6TgsHLUSQ3OzbMB/dzD +G338/OfbYv2Y7hiz7hk7UwA5ov7T4l7TXZg2OR+jV8NhivkAn6LYb09x5CHAqQuH +Inxw0j3sCcdXVqCqo6cLa6jOlJy6yjV1LJGj8AD55TLS/CdrQ7R4r2vV3hDHW4Ke ++79HS7nCv1uXM3c04nDKByMFW0mL46Gr5nulDVb2tzon9h1VPwbSipO//FRBevsI +IGQRnlcXvrxgrjxRgOM5mRcpi+yZ/7KmUNrEcCH6QD7DAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/timestamp b/taf/tests/data/keystores/keystore_delegations/timestamp new file mode 100644 index 000000000..538cc4eec --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/timestamp @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4QIBAAKCAYEAoZfitDJagw/4kDFGbLpw+kzSbrhba+DggaL41vJ3TyYDVy2N +tUStuxndx61dlnsyu91C/tDjHUN+aoxvHpBXw1/6DR7ea7bwYD/8qqq8Y7r1RYoW +3Bihrpn0BveR0E1CdvlsldRoWw1juXDO7ikG+FDH50benB0U2J+IeWS1jb55L28y +7gtmLh3Yyw6rOZ+zA34Zuu7U+q3TYPIFIwYtxjueP6u/9KgQ/tL7AWAwdqc8vjWS +A1KoUroHkmGifGU8tq/QuWKgDJl4+FQmRAeezEd4jwGG1lZ3DC/ey5O/m/wRY9Kw +l5l+WYWROMM636MJSUzaNlfQ9tiRsugadfijf3+XJYkXliBwkj6m7cGfJlXzCnrg +MsGiXXVLrhefu11Z3eKsTRVygo3FLfCBms1wq7LlL1axWdVWX3YqJlJ8czU5+igc +9cbhnTq97Bh9zPYXhgA9odNxwimfl+AWfF8IqIeBGIUFYXEVZ5Bi0RvgE3En1ZpK +IXwa6tqluR3wX5rjAgMBAAECggF/GSA0HJw1TYhAD1IFQxjYD0sBfq8CnBbkuMx1 +QDHSAGokP6IzR7XVkc23eMO66605lPm+blWMyzhZBRcvIV2FUA4EQ2526nys1YnE +MWnSbME//t1zWnAsGN7vq1BqUXzBkOxFD3VlZuazfRwdhKvJfsOsoa6qwgv/Frwn +DVGyu6xuZDz80pAhMJAv2iS0HefI3SoTTTKyclpbfs4yE+1EhtuggUz7ikkLgM9u +7c/zkRxw7ywujvkpJx5x/aKEp0SgSspFHe+JJ16hnGxT0Y8KNdXKTOIkFpdamWVD +BUIMdZc0c5XHhpGcoZbUcxXEaA6eVnfEVPYzt8SteSzPQmFGph7cV4kqsWt+3FM0 +a76J4xHplQLvNmom1CyQSgSDdJ7EutP9CvpwZ6loDvyTNLg5i/A1Cv/5olhK2slF +RvTbo56+u+p+41KsyF071Ha+sjTNHn6atPMlT7EWhoKCU/e3AXAgUtRXYGB1lb0O +Es5WllRsAeKG22btE9G0k97H6OECgcEAulmUItiZgnuAbc90sqPXPa3VDKifqDfy +gQmeiFfJYmc8D1s+WjOrJ2Kc17hhmIiLQQrZ/zEgIPr4cFDKgTZmfyfZpkrGuCzm +Vr0jGQFMs/nRE5AUZUBXS9IaNdvIEXyDbcbgf5lMcMv5kL/KmZt/BrJmK6vwVgYa +ufxGJUEWTix+5xrgErmJSmk/evgUJOdvvtnOCvR5i1Y/ZjsdpVoazGNx7SKwpyo0 +FXpgk39rfbZ6wHp4PH7LNgNrjEYJXacNAoHBAN39iGc0dv55ht+7juQ4GxzL/2wm +JmI+qJ1ju3A202m/1mQwbWhoki522+aJ8bRhz1SXnNi5773hsMPda2bodNIUN82m +ApLLk4XrVuV2hVvHCtglzUyGR4gXaPTuPKY7LNMMyfezCg54hnATux+XqjwutDPz +HzbqKiRpv3vF8CDfLsoi+GHvOYOHVy1EEJauk8BP6sXKyc07N1bgLnY3lkPI8S+L +QC1rO8STokKjfRU2hlbIHKMRVW75RRyCj6nNrwKBwFdevoSj9z1lOC7EEJvdE4K4 +qOYZfVm6eXmkj+6u8h2v90nf5tkV1o5NvumpaiDBDEE/nDv4xW6RHMBUMM3qOp4t +ie9cqdUaQBi07uq/YD4Vx8AbUmSyiPtkk6Ni22fPcDOdBg7tShismeMS+SOR8zmp +lRuurq02iXtf22eGH7YhSJKEWECPOt5ngDrga1luJUdfCSq7uuzoUCtXViv7lgr0 +KSsck6SctfTH/tXI7RXw45axFQSQEijN67PF9ogxVQKBwEPywrm0WWfzEtGQu2An +vETIPFqCIuWXgE0MpebnITcRPTJVkGeQ+o22XADo4E7yUV/3OE8uOq/IUS7iq2lI +ZdmXzqznz4nXPkSTkHmUGaXJ+wvGJlzyDRse70VpVq8bFdFT7M4gw0dCpQPRRkmZ +RsY9FXOBS2CntFaI98+O+r1VEyFUKurvKo+T8Z8tYlZ9AUSwMZBxTeu/4GR7Ij2V +Li15aDnBSdedJyI4fkYffL3tfpk5j2pqd9gL/JeJbyfuiQKBwGkncaSjz59OC6DS +h/vo9BfgJE5yePLPXBlVfe4Q6YEoMUAPD7U40WTWUJyR8vOIg04OOIQekrSx79QW +a2QhoNaacbE7MpnHHZyHXndqP0vrXeqV9748PpSd/bsIwJ4wuRFSU4g5r4EtfMbL +HtMM6uG1OGS7LFFg0lgwVqLHQ/N/PppsdxRyQBqY8eDLBlmgrbM48+hy7VyynwDw +KwRddeZwMbDhThBs46vfF/h04k2Ofj5vaS+BEwAgd9hleCWGOA== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/taf/tests/data/keystores/keystore_delegations/timestamp.pub b/taf/tests/data/keystores/keystore_delegations/timestamp.pub new file mode 100644 index 000000000..625ee2f70 --- /dev/null +++ b/taf/tests/data/keystores/keystore_delegations/timestamp.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAoZfitDJagw/4kDFGbLpw ++kzSbrhba+DggaL41vJ3TyYDVy2NtUStuxndx61dlnsyu91C/tDjHUN+aoxvHpBX +w1/6DR7ea7bwYD/8qqq8Y7r1RYoW3Bihrpn0BveR0E1CdvlsldRoWw1juXDO7ikG ++FDH50benB0U2J+IeWS1jb55L28y7gtmLh3Yyw6rOZ+zA34Zuu7U+q3TYPIFIwYt +xjueP6u/9KgQ/tL7AWAwdqc8vjWSA1KoUroHkmGifGU8tq/QuWKgDJl4+FQmRAee +zEd4jwGG1lZ3DC/ey5O/m/wRY9Kwl5l+WYWROMM636MJSUzaNlfQ9tiRsugadfij +f3+XJYkXliBwkj6m7cGfJlXzCnrgMsGiXXVLrhefu11Z3eKsTRVygo3FLfCBms1w +q7LlL1axWdVWX3YqJlJ8czU5+igc9cbhnTq97Bh9zPYXhgA9odNxwimfl+AWfF8I +qIeBGIUFYXEVZ5Bi0RvgE3En1ZpKIXwa6tqluR3wX5rjAgMBAAE= +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/COMMIT_EDITMSG deleted file mode 100644 index 9e572ce2b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file 3 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/ORIG_HEAD deleted file mode 100644 index f477082ed..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/config b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/description b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/index b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/index deleted file mode 100644 index d1546a379..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/logs/HEAD deleted file mode 100644 index b25ee85bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/logs/HEAD +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1559986692 +0200 commit (initial): Initial test files -c1ecc553f4318637b40fa04032d94a64d3080ea4 bbd3170a8b88b8e454bf3722343bb4a2835a6cce Renata 1560358832 +0200 commit: Updated file 1 -bbd3170a8b88b8e454bf3722343bb4a2835a6cce f724551bff06e7eedc432f4fc7e07ca3b3fe4203 Renata 1560359301 +0200 commit: Updated file1 -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1560433371 +0200 reset: moving to HEAD~2 -c1ecc553f4318637b40fa04032d94a64d3080ea4 467a6482e3d43a53b629f8b152af31a6ad4cd0f5 Renata 1582209605 +0100 commit: Updated file 3 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/logs/refs/heads/master deleted file mode 100644 index b25ee85bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/logs/refs/heads/master +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1559986692 +0200 commit (initial): Initial test files -c1ecc553f4318637b40fa04032d94a64d3080ea4 bbd3170a8b88b8e454bf3722343bb4a2835a6cce Renata 1560358832 +0200 commit: Updated file 1 -bbd3170a8b88b8e454bf3722343bb4a2835a6cce f724551bff06e7eedc432f4fc7e07ca3b3fe4203 Renata 1560359301 +0200 commit: Updated file1 -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1560433371 +0200 reset: moving to HEAD~2 -c1ecc553f4318637b40fa04032d94a64d3080ea4 467a6482e3d43a53b629f8b152af31a6ad4cd0f5 Renata 1582209605 +0100 commit: Updated file 3 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd deleted file mode 100644 index 14c79b160..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/46/7a6482e3d43a53b629f8b152af31a6ad4cd0f5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/46/7a6482e3d43a53b629f8b152af31a6ad4cd0f5 deleted file mode 100644 index 0544039c6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/46/7a6482e3d43a53b629f8b152af31a6ad4cd0f5 +++ /dev/null @@ -1,2 +0,0 @@ -x•ŽQ -1 Dýî)ò/HÚ¤ÝD<ƒàb›ê‚Ý]–êùíüÞ›Ékksg§CßU!‘ŽÉ•)"K"FÕ&_°¢®ºd½&³É®K‡l5gï©2Ùhz0VAÆaH, aD6òé¯u‡›.ÒÎßA¯Ï&óû”×v;¦¦€ŽhÍhǹ®bæ¾éZ Îo2?3Aº \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/4e/c2b2b2f56687e5906f82158ad21938645005ab b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/4e/c2b2b2f56687e5906f82158ad21938645005ab deleted file mode 100644 index 3533e0c09..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/4e/c2b2b2f56687e5906f82158ad21938645005ab +++ /dev/null @@ -1 +0,0 @@ -x-ŒK€ C]{ŠAâÊ{x0ƒL Iäøâ'é¢m^ë¢8˜e›öÀ CMºM%”ºB<<°>®R˜ù¥ßö¬–sƒEdÕÁ9V$©ßú#ÿ_ œOdºn@U(ô \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a deleted file mode 100644 index efa3c3780..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a +++ /dev/null @@ -1 +0,0 @@ -x%‹Á €0 y3…W@<`hQ*"µMÕäÑñ EòÃ>c–ˆóX®‡•B JË£a„Ä>ö¯uj‚mö¤·T \™ÍÜ‹l(Òÿ÷ Ø Ó \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/93/582432d7804a9340ee686095d0f0562f2915e9 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/93/582432d7804a9340ee686095d0f0562f2915e9 deleted file mode 100644 index 8afe4538d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/93/582432d7804a9340ee686095d0f0562f2915e9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 deleted file mode 100644 index 639667dfd..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf deleted file mode 100644 index 342a8d00a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 deleted file mode 100644 index 54149b7f4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 deleted file mode 100644 index 19010f622..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce deleted file mode 100644 index af719c046..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 deleted file mode 100644 index ac48d69dd..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 +++ /dev/null @@ -1 +0,0 @@ -x•‘I›@„sæWô%ƒi6K™(ìf0Ë`–[c §¡Íê±}œ‰rË%ïTú¤R•^ϧ™$+_æ±®‚²ÈK°¬x(JXeIn` ÅZ)áQ€8È e~? ª{4#ð}?…òŸ¡ßŽçÓ°ÅíV‘¤-XŽç8æAasýŸ6|ÁÁàëïÓLÛñA` vl_}K"ó“3€$4jºªV1M—MbyCïæV.ªÃ.Ti»{‰CÓRé]Æ«:î¿œqhekØ°î%ëáŠÔ*ïõhz;Q6Ö÷)~%æR5Nê.¶Ñ_c‘¸—ûé­ã@'§w¥']ï÷½´2mô–6L«¶Wƒ×¾)ä¸4Åu9"o+”ctÝÚ:{wd€:[‚`î±>Á·ê½ Ð(ƒä=:wéÙñ]&[Wg¤ÔkB}³„Š1O;S¾e •Ó ÇÂêá1/8ß_÷¬u-ÙÛAf)½È¥b“†:ùšWQ:!äÝ‚æâÂÜA9ïIÝ@Ÿ´.Dï³9ˆ—ÂU¶™tM²“ßð›(á2ÕÚã 0¬JPÜ‚šÆÐÁÐÔ¦M¡mïžQŸ?:°è­Tr\‡JÛ^^ž<)µÜ×\Y:î<†ÏÏ xŽ’2V5}ã_›2NOf‚(˜ëi ¡õÄü.³ÖÞ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 deleted file mode 100644 index db45f8bc7..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 deleted file mode 100644 index 8904e790b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 deleted file mode 100644 index 74429630c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/refs/heads/master deleted file mode 100644 index ca6979ad2..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -467a6482e3d43a53b629f8b152af31a6ad4cd0f5 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file1.txt deleted file mode 100644 index d539d29be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file1.txt +++ /dev/null @@ -1 +0,0 @@ -This is some example text of file 1 of repo 1 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file2.txt deleted file mode 100644 index c5d432429..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file2.txt +++ /dev/null @@ -1 +0,0 @@ -This is some example text of file 2 of repo 1 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file3.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file3.txt deleted file mode 100644 index 4ec2b2b2f..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo1/repo1_file3.txt +++ /dev/null @@ -1,3 +0,0 @@ -This is some example text of file 3 of repo 1 -This file contains a little bit more text -This is something new \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/COMMIT_EDITMSG deleted file mode 100644 index 4dd9490b0..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file 1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/ORIG_HEAD deleted file mode 100644 index bd8c37a68..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -90f3acd75af70437efbfe218efbec51c14674c1a diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/config b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/description b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/index b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/index deleted file mode 100644 index b6d1662c8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/logs/HEAD deleted file mode 100644 index fa61ef421..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/logs/HEAD +++ /dev/null @@ -1,8 +0,0 @@ -0000000000000000000000000000000000000000 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1559986797 +0200 commit (initial): Initial test files -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 Renata 1560359233 +0200 commit: Updated file2 -00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 3a9c6c6145cd7d8e2beefd5e18335b023e260492 Renata 1560359372 +0200 commit: Added new file file3 -3a9c6c6145cd7d8e2beefd5e18335b023e260492 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1560433380 +0200 reset: moving to HEAD~2 -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 3ed9449df62a95bc9213657966fe46e126a3e7d0 Renata 1582209651 +0100 commit: Updated file 2 -3ed9449df62a95bc9213657966fe46e126a3e7d0 90f3acd75af70437efbfe218efbec51c14674c1a Renata 1582209794 +0100 commit: Updated file 2 -90f3acd75af70437efbfe218efbec51c14674c1a 3ed9449df62a95bc9213657966fe46e126a3e7d0 Renata 1582210710 +0100 reset: moving to HEAD~1 -3ed9449df62a95bc9213657966fe46e126a3e7d0 54369bdc051c041eee84680a69ef0c02953266e1 Renata 1582210968 +0100 commit: Updated file 1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/logs/refs/heads/master deleted file mode 100644 index fa61ef421..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/logs/refs/heads/master +++ /dev/null @@ -1,8 +0,0 @@ -0000000000000000000000000000000000000000 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1559986797 +0200 commit (initial): Initial test files -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 Renata 1560359233 +0200 commit: Updated file2 -00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 3a9c6c6145cd7d8e2beefd5e18335b023e260492 Renata 1560359372 +0200 commit: Added new file file3 -3a9c6c6145cd7d8e2beefd5e18335b023e260492 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1560433380 +0200 reset: moving to HEAD~2 -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 3ed9449df62a95bc9213657966fe46e126a3e7d0 Renata 1582209651 +0100 commit: Updated file 2 -3ed9449df62a95bc9213657966fe46e126a3e7d0 90f3acd75af70437efbfe218efbec51c14674c1a Renata 1582209794 +0100 commit: Updated file 2 -90f3acd75af70437efbfe218efbec51c14674c1a 3ed9449df62a95bc9213657966fe46e126a3e7d0 Renata 1582210710 +0100 reset: moving to HEAD~1 -3ed9449df62a95bc9213657966fe46e126a3e7d0 54369bdc051c041eee84680a69ef0c02953266e1 Renata 1582210968 +0100 commit: Updated file 1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 deleted file mode 100644 index 3aee50134..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 deleted file mode 100644 index 087b472b0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa deleted file mode 100644 index 09d13f56e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 deleted file mode 100644 index 3caceda18..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/3e/d9449df62a95bc9213657966fe46e126a3e7d0 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/3e/d9449df62a95bc9213657966fe46e126a3e7d0 deleted file mode 100644 index efe2b2bb9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/3e/d9449df62a95bc9213657966fe46e126a3e7d0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 deleted file mode 100644 index f04c5be73..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca deleted file mode 100644 index 131a0cd58..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/43/24fc4e11a047cfad90bc0396a0c48643393279 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/43/24fc4e11a047cfad90bc0396a0c48643393279 deleted file mode 100644 index bb07f192c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/43/24fc4e11a047cfad90bc0396a0c48643393279 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 deleted file mode 100644 index adf64119a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/54/369bdc051c041eee84680a69ef0c02953266e1 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/54/369bdc051c041eee84680a69ef0c02953266e1 deleted file mode 100644 index 9b3b843ac..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/54/369bdc051c041eee84680a69ef0c02953266e1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f deleted file mode 100644 index 4855cdd63..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/80/1015d8c8e4791124ee3684bd3e15d9a32cbfab b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/80/1015d8c8e4791124ee3684bd3e15d9a32cbfab deleted file mode 100644 index 7b2ea755e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/80/1015d8c8e4791124ee3684bd3e15d9a32cbfab and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/85/cb3330f98e706daad889da00e62f4c619c0bf0 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/85/cb3330f98e706daad889da00e62f4c619c0bf0 deleted file mode 100644 index dbc2f33be..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/85/cb3330f98e706daad889da00e62f4c619c0bf0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/87/13c348ca5ddb205a06af2c1eb2f16afe8f2ff8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/87/13c348ca5ddb205a06af2c1eb2f16afe8f2ff8 deleted file mode 100644 index dac84f080..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/87/13c348ca5ddb205a06af2c1eb2f16afe8f2ff8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/90/f3acd75af70437efbfe218efbec51c14674c1a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/90/f3acd75af70437efbfe218efbec51c14674c1a deleted file mode 100644 index 9bd51d47c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/90/f3acd75af70437efbfe218efbec51c14674c1a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 deleted file mode 100644 index 4bc9f84e3..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/a6/e32053b53d0bd41730cb0776e80ff8ce7519b0 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/a6/e32053b53d0bd41730cb0776e80ff8ce7519b0 deleted file mode 100644 index 25549d8de..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/a6/e32053b53d0bd41730cb0776e80ff8ce7519b0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/da/3bf63c0f85f4e3b32258a2e8036094b4356ef6 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/da/3bf63c0f85f4e3b32258a2e8036094b4356ef6 deleted file mode 100644 index 0edfc43d8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/da/3bf63c0f85f4e3b32258a2e8036094b4356ef6 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 deleted file mode 100644 index 9d86edc0e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb deleted file mode 100644 index 704fc7fc8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/refs/heads/master deleted file mode 100644 index 58209bc4b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -54369bdc051c041eee84680a69ef0c02953266e1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/repo2_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/repo2_file1.txt deleted file mode 100644 index a6e32053b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/repo2_file1.txt +++ /dev/null @@ -1 +0,0 @@ -This is some changed example text of file 1 of repo 2 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/repo2_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/repo2_file2.txt deleted file mode 100644 index 8713c348c..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo2/repo2_file2.txt +++ /dev/null @@ -1 +0,0 @@ -This is some changed example text of file 2 of repo 2 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/COMMIT_EDITMSG deleted file mode 100644 index 76c97b17e..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/ORIG_HEAD deleted file mode 100644 index 13f46817f..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/config b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/description b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/index b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/index deleted file mode 100644 index 486cb82c8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/logs/HEAD deleted file mode 100644 index f78ba4611..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/logs/HEAD +++ /dev/null @@ -1,7 +0,0 @@ -0000000000000000000000000000000000000000 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1559986919 +0200 commit (initial): Initial test files -7d5a746e791e512ecaa7bbf644205077e8cce10b 7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 Renata 1560359205 +0200 commit: Updated file3 -7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1560433388 +0200 reset: moving to HEAD~1 -7d5a746e791e512ecaa7bbf644205077e8cce10b bf80d90fb587cc88e7fe70895975c297c4785060 Renata 1582209687 +0100 commit: Updated file 1 -bf80d90fb587cc88e7fe70895975c297c4785060 3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 Renata 1582209977 +0100 commit: Updated file 2 -3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 bf80d90fb587cc88e7fe70895975c297c4785060 Renata 1582210802 +0100 reset: moving to HEAD~1 -bf80d90fb587cc88e7fe70895975c297c4785060 f24a34c1cf7eda83cce81980649995c3a26a0438 Renata 1582219501 +0100 commit: Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/logs/refs/heads/master deleted file mode 100644 index f78ba4611..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/logs/refs/heads/master +++ /dev/null @@ -1,7 +0,0 @@ -0000000000000000000000000000000000000000 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1559986919 +0200 commit (initial): Initial test files -7d5a746e791e512ecaa7bbf644205077e8cce10b 7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 Renata 1560359205 +0200 commit: Updated file3 -7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1560433388 +0200 reset: moving to HEAD~1 -7d5a746e791e512ecaa7bbf644205077e8cce10b bf80d90fb587cc88e7fe70895975c297c4785060 Renata 1582209687 +0100 commit: Updated file 1 -bf80d90fb587cc88e7fe70895975c297c4785060 3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 Renata 1582209977 +0100 commit: Updated file 2 -3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 bf80d90fb587cc88e7fe70895975c297c4785060 Renata 1582210802 +0100 reset: moving to HEAD~1 -bf80d90fb587cc88e7fe70895975c297c4785060 f24a34c1cf7eda83cce81980649995c3a26a0438 Renata 1582219501 +0100 commit: Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 deleted file mode 100644 index 71e4096be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 +++ /dev/null @@ -1,3 +0,0 @@ -xŒÁ À ûf -PºAwè ‚@ -Œ_@òöÎö,ö¶×—²bI¥hºÒ˜0hHDÌ+Øí:5Ác}ZÇ*HNQ¤8WÒÍí¥ykÀHë&å •~ó¤%^ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/3d/d99691d0f87dc7e28918e17d1e9fa5ad0d8279 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/3d/d99691d0f87dc7e28918e17d1e9fa5ad0d8279 deleted file mode 100644 index 791506c66..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/3d/d99691d0f87dc7e28918e17d1e9fa5ad0d8279 +++ /dev/null @@ -1,2 +0,0 @@ -x•ŽA -Â0E]ç³d’6™ ˆxÁ¤ÉŒš¶”èùÍÜ=>¼ÏË[­sgéÔ–50YžT5Ù1Eƒ#´Aœ–„1³§CÖ“2–ˆ:y¦œ™…T9úH>»Hy$öФO{oÞ” 3¦…àð¥ -Ñ9:4"æ9ÎÕ«ârÛÞÔ‹)’7m„䶼õt?›‚' \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 deleted file mode 100644 index d1f03b94d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/ac/2c1037dccdd65889205d5a076ce95d587fc021 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/ac/2c1037dccdd65889205d5a076ce95d587fc021 deleted file mode 100644 index 77fc65c30..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/ac/2c1037dccdd65889205d5a076ce95d587fc021 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 deleted file mode 100644 index ae368a7a4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/bf/80d90fb587cc88e7fe70895975c297c4785060 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/bf/80d90fb587cc88e7fe70895975c297c4785060 deleted file mode 100644 index d62c0407e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/bf/80d90fb587cc88e7fe70895975c297c4785060 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 deleted file mode 100644 index 711223894..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/e8/618f68718bfffa1493df304627016e2fda099d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/e8/618f68718bfffa1493df304627016e2fda099d deleted file mode 100644 index 73f173de1..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/e8/618f68718bfffa1493df304627016e2fda099d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/f2/4a34c1cf7eda83cce81980649995c3a26a0438 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/f2/4a34c1cf7eda83cce81980649995c3a26a0438 deleted file mode 100644 index 5b3f15b01..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/objects/f2/4a34c1cf7eda83cce81980649995c3a26a0438 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/refs/heads/master deleted file mode 100644 index 90b971346..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -f24a34c1cf7eda83cce81980649995c3a26a0438 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/repo3_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/repo3_file1.txt deleted file mode 100644 index 95a506db2..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/repo3_file1.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 1 of repo 2 -This file also has more lines of text diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/repo3_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/repo3_file2.txt deleted file mode 100644 index 4ebd954b3..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/repo3_file2.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 2 of repo 3 -Adding a new line \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/COMMIT_EDITMSG deleted file mode 100644 index a359b19e9..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Added mirrors.json diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/ORIG_HEAD deleted file mode 100644 index 2b7dcc9dc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -6d52398d988a52619a17c64ccf1b9364ffbe3373 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/config b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/config deleted file mode 100644 index dc60b0371..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/config +++ /dev/null @@ -1,9 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true -[gui] - wmstate = normal - geometry = 1920x956+-440+106 412 315 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/description b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/gitk.cache b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/gitk.cache deleted file mode 100644 index 48defe966..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/gitk.cache +++ /dev/null @@ -1,3 +0,0 @@ -1 1 -b3bc7a6110915bb39139242769f19014b78d4f0d 75af4f5b0d795d93599bfce074959dfe52de5013 {3a45bee1ef44b61672104f390d4fda9182ec4b3e 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 49f469f4fbc0e93537f2ffa002169a21fa0acfd8 75af4f5b0d795d93599bfce074959dfe52de5013} -1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/index b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/index deleted file mode 100644 index e636fbbf2..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/logs/HEAD deleted file mode 100644 index 05881f65b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/logs/HEAD +++ /dev/null @@ -1,17 +0,0 @@ -0000000000000000000000000000000000000000 75af4f5b0d795d93599bfce074959dfe52de5013 Renata 1582208683 +0100 commit (initial): Initial metadata -75af4f5b0d795d93599bfce074959dfe52de5013 49f469f4fbc0e93537f2ffa002169a21fa0acfd8 Renata 1582209508 +0100 commit: Added initial targets -49f469f4fbc0e93537f2ffa002169a21fa0acfd8 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582209766 +0100 commit: Updated target repos -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 3a45bee1ef44b61672104f390d4fda9182ec4b3e Renata 1582209940 +0100 commit: Updated target of delegated role 1 -3a45bee1ef44b61672104f390d4fda9182ec4b3e b3bc7a6110915bb39139242769f19014b78d4f0d Renata 1582210067 +0100 commit: Updated target of delegated role 2 -b3bc7a6110915bb39139242769f19014b78d4f0d 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582210883 +0100 reset: moving to HEAD~2 -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582211104 +0100 reset: moving to HEAD -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582211539 +0100 reset: moving to HEAD -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582218503 +0100 reset: moving to HEAD -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 675a11576c9d04d0133a9310bacc17dce5b57820 Renata 1582219322 +0100 commit: Updated delegated role 1 target -675a11576c9d04d0133a9310bacc17dce5b57820 675a11576c9d04d0133a9310bacc17dce5b57820 Renata 1582219457 +0100 reset: moving to HEAD -675a11576c9d04d0133a9310bacc17dce5b57820 065861eb323c2dc984d2b02a0d748e3985ed2181 Renata 1582219587 +0100 commit: Updated delegated role 2 target -065861eb323c2dc984d2b02a0d748e3985ed2181 133d243cf01e396959386f1035e2b83b849b2069 Renata 1591100935 +0200 commit: Updated repositoriesdb -133d243cf01e396959386f1035e2b83b849b2069 133d243cf01e396959386f1035e2b83b849b2069 Renata 1591101226 +0200 reset: moving to HEAD -133d243cf01e396959386f1035e2b83b849b2069 6d52398d988a52619a17c64ccf1b9364ffbe3373 Renata 1591101697 +0200 commit: Updated repositories.json again -6d52398d988a52619a17c64ccf1b9364ffbe3373 065861eb323c2dc984d2b02a0d748e3985ed2181 Renata 1591110067 +0200 reset: moving to HEAD~2 -065861eb323c2dc984d2b02a0d748e3985ed2181 dcf4cafef3a1651d12603f8169b0d9a5335bfd3e Renata 1591113808 +0200 commit: Added mirrors.json diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/logs/refs/heads/master deleted file mode 100644 index a96c3463c..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/logs/refs/heads/master +++ /dev/null @@ -1,12 +0,0 @@ -0000000000000000000000000000000000000000 75af4f5b0d795d93599bfce074959dfe52de5013 Renata 1582208683 +0100 commit (initial): Initial metadata -75af4f5b0d795d93599bfce074959dfe52de5013 49f469f4fbc0e93537f2ffa002169a21fa0acfd8 Renata 1582209508 +0100 commit: Added initial targets -49f469f4fbc0e93537f2ffa002169a21fa0acfd8 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582209766 +0100 commit: Updated target repos -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 3a45bee1ef44b61672104f390d4fda9182ec4b3e Renata 1582209940 +0100 commit: Updated target of delegated role 1 -3a45bee1ef44b61672104f390d4fda9182ec4b3e b3bc7a6110915bb39139242769f19014b78d4f0d Renata 1582210067 +0100 commit: Updated target of delegated role 2 -b3bc7a6110915bb39139242769f19014b78d4f0d 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582210883 +0100 reset: moving to HEAD~2 -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 675a11576c9d04d0133a9310bacc17dce5b57820 Renata 1582219322 +0100 commit: Updated delegated role 1 target -675a11576c9d04d0133a9310bacc17dce5b57820 065861eb323c2dc984d2b02a0d748e3985ed2181 Renata 1582219587 +0100 commit: Updated delegated role 2 target -065861eb323c2dc984d2b02a0d748e3985ed2181 133d243cf01e396959386f1035e2b83b849b2069 Renata 1591100935 +0200 commit: Updated repositoriesdb -133d243cf01e396959386f1035e2b83b849b2069 6d52398d988a52619a17c64ccf1b9364ffbe3373 Renata 1591101697 +0200 commit: Updated repositories.json again -6d52398d988a52619a17c64ccf1b9364ffbe3373 065861eb323c2dc984d2b02a0d748e3985ed2181 Renata 1591110067 +0200 reset: moving to HEAD~2 -065861eb323c2dc984d2b02a0d748e3985ed2181 dcf4cafef3a1651d12603f8169b0d9a5335bfd3e Renata 1591113808 +0200 commit: Added mirrors.json diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/06/5861eb323c2dc984d2b02a0d748e3985ed2181 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/06/5861eb323c2dc984d2b02a0d748e3985ed2181 deleted file mode 100644 index 58d084a1e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/06/5861eb323c2dc984d2b02a0d748e3985ed2181 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/07/311cbf1c720849ff41bc1ca958edda075282d5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/07/311cbf1c720849ff41bc1ca958edda075282d5 deleted file mode 100644 index 61c1bea22..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/07/311cbf1c720849ff41bc1ca958edda075282d5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/08/e549a5c36cb33638d919297fe904de26d82373 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/08/e549a5c36cb33638d919297fe904de26d82373 deleted file mode 100644 index 73c8732ff..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/08/e549a5c36cb33638d919297fe904de26d82373 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/09/d36265540d942fc1c1ecdd9840d9c1058b00dc b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/09/d36265540d942fc1c1ecdd9840d9c1058b00dc deleted file mode 100644 index f3bb6a575..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/09/d36265540d942fc1c1ecdd9840d9c1058b00dc and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0b/fb3b1140022b7a566925c47788ba708e6891c5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0b/fb3b1140022b7a566925c47788ba708e6891c5 deleted file mode 100644 index 1d48eeb0d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0b/fb3b1140022b7a566925c47788ba708e6891c5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0d/6ab5e65b842074d7c5faddaf3741a3119f364d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0d/6ab5e65b842074d7c5faddaf3741a3119f364d deleted file mode 100644 index 70ad8bfa7..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0d/6ab5e65b842074d7c5faddaf3741a3119f364d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0f/0e33594798ef6c538cb5b786cf5df79c8bef3a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0f/0e33594798ef6c538cb5b786cf5df79c8bef3a deleted file mode 100644 index c70e2d224..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/0f/0e33594798ef6c538cb5b786cf5df79c8bef3a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/10/18904fc92c8ca105ec4ca3c245a1c735fb085e b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/10/18904fc92c8ca105ec4ca3c245a1c735fb085e deleted file mode 100644 index 89691104a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/10/18904fc92c8ca105ec4ca3c245a1c735fb085e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/13/3d243cf01e396959386f1035e2b83b849b2069 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/13/3d243cf01e396959386f1035e2b83b849b2069 deleted file mode 100644 index c67b66b64..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/13/3d243cf01e396959386f1035e2b83b849b2069 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/19/9082901fcfc16b844c2e6d583b8b41a1b2395f b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/19/9082901fcfc16b844c2e6d583b8b41a1b2395f deleted file mode 100644 index 8065753a0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/19/9082901fcfc16b844c2e6d583b8b41a1b2395f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 deleted file mode 100644 index 316e2141e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/20/94633604881276f1751cc28ce070cc2ff5ce12 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/20/94633604881276f1751cc28ce070cc2ff5ce12 deleted file mode 100644 index 3ced00b97..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/20/94633604881276f1751cc28ce070cc2ff5ce12 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/23/393edb70c5995054a268ae65f926ab64a1b843 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/23/393edb70c5995054a268ae65f926ab64a1b843 deleted file mode 100644 index bab906883..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/23/393edb70c5995054a268ae65f926ab64a1b843 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/2b/f26e9abb1d708dc5f665df071a045f4fd8e76b b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/2b/f26e9abb1d708dc5f665df071a045f4fd8e76b deleted file mode 100644 index cc09258af..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/2b/f26e9abb1d708dc5f665df071a045f4fd8e76b +++ /dev/null @@ -1,2 +0,0 @@ -xSËn%E e¯¸ê53r¹üª|+Š\UöI”{AŒPþç4° ©»Õíöëœ:g><ÍSÃFßüys:Î÷ŸýòÛKœÛÓ7§SO§ã—ø|¿+rPx*Yª÷>êR…¹»â–†êAÝ{A· ´m¢Ì«ÅÇ·×~5æ­›ê„íÒ’()cÌacwY4šdèؾÍ9; …Lzƒ¦PÝ£j9çFÖ=Æè™Ëë#±ª 5ƳÚOꋈ†û±Üd3wÄpU$vÍ•ÂjRÃhî6ZŒZ¯9ŒÁc«NÝ–n 8£À÷!lkؤHO›»å²E9f#3å­“›·aÖº/ב^ÐFT{†Ä@@y;û ÄÍP¶xö¾ ’ÓìEmLE—šf‘Ü &dî­… yÍÕŠ‚î±GkH";Å\ ÐÈà*k³Cã…L¬sM¤](HJ+%¹B£½N©+D››V SUÆX¹e—PѤ„$RÏËÝ¡ŽnyÉÁ¥ÔÙe®,kX±XiZ‹e†×›ÓeŠ«óâÍcoŽ;î.ŸŸãÍ"çG>ÿôt¹çˆ?žïß½y”ZàÈß5ºEº…þý{Ò¯qñ¿ûœŽñÉ/±ï^ž¢}üùüôøÏÏÓñ{¼œï¯~óåë»;ÿ[ƒÿ«æåééòÕÄö¯æù—óWsû5·×eŽós¬»/kí#¼£ü“›"ñõ/K,O \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/2c/1d7b8978e360d175d5ae4f4c828ffb3a8d7d0d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/2c/1d7b8978e360d175d5ae4f4c828ffb3a8d7d0d deleted file mode 100644 index afdd93045..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/2c/1d7b8978e360d175d5ae4f4c828ffb3a8d7d0d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/34/63dbab621993a56b7f0307d6fe91fbc02e1859 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/34/63dbab621993a56b7f0307d6fe91fbc02e1859 deleted file mode 100644 index a278ed0e2..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/34/63dbab621993a56b7f0307d6fe91fbc02e1859 +++ /dev/null @@ -1,2 +0,0 @@ -xuSÛŽœ5 æzŸbô_Óʇ$vö9¸¡Ê‰í²°tW;¢BûîxfA-•F¿4Žã|þëñi°}÷÷Ýé8?|üd—?^â|ÜŸ~º;ªx:¿Åç¯ÊÑÂRš¦ó¬Ÿ,g!Hb=¢±qÎA¦¤®Czß²Žïoóê™ë´…—‰.àÒÚä>„fFlíÛZ$Íåh &c¹ð^ÀK­õŒ±¹‰ê‚l Ve Á‰kCßÑT%¢àiª±w¯¨ -–úZÚ”Œ´{!1gÄ$GÜ ecËÀôZ@ÚÚ”0Ûœ]ØW¡m<a†w Vš{I’´‘}Ù¢‰a³x ±Zm×Pb z´Z >Í r+šjGté³í`•A8¹&¡g¯+sÙ¶Z« b…¦«¤‰ÜÓ]€ÆØu¶ ÅGÚžŒ{3+¸çÞ–ÔÌa¦†Õ¶¾;qÓUÔì5<[Öó> uJ“n#Ûè4ŠÝ‘ JÓ1Š;ÑzoÓ@Ú¢Ü@0Š]qò=#Éõj¾Ä¬Ê\*Ì}SDBvÑf“g«¿{B¨Ï ^rìÂÒ—b†a¢( §dé¾Qy”E¦!gŸ»fÌèÔVî@¥ íµ‹˜¡Ò¬ìR®2 \R¶Ú.1÷P.ûÍš%¤­IÙ#\e6Þ½xɸz¹HŠ^MZàV °©¨S°,äÛ¹ï,R¨Dôá^úcòZ2 ‘ ’ ôØ%æƒÍúQax½;ý\¡¸%/®»&îøpùü׈œ?Ùóù—§Ë-8Güõüð–̓Šñw@ïH~@½ÇyÏóÇ·¦ßãbÿÎ9ñÑ.á^žßÿz~úôßáéø3^ηB»æòõ-ÿ¿Cß¼Ã_Ýyyzº|³¿j¼ØËǸœ¿ÙK·ÞúÜÀççؾÀ<ð=¼mù¥VÐ_ï^ÿTMS \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/35/1feadd89a19a88d3d865c6021280306fc34a19 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/35/1feadd89a19a88d3d865c6021280306fc34a19 deleted file mode 100644 index 0c0da2e35..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/35/1feadd89a19a88d3d865c6021280306fc34a19 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/36/422c689bed6fd5fa08c3f63c3b4a98d3859c20 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/36/422c689bed6fd5fa08c3f63c3b4a98d3859c20 deleted file mode 100644 index bee1afdf0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/36/422c689bed6fd5fa08c3f63c3b4a98d3859c20 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/37/656850e009b57d49eb5146c1354a617d9ad937 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/37/656850e009b57d49eb5146c1354a617d9ad937 deleted file mode 100644 index 3d58e3108..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/37/656850e009b57d49eb5146c1354a617d9ad937 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/38/0a81f5f1a0b3ea2c05072d9d02337ebf5c8f05 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/38/0a81f5f1a0b3ea2c05072d9d02337ebf5c8f05 deleted file mode 100644 index 60d7347d0..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/38/0a81f5f1a0b3ea2c05072d9d02337ebf5c8f05 +++ /dev/null @@ -1,3 +0,0 @@ -x½Á -ƒ0 †wÕ§žÕ¢Žöc·á¡Öà -ÕJ›²ÃðÝW++ˆŽ¶ÐC’&ÿÿ¥‘ªINÅñðŒDèŒ@¥rN–®ÿXfdè•éðâ&‹Õˆ³Z΋7/7wÞAòœ.ωwb 3;¶ Ag-Hè\ÖfZI0tßm%Z§qE„[ƒªß€Ì¶„I©™˜Å; (¸wàªï:JÔV’S¨¦4¤d¥Ü’^^’@3ßU‡êfõWÌê#¦žâéˆV¤å \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/38/fc13d53e917d2d611c49cad553d4dd18d643f5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/38/fc13d53e917d2d611c49cad553d4dd18d643f5 deleted file mode 100644 index e2588ebc9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/38/fc13d53e917d2d611c49cad553d4dd18d643f5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/39/a7eb67b5806aaca554c7df624ec19898452be5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/39/a7eb67b5806aaca554c7df624ec19898452be5 deleted file mode 100644 index a365dd6e1..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/39/a7eb67b5806aaca554c7df624ec19898452be5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/3a/45bee1ef44b61672104f390d4fda9182ec4b3e b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/3a/45bee1ef44b61672104f390d4fda9182ec4b3e deleted file mode 100644 index 9bc7b6620..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/3a/45bee1ef44b61672104f390d4fda9182ec4b3e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/3c/d17636fb3c59404247846f385fd9d2ba6eb8f8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/3c/d17636fb3c59404247846f385fd9d2ba6eb8f8 deleted file mode 100644 index 2b2201441..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/3c/d17636fb3c59404247846f385fd9d2ba6eb8f8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/43/5e1c07ba77ae291435d40a12b232d57d8ac315 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/43/5e1c07ba77ae291435d40a12b232d57d8ac315 deleted file mode 100644 index eb4344aa6..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/43/5e1c07ba77ae291435d40a12b232d57d8ac315 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a deleted file mode 100644 index 328e2453d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/49/f469f4fbc0e93537f2ffa002169a21fa0acfd8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/49/f469f4fbc0e93537f2ffa002169a21fa0acfd8 deleted file mode 100644 index c650c7b33..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/49/f469f4fbc0e93537f2ffa002169a21fa0acfd8 +++ /dev/null @@ -1,3 +0,0 @@ -x•ÎQjÃ0Ð~ëû_(kIk¯ „ô -½ÁJZ¹‚ØÎ&篮пaà1SŽmëÞÇ;U!ǹÅ1ÏLœï±´ b«:Ï 90»‡œº,$-6ÊX—D5J)·Á—˜(Õ¦ä«NÁÉË~~t¸¼‡oë&ýþUŽí -ñØJ„ Ÿ8!ºÑŽs¦ÿdî»V­Ð÷n]î`r®jO÷Fv \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/2ab083dc1000aadc8376974d78f5e19ce0b934 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/2ab083dc1000aadc8376974d78f5e19ce0b934 deleted file mode 100644 index 6e958c615..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/2ab083dc1000aadc8376974d78f5e19ce0b934 +++ /dev/null @@ -1 +0,0 @@ -xSÑŽ$5 äy¿bÔÏÜÉvì8¾ïà „Vvâ Ëíjg@œÐþ;žYÐÁÃIhZÓ݉»R®rÅãSœ¿ùóîtœ>~òËo/y>>œ~¸;jñt:~ÉÏ«VNßÊc«·fu©B¬¦´:’z¦dró¶­“4Öè:@db®Ô8¾½áÕ1W4_Ú B¢­Á]3±±ÍÙ ÷š®C±m0ëŒÖË°yÝmsÄÒ§wîumº[ììé ÔÕ2HÃÈ`…€ƒŽèؼg+G7™-)Ë—b¾©~{Ÿ²)ªmïsÌ #Š7ap“ *Ãkj¨H˜ÅFiŒdhC­ Š=k†°ŒMáBdFuÎ%ÙÅ…K³=UsŽœˆ­<”VÊòð’ZÈÔ²nk҆ݨz³˲UÇ1Çì5¶(R’Õ™S“3(wㆦ!ÅdL.EdY¯†°eÉS†µ½{·iWÌ4ǾEë[vØÞW'ûì]ÌIijÙQax½;ýX¡¸%/¯»&|~ÎkDΟüùüÓÓåœ#ÿx~xËæA@ðèéw(¸þþ­è×¼øß8§cåc~ôK®û—§ÇÄ÷?ŸŸ>ý³y:~Ï—óÃm¯¹|}Kç¿¡ÿõÍËÓÓå«…ø/ð‹¿|ÌËù«µt«­¿™ãüœóþ ÍßÃ[—_Öä®D|ý ŽBMü \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/5b8d339e8b6928dbeb7e8bb25014e62c04586e b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/5b8d339e8b6928dbeb7e8bb25014e62c04586e deleted file mode 100644 index c8e8847fd..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/5b8d339e8b6928dbeb7e8bb25014e62c04586e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/ca6a3ca7794d727aa754b230f6ee9e2eaa5219 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/ca6a3ca7794d727aa754b230f6ee9e2eaa5219 deleted file mode 100644 index f8286268a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/50/ca6a3ca7794d727aa754b230f6ee9e2eaa5219 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/55/a9112df980755786110f1407ee497df3a1d202 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/55/a9112df980755786110f1407ee497df3a1d202 deleted file mode 100644 index 654d3a6b3..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/55/a9112df980755786110f1407ee497df3a1d202 +++ /dev/null @@ -1 +0,0 @@ -x½P_ ‚0ïU?…ܳ&%$ô1¢·èaéaƒéd»~÷æI‘ÑC5»Ýn¿¥Qž¯f—0ò ¶ÚJÒF¢…u4tù¥5ÚV˜n…©6~r1á1gTÿqÇp}ç¶`>O‡íÁ+Ù¤„–×–‚Ð$%*¬|U&F+´ék¶è>ƒ €ÂYÒõ“ž„Rú”¸F8:bC²`†B×µ$¯’ŒC €Î-šŒhºû­‹ï%¼Ò·|?Lc9–éÓ¸%ÍÖßÅ2˜Øíæs·Ù_Ýfßq;ypËéuaw~íÅæ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/56/3ec629e3ca145321906e2b9c05dacab754ffba b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/56/3ec629e3ca145321906e2b9c05dacab754ffba deleted file mode 100644 index 61f76fcf9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/56/3ec629e3ca145321906e2b9c05dacab754ffba and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/56/e55733885bb7468a54c08e479fab3fbacb95d8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/56/e55733885bb7468a54c08e479fab3fbacb95d8 deleted file mode 100644 index 79f457cb8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/56/e55733885bb7468a54c08e479fab3fbacb95d8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/57/71c016f51c715afe5620e6b3d89c8d60841d19 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/57/71c016f51c715afe5620e6b3d89c8d60841d19 deleted file mode 100644 index b47099583..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/57/71c016f51c715afe5620e6b3d89c8d60841d19 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/5e/77c3404878642e880a4badcbae0872ee112d51 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/5e/77c3404878642e880a4badcbae0872ee112d51 deleted file mode 100644 index 19aed1cb2..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/5e/77c3404878642e880a4badcbae0872ee112d51 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/5f/c4d344dec9db2442dfb16a9c10f0b704cdbf1b b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/5f/c4d344dec9db2442dfb16a9c10f0b704cdbf1b deleted file mode 100644 index 7cd54b5e6..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/5f/c4d344dec9db2442dfb16a9c10f0b704cdbf1b and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/60/662b905abd07315157f7a8d275866e04331efb b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/60/662b905abd07315157f7a8d275866e04331efb deleted file mode 100644 index abc2e467d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/60/662b905abd07315157f7a8d275866e04331efb and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/62/fd48fb7398986d346c569eeb28055687ecee39 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/62/fd48fb7398986d346c569eeb28055687ecee39 deleted file mode 100644 index 14894a9e9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/62/fd48fb7398986d346c569eeb28055687ecee39 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/64/b70aac440e1c1ad7280863bb692446dc79dc3b b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/64/b70aac440e1c1ad7280863bb692446dc79dc3b deleted file mode 100644 index 53bf603b4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/64/b70aac440e1c1ad7280863bb692446dc79dc3b and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 deleted file mode 100644 index 2c7e0aaf5..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/67/4d1a405f939a7e320b81e8b34e9207b9278789 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/67/4d1a405f939a7e320b81e8b34e9207b9278789 deleted file mode 100644 index 9c8d7459f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/67/4d1a405f939a7e320b81e8b34e9207b9278789 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/67/5a11576c9d04d0133a9310bacc17dce5b57820 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/67/5a11576c9d04d0133a9310bacc17dce5b57820 deleted file mode 100644 index 4611b5ff2..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/67/5a11576c9d04d0133a9310bacc17dce5b57820 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/6d/52398d988a52619a17c64ccf1b9364ffbe3373 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/6d/52398d988a52619a17c64ccf1b9364ffbe3373 deleted file mode 100644 index 929ca45e7..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/6d/52398d988a52619a17c64ccf1b9364ffbe3373 +++ /dev/null @@ -1 +0,0 @@ -x•ŽAj!E³öµª¬¶[!„œa (µœÒmc›œ?^!»Ç‡÷y©í{`yy]pc¢ ¥Í¢_B) ÅDI‚óš³à欷ٙSºˆ9Û…SARkpýZÙ©žã¼ˆ×`äg|¶=d¼þN{‚îR¿ï©ío@.!­aƒZD3×7ôŸšù8³ ÍÐõlW­W½î_W;@žRóJ*IŽ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/6f/6a596212998cf979d524ba2e75d3102df093f1 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/6f/6a596212998cf979d524ba2e75d3102df093f1 deleted file mode 100644 index a9eb627d4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/6f/6a596212998cf979d524ba2e75d3102df093f1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/73/465573a9be30eec3fea9fd26f6deb8e8547be2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/73/465573a9be30eec3fea9fd26f6deb8e8547be2 deleted file mode 100644 index 62277f75e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/73/465573a9be30eec3fea9fd26f6deb8e8547be2 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/73/c29ea58f9f0a4130009731defb2bbd331f08ba b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/73/c29ea58f9f0a4130009731defb2bbd331f08ba deleted file mode 100644 index 208745093..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/73/c29ea58f9f0a4130009731defb2bbd331f08ba and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/75/a1827f5b4986662073d189f66e4ba4fe540b41 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/75/a1827f5b4986662073d189f66e4ba4fe540b41 deleted file mode 100644 index 50268261c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/75/a1827f5b4986662073d189f66e4ba4fe540b41 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/75/af4f5b0d795d93599bfce074959dfe52de5013 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/75/af4f5b0d795d93599bfce074959dfe52de5013 deleted file mode 100644 index 65bb80e4f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/75/af4f5b0d795d93599bfce074959dfe52de5013 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/76/4950491e223cd0ccf5abb01482a8cdac00d1e4 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/76/4950491e223cd0ccf5abb01482a8cdac00d1e4 deleted file mode 100644 index 8ba470899..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/76/4950491e223cd0ccf5abb01482a8cdac00d1e4 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/7e/ae17781392b913a52d288d6970d2c784d77724 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/7e/ae17781392b913a52d288d6970d2c784d77724 deleted file mode 100644 index 7ec5f01fa..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/7e/ae17781392b913a52d288d6970d2c784d77724 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/86/14901c29c0c21f169fcf817406777a02a1ac58 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/86/14901c29c0c21f169fcf817406777a02a1ac58 deleted file mode 100644 index 34e57efda..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/86/14901c29c0c21f169fcf817406777a02a1ac58 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/88/e510809e2b49e2d12953b551a0eab6c6ea8d59 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/88/e510809e2b49e2d12953b551a0eab6c6ea8d59 deleted file mode 100644 index 3d696812d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/88/e510809e2b49e2d12953b551a0eab6c6ea8d59 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/8c/9ebb6df33276ec8e8f07b8ad4aa7846146ff1b b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/8c/9ebb6df33276ec8e8f07b8ad4aa7846146ff1b deleted file mode 100644 index f69e0936b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/8c/9ebb6df33276ec8e8f07b8ad4aa7846146ff1b and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/8e/aa34662b7cfef68f525b4d45680b9f7b2a227f b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/8e/aa34662b7cfef68f525b4d45680b9f7b2a227f deleted file mode 100644 index d115b238e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/8e/aa34662b7cfef68f525b4d45680b9f7b2a227f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/93/58aac36eaa67d241c4a5ae4bbe6fbf13b588f5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/93/58aac36eaa67d241c4a5ae4bbe6fbf13b588f5 deleted file mode 100644 index 5ccf7dbf4..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/93/58aac36eaa67d241c4a5ae4bbe6fbf13b588f5 +++ /dev/null @@ -1,3 +0,0 @@ -x•ŽQ -Â0DýÎ)ö_ͦIñ ‚Ø6›*ئÄÕó›+ø1ðxÌÌu]Ÿ -Dî MJ³$ ~Šž0úè} 3¹Á‘å){$—hvn²) © ¡§L3JrÞÅB¥0"Ù˜lGžK ôQÜdce8»Ýa¼.+?_§¹®°~$ÂÔ÷àˆÑô¶ŸSùS3÷=³J嶈B“½¾Í§qF4 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/94/a4fd803afd5ce00e15395d2c2e6c12d0510cc2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/94/a4fd803afd5ce00e15395d2c2e6c12d0510cc2 deleted file mode 100644 index 69afba60a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/94/a4fd803afd5ce00e15395d2c2e6c12d0510cc2 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/99/bac5cf5f64900a450608c9457a0913feff05fe b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/99/bac5cf5f64900a450608c9457a0913feff05fe deleted file mode 100644 index edc3580cf..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/99/bac5cf5f64900a450608c9457a0913feff05fe +++ /dev/null @@ -1,6 +0,0 @@ -xuSÁn$E 圯hõ™]Ù®*Û•ïàB‘«ì -‰fÄ -åßqO@»¢nµÔ.—ýüüÞx> ëwßmûåéñÅ®œã²ßo?Ým[·mÿ-¾}"ùÛ}m÷€?¾'ýWû·Î¶{<Ç£]ÃΧçÀÏ¿^N/ÿnûŸq¾<ÝõðåÛ»;ÿ‡>¼S¾¹s>®&â7‰W;?Æõòa.Ýrós³_^c>|…¹ãgxŸòk,¡¿Ý½ý‡dLh \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/9c/248b5aa0e24ac4c22cca3c8b7b49751ad513f7 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/9c/248b5aa0e24ac4c22cca3c8b7b49751ad513f7 deleted file mode 100644 index 9c4d8604f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/9c/248b5aa0e24ac4c22cca3c8b7b49751ad513f7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/a1/ff16a04ef193a4bfbdd27020f42c057d99dcdf b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/a1/ff16a04ef193a4bfbdd27020f42c057d99dcdf deleted file mode 100644 index 9e64cb9cb..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/a1/ff16a04ef193a4bfbdd27020f42c057d99dcdf and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/a6/d9758d43c48e7a3c7483b804573628d1afebf7 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/a6/d9758d43c48e7a3c7483b804573628d1afebf7 deleted file mode 100644 index 84e3a6bd6..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/a6/d9758d43c48e7a3c7483b804573628d1afebf7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/aa/200a6d4637133f2aefe9ad72485b80e6de167d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/aa/200a6d4637133f2aefe9ad72485b80e6de167d deleted file mode 100644 index 5acaf2300..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/aa/200a6d4637133f2aefe9ad72485b80e6de167d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/af/296e52e97d8ad36cf49513616c39021be59576 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/af/296e52e97d8ad36cf49513616c39021be59576 deleted file mode 100644 index 196ee7950..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/af/296e52e97d8ad36cf49513616c39021be59576 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/b3/bc7a6110915bb39139242769f19014b78d4f0d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/b3/bc7a6110915bb39139242769f19014b78d4f0d deleted file mode 100644 index a9f5b57df..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/b3/bc7a6110915bb39139242769f19014b78d4f0d +++ /dev/null @@ -1,3 +0,0 @@ -x•Ž[ -Â0EýÎ*æ_<¦I -"®Ap“dZ mSÂèú îÀ¯{8pàæºm‹€uá$<¦ ‰2¢f“ •`£ŽÞ¥äG‹èKcÉ.©ƒïŽpH̆'ÄäÖhœÜ¨ N…F-gLŽ½åU´ÂãC c¹jÆi½ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/c9/34bbf2e5801547db9547aee607c89650ae07d3 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/c9/34bbf2e5801547db9547aee607c89650ae07d3 deleted file mode 100644 index 81ef925c9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/c9/34bbf2e5801547db9547aee607c89650ae07d3 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/c9/b4be575bb2618b03ffe8737998362294622b77 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/c9/b4be575bb2618b03ffe8737998362294622b77 deleted file mode 100644 index 30cf9a033..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/c9/b4be575bb2618b03ffe8737998362294622b77 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cb/d57a49f726d3dbd1b0dc9367c4afca4cc78014 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cb/d57a49f726d3dbd1b0dc9367c4afca4cc78014 deleted file mode 100644 index 5768232bd..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cb/d57a49f726d3dbd1b0dc9367c4afca4cc78014 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cb/e87ce4d5a37acff7439973e906ce1fa51e0a85 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cb/e87ce4d5a37acff7439973e906ce1fa51e0a85 deleted file mode 100644 index ea1d58c4b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cb/e87ce4d5a37acff7439973e906ce1fa51e0a85 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cc/7614e6975305f951c746c4725d9909dbf2d619 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cc/7614e6975305f951c746c4725d9909dbf2d619 deleted file mode 100644 index cfd0732f3..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cc/7614e6975305f951c746c4725d9909dbf2d619 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cd/77529bd79b5377a0957e13d9d375aa628679ba b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cd/77529bd79b5377a0957e13d9d375aa628679ba deleted file mode 100644 index 7b745dde8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/cd/77529bd79b5377a0957e13d9d375aa628679ba and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/ce/3ab0ae79d900bb5172f6d38ba201188f945e49 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/ce/3ab0ae79d900bb5172f6d38ba201188f945e49 deleted file mode 100644 index f87caef7f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/ce/3ab0ae79d900bb5172f6d38ba201188f945e49 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d3/11998626541793a40f2cf38a869a45fbddc068 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d3/11998626541793a40f2cf38a869a45fbddc068 deleted file mode 100644 index 56bb7eba6..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d3/11998626541793a40f2cf38a869a45fbddc068 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d6/3881d67dd415045a04c544fee5b0daafa11e7a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d6/3881d67dd415045a04c544fee5b0daafa11e7a deleted file mode 100644 index 79ca7e239..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d6/3881d67dd415045a04c544fee5b0daafa11e7a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d7/12f9dc5083c372a49c8123517df71d649e7616 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d7/12f9dc5083c372a49c8123517df71d649e7616 deleted file mode 100644 index 719214265..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d7/12f9dc5083c372a49c8123517df71d649e7616 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d8/2f6a66363a12eff289a033c89cbb146c2020b1 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d8/2f6a66363a12eff289a033c89cbb146c2020b1 deleted file mode 100644 index be7a25117..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d8/2f6a66363a12eff289a033c89cbb146c2020b1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d9/30e636e3add19314675285b5d5db1d591b7dc3 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d9/30e636e3add19314675285b5d5db1d591b7dc3 deleted file mode 100644 index eea4c2f96..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/d9/30e636e3add19314675285b5d5db1d591b7dc3 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/dc/729c966fe24f2ae93b7601c1c3e3004dd9b8c2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/dc/729c966fe24f2ae93b7601c1c3e3004dd9b8c2 deleted file mode 100644 index 4aabe99a3..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/dc/729c966fe24f2ae93b7601c1c3e3004dd9b8c2 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/dc/f4cafef3a1651d12603f8169b0d9a5335bfd3e b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/dc/f4cafef3a1651d12603f8169b0d9a5335bfd3e deleted file mode 100644 index de41a5980..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/dc/f4cafef3a1651d12603f8169b0d9a5335bfd3e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e0/265935992502009f9b8979b498712416694ffd b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e0/265935992502009f9b8979b498712416694ffd deleted file mode 100644 index 55120596c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e0/265935992502009f9b8979b498712416694ffd and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e2/37487124b905b7d3fbd4a12b97e6c4c7325d7c b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e2/37487124b905b7d3fbd4a12b97e6c4c7325d7c deleted file mode 100644 index 5630f50e5..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e2/37487124b905b7d3fbd4a12b97e6c4c7325d7c and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e3/3d178b87b820d386b56a8658ca62cdd5c12a69 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e3/3d178b87b820d386b56a8658ca62cdd5c12a69 deleted file mode 100644 index e9ffbcff9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e3/3d178b87b820d386b56a8658ca62cdd5c12a69 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/6afcc97f3bfdb125b97200f70620d3166e3827 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/6afcc97f3bfdb125b97200f70620d3166e3827 deleted file mode 100644 index 671efb554..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/6afcc97f3bfdb125b97200f70620d3166e3827 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/b5b0f8805553ad48b59420bb2474df640adedc b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/b5b0f8805553ad48b59420bb2474df640adedc deleted file mode 100644 index ed9d24069..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/b5b0f8805553ad48b59420bb2474df640adedc and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/ff096d901825e65adc5edf4598303e87e175d0 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/ff096d901825e65adc5edf4598303e87e175d0 deleted file mode 100644 index 3d76cc4ce..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/e5/ff096d901825e65adc5edf4598303e87e175d0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/ec/3f846a78cc01aaf1ee043fd48012bc74cb71de b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/ec/3f846a78cc01aaf1ee043fd48012bc74cb71de deleted file mode 100644 index 9768fbb05..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/ec/3f846a78cc01aaf1ee043fd48012bc74cb71de +++ /dev/null @@ -1 +0,0 @@ -xSËnG ÌY_1˜³mì›úŸÉf+r­°»1lúws¤FNñbOœj²XŲǓmHXùûfÛ/÷Ozýë—ývûõfÛ²¸mûñíafe¯¡‹ëX¬¥Hþ™Áfaš‰5¢EÔ¢eI'+hÌÑy@kŽ1ƒm÷Ú/ÇÝŠV0bç ™U¼„÷( À°ØdT²1¬Ãp˜“æ`=Èr!À%³‰6Ÿ À—²A²™`ùGÓA4³¯«(tœ(] Í1YhôáØ;€Ì5Œˆ\Ì,¤.ž˜Rb¨:—*QaŠBÝ“‰ëmYøà¦ÚKV–4)RWþJâ¸&n•@½£…)£®˜kµ„¤H´RÞ¦ËgÊ€žÄ¼VpgGž5®bªÑ[ʲ’?ª$pæS±êÙL+“f/À:4§Õž¤q:5iÊt^”Û¶dP‰1V,RÓ= Cíkbš{}™Mì•a¬1uÅ8:•IÖ‘ ¸$ÝÉk"F5@méM(µ7°‚‹‹9™NJ83–¼Jtî›ú”AÜ æåD•\5z²TX@µætï’wÓ­ [IýuÚhѺ­ÁTœ-'—ôÌù*%×A½vY­)6HÛ„¤°—¾" ¼TæQ£’'VÑóéQöif’LdQ”´d5³è¸zºž–¯B^ ÕÕÜ•G“Þ ©YŠ‹!°à$,E‡¯´9ýô éPÛ3 /7ÛoŠ×äÅ‘±#qûÝõÛs¹<éóå÷Óõ58{|}~xËæN@ðè=ñG¬·To>½þŒ«þÓgÛg<ƽ^cÞO>_NOÿ~Üö/q¾<¼ðÈåË[:ÿû†~êÍùtºþðªçû¸^þ{sÙ/Ïáw?hîøÞ¶üQKê/7/ßhðMk \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/f7/827807893ee42a4ec834d781824c9856068ebe b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/f7/827807893ee42a4ec834d781824c9856068ebe deleted file mode 100644 index 972da0be9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/f7/827807893ee42a4ec834d781824c9856068ebe and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/f9/8de9065b752075755766ad234321abd504edf7 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/f9/8de9065b752075755766ad234321abd504edf7 deleted file mode 100644 index 112e80cfc..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/f9/8de9065b752075755766ad234321abd504edf7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fa/ee0fffd7fc7662cea0aff117e6af33f589cb8a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fa/ee0fffd7fc7662cea0aff117e6af33f589cb8a deleted file mode 100644 index 813ce6326..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fa/ee0fffd7fc7662cea0aff117e6af33f589cb8a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fc/cebc54e5d17da61cc0eaf3cbe96f20c7489431 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fc/cebc54e5d17da61cc0eaf3cbe96f20c7489431 deleted file mode 100644 index d980e1a3f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fc/cebc54e5d17da61cc0eaf3cbe96f20c7489431 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fd/4a49d3b9fb0abd7999939f5137a2ebb4de0db2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fd/4a49d3b9fb0abd7999939f5137a2ebb4de0db2 deleted file mode 100644 index 245d179df..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fd/4a49d3b9fb0abd7999939f5137a2ebb4de0db2 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fe/7a275d0e6486c5193fb6ba5791d74382bae66d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fe/7a275d0e6486c5193fb6ba5791d74382bae66d deleted file mode 100644 index f574db072..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/objects/fe/7a275d0e6486c5193fb6ba5791d74382bae66d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/refs/heads/master deleted file mode 100644 index 767085c8b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -dcf4cafef3a1651d12603f8169b0d9a5335bfd3e diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/1.root.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/1.root.json deleted file mode 100644 index a6d9758d4..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/1.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714", - "sig": "9a2dcabb06679edced2c2cd676eb01932a8a7d17bff3b98135e889ce8ac48415035a53cddd2269cf6a0ccc3c80a9d334e1c15d5551405fd81543492e77c1eef75ed785891f9aa388d9d3daeab44bf2c247464aead34d8ce4a1b680a55f2c0dd7a759ab5f030fe2e136a89d81c237edc14bf94ec48e585cb336828043faaec691889a60b2afa4c2e165f471548fa83bf11d95a3146801ef0fcd9477eea06c92a2767ec5e98014279b4e773833a513f96179c8a5db6b9a6ec96de1e5115cd61d2fa968c86077eec06fafd12a004158e1fb3296b6050d1a5a7a448cbb10ca48d810298cc08e926828a88864191d0f591a8249f41eff7d424ccb6499ecd870ecd8dfa13b948002908d8709a8d1790a064d4bb5ff229bf75b9f0238ff7ed4b7ef4e6d21157f988a22043eb184876aa4bf56097ec480eae4f9b031350c0f099689f1e213875498d19bdda3c627bbcfbac2844285e5b666b221c0f3ba2400a743d37d4b8b9ea1a3a0c2fede44bc7f0c1610390cf0675aabc533e9c99acd64778189cf16" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2021-02-19T20:12:20Z", - "keys": { - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt8lxr3x5fdX888ETUN6L\nheNzR9B6taDcFrxzfhLKHMBr1ibsW6cC65XdFWTjXlyEwv0O6Q8KtRxsZ4VWZC++\njPBmqx64pIwavlKKVTxYKyDiviKaFQSpHFbzWJadyylrnK0TVdPuaOvBv6kfszim\ncIRIPdbqWBCt34UG79fAbDLH23lA5dFhQVEW0v1r8Wt937lj24YCAw9aBLwbkjSs\nyTYHYKJiIb64YK75OCU7BNrG56uwtlGjNDrlDJbWqnkjaSzDp8KhDNm/iq3O1QDq\njTY5WkMR75Kn+cPJ06kxHcJ9sbmorXFBQwiFe9iDe/AQG5xrjkm/vDWLL0iC1ZKP\nM4t1qPRKYiijm4emnZ4IHkx7EgcDBNNoOorsMDj7IQqMb2t2mJsW4/1wjdUGOmWF\nKzFWLYux8uwTQPHinNl12CtQeTkLs5KvDK5Wja/dbps8Riw2+qL5u4auuTP5MHKk\nQdRmlMFDS5B+ka/GyitXucx1WeXp1sZ79WCOn7aTkLMtAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAlVOTOqAJpxv/33JXMObi\nXD3luL+yuDf+rhIEG6II8JA6qbYW8aEx9yj+Ku4sDQD1BLJ44ebEX7qxzLJPv3LC\nYQN12La6nUS9kuK2tI1SISrBKjddaC+p/l+aMqPDT6lnt/qnbsZc2SCNdK0CPAnh\nWSOZyxf+e1ZRkKT20guqNV2W30ww764uNn5ST4SDdKqgQgUBPDaPZSlGLcAXxXCK\nQEP/b8jyiz3BFxZyJwCk2H7e41gG9nBceX/ARvCZFZMuGIR7zK6cd8A+6WDF7eM1\n5onj1lYPLL7Mi+bFAbDzCF75NQL+nSTjn4e9olLfiXap/XbnYck0huRAbaIpDZxC\nIZhX8VUlgeO9Y5/PeS16etCsP/Ch4YL5ijZQma0yUDh5Qmier9X3YHV5nTBYu/zN\n5U9tLzZ+GnKG8jDgKQJwFDLv60Hk27KlrCHkrWXZnI9TIXa7d4cpp5RUVfpU4Dal\nwrWGXzHg/EjYHx5qXJc93dUoGvSKS5Jz/Y8MNeVppIvZAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAufSY8KwZIja0Na750LCC\nHovf3Ktfh7jnmaNXsFvlTXfnyOaHfJTCU+6pXTdAHYoIcnZLEx8gEC1PobibvFqt\nicM4ZDh8OQMlgUofXmGOgwLaRaPYEZ3nZPAQKtE1ISDbyZ61FnjLAQOHXDlA/kUy\nJLH6KBeVS18kvFqCnelgiJADWGroWJP6vRer2WRxvhSKp2Uh9EUL2zSjzo2Kfome\nqp3Lx+AP5tRza2UTnrEPkIjqQUAqUcQN5bRJ77hGWCtjtAx1M3yXs6cou/Au1Xg2\njLeDSbgi+57cxVuYmHUQwk+XLOabXgdUDOav5rBHoU4owXDo2lWI6ktKV1SEsxl7\nNNI6rQ0ef3tbDjhCjjBLYbhEngXAUI/VMHycJB1tIvzVb7zrvuTSYcMmBAS6Tg62\nJgMzAIh7Qc8SUgR9JaDgGGksKSXtEruvR6kGDApHglIUbTgKyT9fh8sZ5m0czzKW\nLBSXwYmZHnt0bKNFdf2gvkqfP4iV4moRkZi5Qzf7BostAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwvyLoT3TNFzwOXbwO5eU\n8eGrIFyXGa97w0cp44l4rASZKJ7I9/AjoCuitKYiodIPtVP5dGtY+dZFNQvXjdQp\n7Te/bDyj4T64jmlOFJ5MT+Qx4g9tqaW6w6v886ZqlUTe422v2cinwXAFlodDMOxK\niZ088vFGON8Ju1jsRN2L3P4tW2mu1wOV6RDUTm+qP3VrxnWo4aleTWAVjU80v/vm\nId4HZvwYDATnkdhKgPsEFTbiPsXil00UKfO5FAExdls1978REdLLfEgLJnYtIOpH\nqmigmGiIchZlGAl8JYrCRrYgMWxiEWnXfQWqRGDJ/AJV6Nbuf9wrStd3i3yPcJHV\nb1oHLBDCCJ6k7Qa3LJIYXk/a/N6NB9g3/Bfg8nJVuCF+LQ8M7mhC9xCXCOjPIyGd\nUNyx4BqxKtSOSSJrR9OLIFDKdxw8kKWC+5DPQXlTA1bAjdMeR6ZXWYLxMOSn2jep\nySAx3eU3UdhOzG7Esw7vMbVa1oyBNloyas7uwXV9tMu1AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/delegated_role1.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/delegated_role1.json deleted file mode 100644 index 435e1c07b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/delegated_role1.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "signatures": [ - { - "keyid": "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1", - "sig": "5030ef06243c74799c24dffee2354d4d68133467df7de0ce01b8042e7b9986deb124cbeec2c1f8288d2574eaaa60981d667991e35afe89cb26e473cc8d1e50923e0785584da86edd74bf87cfadfc59761d39ecb5773878fb9aa2e66c9f48305ed3219949d3e7a30d27e3168a2b61a33c5d2a32f4dcdce14a077e421ba8acafa18cc34dbf3d44ac21f13d7f7cecaf2c14abaff465a68947204ef85499e7bbfe82197e0cfff34d967219ee7d66d457772ce3e4e15a04e0eb9262b4e7dfce2ea033cba1e0a39213ec0b56cf7abf46e985a64ab68466f7e9469735bdea308403a378d0a90220f138983b7039bf57a4522a53e2f78c41710a7cd810c7cbcf4a078f9ffeeb60f8a669ce593c0d5521a5535eab5b6086934942f50207507fd4b146104d0e8c56404ed90b86c2204f4b8e4a7ada1167eb27cba9b34469447d34384fb6828e4fbbd1da3dcce16ec02a8f2bbef3ff084c308057f9406852a44174b60b1853f0cc502a2680426cbf052bac019e203886c5dd97f663ffe750dd5ef0dc4b813f" - }, - { - "keyid": "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3", - "sig": "74b0e1f49e4c68a705337030fcb413892bd0393447aaaf5dc46d86403f4d0d00c4263a190f61ec4837d4932657dda3c147c9f14cf99b58d059d7852da4133a9143d77ca10e3ee5dedfbd9c2ea2a4b855387616e8eade4a062db1572ec2eada056056831b388916ffc44790cf50eeaab6646ee018459d637d134d3ac37f3c6416c66fb4aebd3ff7c74ba9c4defccaeb8a028180c59fecacbd42a853f0bbcc19cc4de45249b3e43d955e71b7811e5b7ffd56d586e69c6610420f063cae90dbcabf0f1c84197af80ce4f7d3bda0da1d49ad46682f48e487a8b0726b5cddd350a71fee7bfed993b5a1fda11cdfd4a3a82a360f21e0fee5591c14af9a87317ae51d5e3b0091a7577fc819db2b363057436abb59b8af461a399ae8c0341506695ac87efbc60b77759a4aca8f2c293bad2269c1a0ea839ee624c2a8257e502d1641f5ac715e1060b88111d53a9b4fc44f152406144d10891c908c125bd7a604ae4d826daa9333d0fd9126357d46fbec0f62e42ec9ac0b187032f9a19621155cb03013aa" - }, - { - "keyid": "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db", - "sig": "733dff366d08511c3f0b0e85465688f27e341e4aedbb3867d6d67ba5c15dc1940cab3485a038d3c13a99e4053d66ea9b718b4b876607e2ea7217ecb73aa693405bd104972747f591113406af37ead5a2a9e00547725614b7f5048bd7bd6a9484d08470af5f5dabb324165a00a88e390366e3efb53c437182d9e489bec5268c28f7b7c105bb2e7a3d89a59d6aa3fa94481380f71a901de81ed26510f6b9eff7de29eec75b10393374d93a98b78918db396958478034b92edd727077e82ca3c69b61fd124b7809d5e602b81859542dcc284a36f4d3dc947e2c89db0e3da7f44de7f077d1c0a6a010bdba2ab47ea9e9b240628579f6c5bbed792ba40a24fdfa8f5fccef5ff1aefa193b1862e4e477e49e9dfde9e9ee99b4e695e1f06858f7af0a41be222d2a46583908a2972a1d722c969ada074f80208971c243e2b50a3c075c8cea5113dafba2846eb6dcd268bd12a098691103787df5209bdc9510298394c51a61c75a5e5cbd065207e9fc535cb520602fc99b4edecf9624f26a4dc82d5f4490" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2020-05-20T18:19:39Z", - "spec_version": "1.0", - "targets": { - "namespace/TargetRepo1": { - "hashes": { - "sha256": "e990ed5fd65bbe79358b4814c7a6870b3f6c344ca037addfc21739d1ce88c3e6", - "sha512": "6e5a3ceb90e8d6ac342c8c7b9b9a94d979e76ccb5fc7649ca2747adf4dd1443e117c8699de8f54c0fae0412c06e620760ab38726fed16714caaf8ce91f77ccab" - }, - "length": 60 - }, - "namespace/TargetRepo2": { - "hashes": { - "sha256": "ff8b894135de7185ae984e1f7e39d6ecae4863b351c468c42fe661b27bb81a21", - "sha512": "5480c6b6f09e37e89b710506edc8c38529fd64b827ed6cae014930152720f021940cc784cd032215b48c3c05b275e85770654ad7ced588da69a6fcb3b5367b89" - }, - "length": 60 - } - }, - "version": 4 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/delegated_role2.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/delegated_role2.json deleted file mode 100644 index e23748712..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/delegated_role2.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "signatures": [ - { - "keyid": "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816", - "sig": "6b8a3078d70efcfa021cfb031e7cd4c05aeb90659d3b78c24d44dc5f8a3392684f5af35491ed065da5ac40ec767d51d3a4eebb478e5096ff391cb19ed180762ec18b9d914265f5224e279e2948e6b1807366477c72db911bc1e3bbedf11fe7af850181e800caaeddfa26924469d4a77395234f94356b2919adcb37f3f96bb6d19b093cadbe73faa272ada661e6078edeff656b3ae89a3d01a1cb7d64bbdec2bf77383b53a67c4dfbc53c26a3c8c9b211c7c809f7804be6f08ff5c46a50b920f2c22af6140c755b4b720e6219b3dbe65a471352ae8a89314c4cf54281fc23087fc22eea20b843da7d2d5a5084f3c3179d37ddcda03949f815088afe180a6807adb0e74176d4e78beccf46b2a97604096044052c649bde412d94c3289eafb582813d1c15ec62b5433a04dcc3c6f7eb39604441fe9d187d8fd8683ed950b74986e6fce7f2cde90f7dd67681ca4d4ed733634350419233c3c9ef39647fd8ffc13eecd7f20d687c4bb7348d28f1c7af815e3ea4dfa28c29968f59683126c232ae37a1" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2020-05-20T18:25:39Z", - "spec_version": "1.0", - "targets": { - "namespace/TargetRepo3": { - "hashes": { - "sha256": "e7c7d7e4757fb13dc7efdfc1ebcab01ff97bf6389c516c9bad4569a3baeb24b2", - "sha512": "18cb07f17f9ba02669c5e5d956df36ce4b75ce5eae75c6e5aefbcec78c4194e390e2ee39867293272e3ca436a74c2b42bde8b3cff738a4648a3ef463a7558c1b" - }, - "length": 60 - } - }, - "version": 4 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/root.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/root.json deleted file mode 100644 index a6d9758d4..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714", - "sig": "9a2dcabb06679edced2c2cd676eb01932a8a7d17bff3b98135e889ce8ac48415035a53cddd2269cf6a0ccc3c80a9d334e1c15d5551405fd81543492e77c1eef75ed785891f9aa388d9d3daeab44bf2c247464aead34d8ce4a1b680a55f2c0dd7a759ab5f030fe2e136a89d81c237edc14bf94ec48e585cb336828043faaec691889a60b2afa4c2e165f471548fa83bf11d95a3146801ef0fcd9477eea06c92a2767ec5e98014279b4e773833a513f96179c8a5db6b9a6ec96de1e5115cd61d2fa968c86077eec06fafd12a004158e1fb3296b6050d1a5a7a448cbb10ca48d810298cc08e926828a88864191d0f591a8249f41eff7d424ccb6499ecd870ecd8dfa13b948002908d8709a8d1790a064d4bb5ff229bf75b9f0238ff7ed4b7ef4e6d21157f988a22043eb184876aa4bf56097ec480eae4f9b031350c0f099689f1e213875498d19bdda3c627bbcfbac2844285e5b666b221c0f3ba2400a743d37d4b8b9ea1a3a0c2fede44bc7f0c1610390cf0675aabc533e9c99acd64778189cf16" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2021-02-19T20:12:20Z", - "keys": { - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt8lxr3x5fdX888ETUN6L\nheNzR9B6taDcFrxzfhLKHMBr1ibsW6cC65XdFWTjXlyEwv0O6Q8KtRxsZ4VWZC++\njPBmqx64pIwavlKKVTxYKyDiviKaFQSpHFbzWJadyylrnK0TVdPuaOvBv6kfszim\ncIRIPdbqWBCt34UG79fAbDLH23lA5dFhQVEW0v1r8Wt937lj24YCAw9aBLwbkjSs\nyTYHYKJiIb64YK75OCU7BNrG56uwtlGjNDrlDJbWqnkjaSzDp8KhDNm/iq3O1QDq\njTY5WkMR75Kn+cPJ06kxHcJ9sbmorXFBQwiFe9iDe/AQG5xrjkm/vDWLL0iC1ZKP\nM4t1qPRKYiijm4emnZ4IHkx7EgcDBNNoOorsMDj7IQqMb2t2mJsW4/1wjdUGOmWF\nKzFWLYux8uwTQPHinNl12CtQeTkLs5KvDK5Wja/dbps8Riw2+qL5u4auuTP5MHKk\nQdRmlMFDS5B+ka/GyitXucx1WeXp1sZ79WCOn7aTkLMtAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAlVOTOqAJpxv/33JXMObi\nXD3luL+yuDf+rhIEG6II8JA6qbYW8aEx9yj+Ku4sDQD1BLJ44ebEX7qxzLJPv3LC\nYQN12La6nUS9kuK2tI1SISrBKjddaC+p/l+aMqPDT6lnt/qnbsZc2SCNdK0CPAnh\nWSOZyxf+e1ZRkKT20guqNV2W30ww764uNn5ST4SDdKqgQgUBPDaPZSlGLcAXxXCK\nQEP/b8jyiz3BFxZyJwCk2H7e41gG9nBceX/ARvCZFZMuGIR7zK6cd8A+6WDF7eM1\n5onj1lYPLL7Mi+bFAbDzCF75NQL+nSTjn4e9olLfiXap/XbnYck0huRAbaIpDZxC\nIZhX8VUlgeO9Y5/PeS16etCsP/Ch4YL5ijZQma0yUDh5Qmier9X3YHV5nTBYu/zN\n5U9tLzZ+GnKG8jDgKQJwFDLv60Hk27KlrCHkrWXZnI9TIXa7d4cpp5RUVfpU4Dal\nwrWGXzHg/EjYHx5qXJc93dUoGvSKS5Jz/Y8MNeVppIvZAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAufSY8KwZIja0Na750LCC\nHovf3Ktfh7jnmaNXsFvlTXfnyOaHfJTCU+6pXTdAHYoIcnZLEx8gEC1PobibvFqt\nicM4ZDh8OQMlgUofXmGOgwLaRaPYEZ3nZPAQKtE1ISDbyZ61FnjLAQOHXDlA/kUy\nJLH6KBeVS18kvFqCnelgiJADWGroWJP6vRer2WRxvhSKp2Uh9EUL2zSjzo2Kfome\nqp3Lx+AP5tRza2UTnrEPkIjqQUAqUcQN5bRJ77hGWCtjtAx1M3yXs6cou/Au1Xg2\njLeDSbgi+57cxVuYmHUQwk+XLOabXgdUDOav5rBHoU4owXDo2lWI6ktKV1SEsxl7\nNNI6rQ0ef3tbDjhCjjBLYbhEngXAUI/VMHycJB1tIvzVb7zrvuTSYcMmBAS6Tg62\nJgMzAIh7Qc8SUgR9JaDgGGksKSXtEruvR6kGDApHglIUbTgKyT9fh8sZ5m0czzKW\nLBSXwYmZHnt0bKNFdf2gvkqfP4iV4moRkZi5Qzf7BostAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwvyLoT3TNFzwOXbwO5eU\n8eGrIFyXGa97w0cp44l4rASZKJ7I9/AjoCuitKYiodIPtVP5dGtY+dZFNQvXjdQp\n7Te/bDyj4T64jmlOFJ5MT+Qx4g9tqaW6w6v886ZqlUTe422v2cinwXAFlodDMOxK\niZ088vFGON8Ju1jsRN2L3P4tW2mu1wOV6RDUTm+qP3VrxnWo4aleTWAVjU80v/vm\nId4HZvwYDATnkdhKgPsEFTbiPsXil00UKfO5FAExdls1978REdLLfEgLJnYtIOpH\nqmigmGiIchZlGAl8JYrCRrYgMWxiEWnXfQWqRGDJ/AJV6Nbuf9wrStd3i3yPcJHV\nb1oHLBDCCJ6k7Qa3LJIYXk/a/N6NB9g3/Bfg8nJVuCF+LQ8M7mhC9xCXCOjPIyGd\nUNyx4BqxKtSOSSJrR9OLIFDKdxw8kKWC+5DPQXlTA1bAjdMeR6ZXWYLxMOSn2jep\nySAx3eU3UdhOzG7Esw7vMbVa1oyBNloyas7uwXV9tMu1AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/snapshot.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/snapshot.json deleted file mode 100644 index d930e636e..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/snapshot.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "signatures": [ - { - "keyid": "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b", - "sig": "363bc10c1ae12173d2ec6cfe6fba61036b0b3072b91583f07d3d3238895b46af5ab78dfec134d0d29871d85b59e622975eecb087a2fa0dfd9168953be0961dc746b76d6d3ef7f8da2698c4740c7e68be8e530777daaf738d1845103f6c2620c52eeb5ae1499a4cf368b977f1464879a86591747a86969e4e63f73558336d875aa96f20bcddf4a320db5bd36c3296512533caa08a80d924fe0ae13624e6e762d0ddcf59cf89489a7cc51a4004ad8018b85e06a5cb896456fba2f3f5c5eb9a3bc70fd70cc53455c9dcc3be43276c9f6eb559725f5bda831cf6ba99591ddc621a997bf88478f46fc503c8a361ea4584820d6e4e1b8fa3c4556e89c49beac35c26db5d6dd8587b2c302e3eee74b5de88e04c7db9bb6f9340c2dbc7aaf797a30ca0c4f039e43fb50491fc63c864bc5fab01eff300851c9d3ff0c86d7d75c901f37b82ddd9208fcbc3f1b0633a36dd1f18e8f14787ab0657f7e36106a1d76d2f34145c766a41d918887e1a70d3630a3d720537fea1b39b6ca8e832c731eae86435b4a1" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2020-06-09T18:02:09Z", - "meta": { - "delegated_role1.json": { - "version": 4 - }, - "delegated_role2.json": { - "version": 4 - }, - "root.json": { - "version": 1 - }, - "targets.json": { - "version": 3 - } - }, - "spec_version": "1.0", - "version": 6 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/targets.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/targets.json deleted file mode 100644 index 37656850e..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/targets.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "signatures": [ - { - "keyid": "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23", - "sig": "78619689a4122ff89f0deec3b9cb0da614b9c373071a78ebfd3e3e476c92309dd407cb4632d3a3e9dbb60d4aa14cf28046a5d26c97d47bcd72d20e518794fdefa861ed29593fbeb9fbddf788fa895e866364d3d5d45e8b421a96e72b4a9073b4a114a9b7808ebd63a21d65e21bcf2c1ea14642139ae206949efffe342c3b96a98093debd0bf9def11a2dc85e592ece4bb00176a497656c16c580b10e53d49457d52f3be0225794e967cbda04bbd2dd01215783bb7cba40292b7d72300f523a45d1fb91e4a8627c8978041b15d80e9d7ac49a58f28859c5ee199577154591e3be87d2670ea2410fecfa81e2cb7141ceb3396b1ab37b2ae493c67e2fc58006ea3fefbc774fb961b1ff8d35c728dd4f5c303c599d136195aad4eaa18a7228f093adabd34c3524d8bd673b08ca23d15234471fefaa40da2fd456f8dd0502484c31dcb052daf9a566f22808847b3cbd07b23d45d629b9ac72f10dd65df10c2959c4b7529fd10df9666484d6b5e7f6bb26e2607ee655a4f59503e19991f05c02144939" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": { - "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA1VArRM8KSmO04ov5RArA\n+lXBK+a5Pn9NuQSUMxyuCGqIRT51VrammOpubgDs+PmXdwKxC6aGqMHtsaU8UJHb\nPxXq8b1Idm8Cac0ypjnwjdPhnpG0GVRSrK9bej2MFCICHz3YkX47wqhMnCyt03hk\ncR718wLdLw3LKIcmNTzx+w2RHzVzsVgfZMpczfc0jOheDz4vUPSc4s3pY8CPmLvu\n9qNpmlWSka4GOY9qdCp6P4FGABUj7RM68UBhuv3w4fBgwhfonUvjEIy0QqzyGt29\ncWpm9eBU7XEuHda2o3DsVB0tLqInk2Yyn6oqnE5jEEgLONQx+XOcQ3MqSUQbtEtj\nocR4aVptstmt0tbAQoa6L4QkGCltpZ5y0zuMpxQ9g46FP4uHQ0qPqGm8ZJKaXY0M\nV+ahDJEuYYGciOlQoyzH3/Iw8PIpAJK0jwTS0U7FQLVlZ+WamZiHgUKglwmZRFe0\nug9B5LvoKRNyxvwrOflu3Ly0wcd/w5LAYK6Nc+bCTLmhAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA4+WTKegsztvnGpOfXKuT\nqx/ZhfZodAyI0ye69G4VHwfVP805O9T6xoKxGDA8PTpxBSe01HgZw5HgW7CJMY1Z\nFwQ0/do2pI1Ef++JyhMNucCaTiyQcAMT50/0WBWMWCemt05kb/Kbdp+ViOc/Ayp1\n5J9ok4+MyCXpBlNdOdsUw3SK6ps1kqMQkiH0jigfZGIYg9zeJ8qDT/EGu0hHSzDw\nxGTBTGPjMvUWXL98ZE1cBJA+ePP6YNQc9qIIxWeMYUO6Kx6O8QoifEdZK/AHGwcY\n4MNVtXsQ61xINtYDl1jTtz1COIBKGNvDWllF5llOZK3vQvbBPgvUpf1Ia4eWl92B\ncWN5d0gAd/rirugT5As6tsB3b4OvI8SxAU0OBqEwqi8uEL9tdB8CCBwHGdMHntJ/\n8dqIpBjNIdI58iGdKTznP2k4yokxE7sIGrM3g3UfZ5Ux8LuUEF7MXsvkTeP057G2\nWqbdaalAw4z3SGJdBDbUO7MIzWdbJVjoeak/jCNQ3pifAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwK53ZZC2/GWry1pdOtFz\n6u7lRu5XwzcBcYHx9q2gsso5MiXrBHV2M5NCjPTJSLnZ9XLhC4bbnIqkeT3VCjVf\nqQn18aj7egTjSZgM+FIYSRzmkwixUt9hFZS0OovLl3MIqqYk/jyyLd/gFC9GODBy\nkVty76wzc+taQfnDpdhE+ZvOy/SCgHwkkhCfiTw0/LXdHiefm5x9ee4KfVrhbTn0\n6ZFzkbzqbXGWgIdSZF4/ZQAG0y/aEsU1e6uKaWdAsH8+qQV8pH80zqc+OHC+1PTk\nV+0POcdvmO1LD85uPi8EtPi66SaGfnNYk5fq/Joq7fo2cRFCuYX6AjMqzqaQ9eaw\nAj4t9DxpbD57oAlJlTnU0/bfmxDNSqnzHDoXU8pkC39QxvbzNlA+IcT0QUWPi7jL\nuBrupBJjg8lobootu7CTJb96R0bBQFE1AHDIzXWkaQzr5JWXoTsizHV3WlYRwe6U\nzvcDLCKJJDQedFs2PxJZ/p3LDULm276ePbGK/EQDAI73AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEArpF5XZXda0P5M5IbOV/t\nhyZpAtGNMPAsCKXbKBJrNbriV4mBs6v6/9oYPdyz2Y1U2fIhLIQWfFCTQddpVL7r\ndU+5fYvrbuteUwd4lZ46SGqL1Xt6nzYG8igdpXWxVJJyTnp2sTT7Btz8CbdTQ5hm\nGYCWsAhPlncHpxnJj1HuZeFPZxs9f6B5TiBCrhicWH2ay9/Lz+mwQk1fDC2VwGD6\nVVMpFtMm8sO8AxV8audi9GjRaOCOTdtlk2mvGtxj/vqB9AMErkgG5Bxer3s2Ry9f\noF0gHOUmmNW4pmk8Iqf0OZpWmGz2Nh1Qgw8IMqQWxsDq0T/1VUxFU0DoLf4qnnI2\nD6RfGuNCB13QanYhXh4apdamIa8fqRnMmdyvvKm7Y9CAZRASW8ltzfVIT/DMmm3s\nbnN4uFoXWvBVihXqBk5Jx2uKDUo3duY/Z9kHp/e+IdGNElLNMQNHJustGHVIq3ES\n7cFlDJze0Z0jXV+TMIMtrFIPmzp3NJaLl7tF2nrk41/bAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": [ - { - "keyids": [ - "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3", - "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1", - "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db" - ], - "name": "delegated_role1", - "paths": [ - "namespace/TargetRepo1", - "namespace/TargetRepo2" - ], - "terminating": false, - "threshold": 1 - }, - { - "keyids": [ - "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816" - ], - "name": "delegated_role2", - "paths": [ - "namespace/TargetRepo3" - ], - "terminating": false, - "threshold": 1 - } - ] - }, - "expires": "2020-08-31T18:02:09Z", - "spec_version": "1.0", - "targets": { - "mirrors.json": { - "hashes": { - "sha256": "a861d98aea38ca29d8cbd238001b58a5cb11e21005c298bb0cac04e591e30667", - "sha512": "92c3bd613bb12acb8f5a9b5e935b5363d2d351844fbfeac595631a3d4a39759a469645adc1fd67dc1e1dccf0e03040fa2160ce15da69607c9406c96db781f720" - }, - "length": 300 - }, - "repositories.json": { - "hashes": { - "sha256": "ab13c727868f9d585b08a3733a5c5a853019856fb34a447c4324673b7cbe3148", - "sha512": "c647cfcd9c7700a32307804e5e2d718612129d463c2af957642fb6cbbac2a867bd8a8d46facafe90e3f202809c1b3c04de2fbde1c3e55805ef0e1a97f62506ac" - }, - "length": 171 - } - }, - "version": 3 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/timestamp.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/timestamp.json deleted file mode 100644 index 75a1827f5..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/metadata/timestamp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "signatures": [ - { - "keyid": "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327", - "sig": "24739c4bde41e3b5d957de5f4792667f9e044ab0b88b8a2e58b5dea91015a313dc78e3c0acc6cf35bf47b1f8e8b720a38730057bc227b2cec337baf1fe2d527aa288cbab832b650d0ca3f15ab884c6ef38d84db64cd639db7db55b26b8847abd71e8384f5a5c268d5d4fe71a0d9473a6dbf4d83880d903dd3b02810550b12db06bea42427055cdfa5b4d95461325ccb0a7b6e8960add64dc8a5b9c92aa6c4dc9007385174857ae34086ad00bacd5a72f2aa48c062029bc838071e3784ec7929cea1f833b2ea9cfd1cde951d87a472b4833b10f9d19d1d0e81cbf5335aa78c3bb35e0965d99b9c421b079e7e76cffed9e9fb251e98e5dc30183ef73267190e6dfd6f79eb8c82700793487a970368db73f157cefd3e4d15852e6541ac13d37446e804ecd972fbf006c1be8590b6e46709c5064cd49797392d10e6f97c623fa9c479906dd0815cb2179ed9844cdf9190c42a12d0fa3c0f43f170567bc7c47f1a434a786e6019c55b14f4aa31d54e4a64c5a4c6c46bf054e03bf7e74a3804f1db612" - } - ], - "signed": { - "_type": "timestamp", - "expires": "2020-06-03T18:02:09Z", - "meta": { - "snapshot.json": { - "hashes": { - "sha256": "a7d0617983be2527a61bf9d62e9a511e1f8db8b2b964c5d10185869cfa2edd43" - }, - "length": 1214, - "version": 6 - } - }, - "spec_version": "1.0", - "version": 6 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/mirrors.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/mirrors.json deleted file mode 100644 index c7d1fa123..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/mirrors.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "mirrors": [ - "https://github.com/{org_name}/{repo_name}.git", - "https://github.com/test/{org_name}-{repo_name}.git", - "https://gitlab.com/{org_name}2/{repo_name}.git", - "https://gitlab.com/{org_name}/{org_name}--{repo_name}.git", - "git@github.com:{org_name}/{repo_name}.git" - ] -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo1 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo1 deleted file mode 100644 index 1018904fc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo1 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "commit": "467a6482e3d43a53b629f8b152af31a6ad4cd0f5" -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo2 deleted file mode 100644 index 8eaa34662..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo2 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "commit": "54369bdc051c041eee84680a69ef0c02953266e1" -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo3 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo3 deleted file mode 100644 index fe7a275d0..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/namespace/TargetRepo3 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "commit": "f24a34c1cf7eda83cce81980649995c3a26a0438" -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/repositories.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/repositories.json deleted file mode 100644 index e33d178b8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/organization/auth_repo/targets/repositories.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "repositories": { - "namespace/TargetRepo1": { - - }, - "namespace/TargetRepo2": { - - }, - "namespace/TargetRepo3": { - - } - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/COMMIT_EDITMSG deleted file mode 100644 index 9e572ce2b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file 3 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/ORIG_HEAD deleted file mode 100644 index f477082ed..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/config b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/description b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/index b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/index deleted file mode 100644 index d1546a379..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/logs/HEAD deleted file mode 100644 index b25ee85bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/logs/HEAD +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1559986692 +0200 commit (initial): Initial test files -c1ecc553f4318637b40fa04032d94a64d3080ea4 bbd3170a8b88b8e454bf3722343bb4a2835a6cce Renata 1560358832 +0200 commit: Updated file 1 -bbd3170a8b88b8e454bf3722343bb4a2835a6cce f724551bff06e7eedc432f4fc7e07ca3b3fe4203 Renata 1560359301 +0200 commit: Updated file1 -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1560433371 +0200 reset: moving to HEAD~2 -c1ecc553f4318637b40fa04032d94a64d3080ea4 467a6482e3d43a53b629f8b152af31a6ad4cd0f5 Renata 1582209605 +0100 commit: Updated file 3 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/logs/refs/heads/master deleted file mode 100644 index b25ee85bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/logs/refs/heads/master +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1559986692 +0200 commit (initial): Initial test files -c1ecc553f4318637b40fa04032d94a64d3080ea4 bbd3170a8b88b8e454bf3722343bb4a2835a6cce Renata 1560358832 +0200 commit: Updated file 1 -bbd3170a8b88b8e454bf3722343bb4a2835a6cce f724551bff06e7eedc432f4fc7e07ca3b3fe4203 Renata 1560359301 +0200 commit: Updated file1 -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1560433371 +0200 reset: moving to HEAD~2 -c1ecc553f4318637b40fa04032d94a64d3080ea4 467a6482e3d43a53b629f8b152af31a6ad4cd0f5 Renata 1582209605 +0100 commit: Updated file 3 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd deleted file mode 100644 index 14c79b160..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/46/7a6482e3d43a53b629f8b152af31a6ad4cd0f5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/46/7a6482e3d43a53b629f8b152af31a6ad4cd0f5 deleted file mode 100644 index 0544039c6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/46/7a6482e3d43a53b629f8b152af31a6ad4cd0f5 +++ /dev/null @@ -1,2 +0,0 @@ -x•ŽQ -1 Dýî)ò/HÚ¤ÝD<ƒàb›ê‚Ý]–êùíüÞ›Ékksg§CßU!‘ŽÉ•)"K"FÕ&_°¢®ºd½&³É®K‡l5gï©2Ùhz0VAÆaH, aD6òé¯u‡›.ÒÎßA¯Ï&óû”×v;¦¦€ŽhÍhǹ®bæ¾éZ Îo2?3Aº \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/4e/c2b2b2f56687e5906f82158ad21938645005ab b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/4e/c2b2b2f56687e5906f82158ad21938645005ab deleted file mode 100644 index 3533e0c09..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/4e/c2b2b2f56687e5906f82158ad21938645005ab +++ /dev/null @@ -1 +0,0 @@ -x-ŒK€ C]{ŠAâÊ{x0ƒL Iäøâ'é¢m^ë¢8˜e›öÀ CMºM%”ºB<<°>®R˜ù¥ßö¬–sƒEdÕÁ9V$©ßú#ÿ_ œOdºn@U(ô \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a deleted file mode 100644 index efa3c3780..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a +++ /dev/null @@ -1 +0,0 @@ -x%‹Á €0 y3…W@<`hQ*"µMÕäÑñ EòÃ>c–ˆóX®‡•B JË£a„Ä>ö¯uj‚mö¤·T \™ÍÜ‹l(Òÿ÷ Ø Ó \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/93/582432d7804a9340ee686095d0f0562f2915e9 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/93/582432d7804a9340ee686095d0f0562f2915e9 deleted file mode 100644 index 8afe4538d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/93/582432d7804a9340ee686095d0f0562f2915e9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 deleted file mode 100644 index 639667dfd..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf deleted file mode 100644 index 342a8d00a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 deleted file mode 100644 index 54149b7f4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 deleted file mode 100644 index 19010f622..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce deleted file mode 100644 index af719c046..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 deleted file mode 100644 index ac48d69dd..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 +++ /dev/null @@ -1 +0,0 @@ -x•‘I›@„sæWô%ƒi6K™(ìf0Ë`–[c §¡Íê±}œ‰rË%ïTú¤R•^ϧ™$+_æ±®‚²ÈK°¬x(JXeIn` ÅZ)áQ€8È e~? ª{4#ð}?…òŸ¡ßŽçÓ°ÅíV‘¤-XŽç8æAasýŸ6|ÁÁàëïÓLÛñA` vl_}K"ó“3€$4jºªV1M—MbyCïæV.ªÃ.Ti»{‰CÓRé]Æ«:î¿œqhekØ°î%ëáŠÔ*ïõhz;Q6Ö÷)~%æR5Nê.¶Ñ_c‘¸—ûé­ã@'§w¥']ï÷½´2mô–6L«¶Wƒ×¾)ä¸4Åu9"o+”ctÝÚ:{wd€:[‚`î±>Á·ê½ Ð(ƒä=:wéÙñ]&[Wg¤ÔkB}³„Š1O;S¾e •Ó ÇÂêá1/8ß_÷¬u-ÙÛAf)½È¥b“†:ùšWQ:!äÝ‚æâÂÜA9ïIÝ@Ÿ´.Dï³9ˆ—ÂU¶™tM²“ßð›(á2ÕÚã 0¬JPÜ‚šÆÐÁÐÔ¦M¡mïžQŸ?:°è­Tr\‡JÛ^^ž<)µÜ×\Y:î<†ÏÏ xŽ’2V5}ã_›2NOf‚(˜ëi ¡õÄü.³ÖÞ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 deleted file mode 100644 index db45f8bc7..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 deleted file mode 100644 index 8904e790b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 deleted file mode 100644 index 74429630c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/refs/heads/master deleted file mode 100644 index ca6979ad2..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -467a6482e3d43a53b629f8b152af31a6ad4cd0f5 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file1.txt deleted file mode 100644 index d539d29be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file1.txt +++ /dev/null @@ -1 +0,0 @@ -This is some example text of file 1 of repo 1 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file2.txt deleted file mode 100644 index c5d432429..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file2.txt +++ /dev/null @@ -1 +0,0 @@ -This is some example text of file 2 of repo 1 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file3.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file3.txt deleted file mode 100644 index 4ec2b2b2f..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo1/repo1_file3.txt +++ /dev/null @@ -1,3 +0,0 @@ -This is some example text of file 3 of repo 1 -This file contains a little bit more text -This is something new \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/COMMIT_EDITMSG deleted file mode 100644 index 4dd9490b0..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file 1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/ORIG_HEAD deleted file mode 100644 index bd8c37a68..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -90f3acd75af70437efbfe218efbec51c14674c1a diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/config b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/description b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/index b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/index deleted file mode 100644 index b6d1662c8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/logs/HEAD deleted file mode 100644 index fa61ef421..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/logs/HEAD +++ /dev/null @@ -1,8 +0,0 @@ -0000000000000000000000000000000000000000 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1559986797 +0200 commit (initial): Initial test files -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 Renata 1560359233 +0200 commit: Updated file2 -00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 3a9c6c6145cd7d8e2beefd5e18335b023e260492 Renata 1560359372 +0200 commit: Added new file file3 -3a9c6c6145cd7d8e2beefd5e18335b023e260492 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1560433380 +0200 reset: moving to HEAD~2 -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 3ed9449df62a95bc9213657966fe46e126a3e7d0 Renata 1582209651 +0100 commit: Updated file 2 -3ed9449df62a95bc9213657966fe46e126a3e7d0 90f3acd75af70437efbfe218efbec51c14674c1a Renata 1582209794 +0100 commit: Updated file 2 -90f3acd75af70437efbfe218efbec51c14674c1a 3ed9449df62a95bc9213657966fe46e126a3e7d0 Renata 1582210710 +0100 reset: moving to HEAD~1 -3ed9449df62a95bc9213657966fe46e126a3e7d0 54369bdc051c041eee84680a69ef0c02953266e1 Renata 1582210968 +0100 commit: Updated file 1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/logs/refs/heads/master deleted file mode 100644 index fa61ef421..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/logs/refs/heads/master +++ /dev/null @@ -1,8 +0,0 @@ -0000000000000000000000000000000000000000 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1559986797 +0200 commit (initial): Initial test files -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 Renata 1560359233 +0200 commit: Updated file2 -00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 3a9c6c6145cd7d8e2beefd5e18335b023e260492 Renata 1560359372 +0200 commit: Added new file file3 -3a9c6c6145cd7d8e2beefd5e18335b023e260492 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1560433380 +0200 reset: moving to HEAD~2 -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 3ed9449df62a95bc9213657966fe46e126a3e7d0 Renata 1582209651 +0100 commit: Updated file 2 -3ed9449df62a95bc9213657966fe46e126a3e7d0 90f3acd75af70437efbfe218efbec51c14674c1a Renata 1582209794 +0100 commit: Updated file 2 -90f3acd75af70437efbfe218efbec51c14674c1a 3ed9449df62a95bc9213657966fe46e126a3e7d0 Renata 1582210710 +0100 reset: moving to HEAD~1 -3ed9449df62a95bc9213657966fe46e126a3e7d0 54369bdc051c041eee84680a69ef0c02953266e1 Renata 1582210968 +0100 commit: Updated file 1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 deleted file mode 100644 index 3aee50134..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 deleted file mode 100644 index 087b472b0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa deleted file mode 100644 index 09d13f56e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 deleted file mode 100644 index 3caceda18..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/3e/d9449df62a95bc9213657966fe46e126a3e7d0 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/3e/d9449df62a95bc9213657966fe46e126a3e7d0 deleted file mode 100644 index efe2b2bb9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/3e/d9449df62a95bc9213657966fe46e126a3e7d0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 deleted file mode 100644 index f04c5be73..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca deleted file mode 100644 index 131a0cd58..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/43/24fc4e11a047cfad90bc0396a0c48643393279 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/43/24fc4e11a047cfad90bc0396a0c48643393279 deleted file mode 100644 index bb07f192c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/43/24fc4e11a047cfad90bc0396a0c48643393279 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 deleted file mode 100644 index adf64119a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/54/369bdc051c041eee84680a69ef0c02953266e1 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/54/369bdc051c041eee84680a69ef0c02953266e1 deleted file mode 100644 index 9b3b843ac..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/54/369bdc051c041eee84680a69ef0c02953266e1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f deleted file mode 100644 index 4855cdd63..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/80/1015d8c8e4791124ee3684bd3e15d9a32cbfab b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/80/1015d8c8e4791124ee3684bd3e15d9a32cbfab deleted file mode 100644 index 7b2ea755e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/80/1015d8c8e4791124ee3684bd3e15d9a32cbfab and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/85/cb3330f98e706daad889da00e62f4c619c0bf0 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/85/cb3330f98e706daad889da00e62f4c619c0bf0 deleted file mode 100644 index dbc2f33be..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/85/cb3330f98e706daad889da00e62f4c619c0bf0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/87/13c348ca5ddb205a06af2c1eb2f16afe8f2ff8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/87/13c348ca5ddb205a06af2c1eb2f16afe8f2ff8 deleted file mode 100644 index dac84f080..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/87/13c348ca5ddb205a06af2c1eb2f16afe8f2ff8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/90/f3acd75af70437efbfe218efbec51c14674c1a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/90/f3acd75af70437efbfe218efbec51c14674c1a deleted file mode 100644 index 9bd51d47c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/90/f3acd75af70437efbfe218efbec51c14674c1a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 deleted file mode 100644 index 4bc9f84e3..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/a6/e32053b53d0bd41730cb0776e80ff8ce7519b0 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/a6/e32053b53d0bd41730cb0776e80ff8ce7519b0 deleted file mode 100644 index 25549d8de..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/a6/e32053b53d0bd41730cb0776e80ff8ce7519b0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/da/3bf63c0f85f4e3b32258a2e8036094b4356ef6 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/da/3bf63c0f85f4e3b32258a2e8036094b4356ef6 deleted file mode 100644 index 0edfc43d8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/da/3bf63c0f85f4e3b32258a2e8036094b4356ef6 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 deleted file mode 100644 index 9d86edc0e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb deleted file mode 100644 index 704fc7fc8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/refs/heads/master deleted file mode 100644 index 58209bc4b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -54369bdc051c041eee84680a69ef0c02953266e1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/repo2_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/repo2_file1.txt deleted file mode 100644 index a6e32053b..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/repo2_file1.txt +++ /dev/null @@ -1 +0,0 @@ -This is some changed example text of file 1 of repo 2 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/repo2_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/repo2_file2.txt deleted file mode 100644 index 8713c348c..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo2/repo2_file2.txt +++ /dev/null @@ -1 +0,0 @@ -This is some changed example text of file 2 of repo 2 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/COMMIT_EDITMSG deleted file mode 100644 index 76c97b17e..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/ORIG_HEAD deleted file mode 100644 index 13f46817f..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/config b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/description b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/index b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/index deleted file mode 100644 index 486cb82c8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/logs/HEAD deleted file mode 100644 index f78ba4611..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/logs/HEAD +++ /dev/null @@ -1,7 +0,0 @@ -0000000000000000000000000000000000000000 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1559986919 +0200 commit (initial): Initial test files -7d5a746e791e512ecaa7bbf644205077e8cce10b 7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 Renata 1560359205 +0200 commit: Updated file3 -7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1560433388 +0200 reset: moving to HEAD~1 -7d5a746e791e512ecaa7bbf644205077e8cce10b bf80d90fb587cc88e7fe70895975c297c4785060 Renata 1582209687 +0100 commit: Updated file 1 -bf80d90fb587cc88e7fe70895975c297c4785060 3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 Renata 1582209977 +0100 commit: Updated file 2 -3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 bf80d90fb587cc88e7fe70895975c297c4785060 Renata 1582210802 +0100 reset: moving to HEAD~1 -bf80d90fb587cc88e7fe70895975c297c4785060 f24a34c1cf7eda83cce81980649995c3a26a0438 Renata 1582219501 +0100 commit: Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/logs/refs/heads/master deleted file mode 100644 index f78ba4611..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/logs/refs/heads/master +++ /dev/null @@ -1,7 +0,0 @@ -0000000000000000000000000000000000000000 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1559986919 +0200 commit (initial): Initial test files -7d5a746e791e512ecaa7bbf644205077e8cce10b 7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 Renata 1560359205 +0200 commit: Updated file3 -7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1560433388 +0200 reset: moving to HEAD~1 -7d5a746e791e512ecaa7bbf644205077e8cce10b bf80d90fb587cc88e7fe70895975c297c4785060 Renata 1582209687 +0100 commit: Updated file 1 -bf80d90fb587cc88e7fe70895975c297c4785060 3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 Renata 1582209977 +0100 commit: Updated file 2 -3dd99691d0f87dc7e28918e17d1e9fa5ad0d8279 bf80d90fb587cc88e7fe70895975c297c4785060 Renata 1582210802 +0100 reset: moving to HEAD~1 -bf80d90fb587cc88e7fe70895975c297c4785060 f24a34c1cf7eda83cce81980649995c3a26a0438 Renata 1582219501 +0100 commit: Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 deleted file mode 100644 index 71e4096be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 +++ /dev/null @@ -1,3 +0,0 @@ -xŒÁ À ûf -PºAwè ‚@ -Œ_@òöÎö,ö¶×—²bI¥hºÒ˜0hHDÌ+Øí:5Ác}ZÇ*HNQ¤8WÒÍí¥ykÀHë&å •~ó¤%^ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/3d/d99691d0f87dc7e28918e17d1e9fa5ad0d8279 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/3d/d99691d0f87dc7e28918e17d1e9fa5ad0d8279 deleted file mode 100644 index 791506c66..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/3d/d99691d0f87dc7e28918e17d1e9fa5ad0d8279 +++ /dev/null @@ -1,2 +0,0 @@ -x•ŽA -Â0E]ç³d’6™ ˆxÁ¤ÉŒš¶”èùÍÜ=>¼ÏË[­sgéÔ–50YžT5Ù1Eƒ#´Aœ–„1³§CÖ“2–ˆ:y¦œ™…T9úH>»Hy$öФO{oÞ” 3¦…àð¥ -Ñ9:4"æ9ÎÕ«ârÛÞÔ‹)’7m„䶼õt?›‚' \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 deleted file mode 100644 index d1f03b94d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/ac/2c1037dccdd65889205d5a076ce95d587fc021 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/ac/2c1037dccdd65889205d5a076ce95d587fc021 deleted file mode 100644 index 77fc65c30..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/ac/2c1037dccdd65889205d5a076ce95d587fc021 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 deleted file mode 100644 index ae368a7a4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/bf/80d90fb587cc88e7fe70895975c297c4785060 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/bf/80d90fb587cc88e7fe70895975c297c4785060 deleted file mode 100644 index d62c0407e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/bf/80d90fb587cc88e7fe70895975c297c4785060 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 deleted file mode 100644 index 711223894..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/e8/618f68718bfffa1493df304627016e2fda099d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/e8/618f68718bfffa1493df304627016e2fda099d deleted file mode 100644 index 73f173de1..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/e8/618f68718bfffa1493df304627016e2fda099d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/f2/4a34c1cf7eda83cce81980649995c3a26a0438 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/f2/4a34c1cf7eda83cce81980649995c3a26a0438 deleted file mode 100644 index 5b3f15b01..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/objects/f2/4a34c1cf7eda83cce81980649995c3a26a0438 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/refs/heads/master deleted file mode 100644 index 90b971346..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -f24a34c1cf7eda83cce81980649995c3a26a0438 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/repo3_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/repo3_file1.txt deleted file mode 100644 index 95a506db2..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/repo3_file1.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 1 of repo 2 -This file also has more lines of text diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/repo3_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/repo3_file2.txt deleted file mode 100644 index 4ebd954b3..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/repo3_file2.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 2 of repo 3 -Adding a new line \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/COMMIT_EDITMSG deleted file mode 100644 index 007c5797f..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated repositories.json again diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/ORIG_HEAD deleted file mode 100644 index f9f1a606e..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -133d243cf01e396959386f1035e2b83b849b2069 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/config b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/config deleted file mode 100644 index dc60b0371..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/config +++ /dev/null @@ -1,9 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true -[gui] - wmstate = normal - geometry = 1920x956+-440+106 412 315 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/description b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/gitk.cache b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/gitk.cache deleted file mode 100644 index 48defe966..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/gitk.cache +++ /dev/null @@ -1,3 +0,0 @@ -1 1 -b3bc7a6110915bb39139242769f19014b78d4f0d 75af4f5b0d795d93599bfce074959dfe52de5013 {3a45bee1ef44b61672104f390d4fda9182ec4b3e 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 49f469f4fbc0e93537f2ffa002169a21fa0acfd8 75af4f5b0d795d93599bfce074959dfe52de5013} -1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/index b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/index deleted file mode 100644 index 8523258b8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/logs/HEAD deleted file mode 100644 index ff0ec9a8d..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/logs/HEAD +++ /dev/null @@ -1,15 +0,0 @@ -0000000000000000000000000000000000000000 75af4f5b0d795d93599bfce074959dfe52de5013 Renata 1582208683 +0100 commit (initial): Initial metadata -75af4f5b0d795d93599bfce074959dfe52de5013 49f469f4fbc0e93537f2ffa002169a21fa0acfd8 Renata 1582209508 +0100 commit: Added initial targets -49f469f4fbc0e93537f2ffa002169a21fa0acfd8 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582209766 +0100 commit: Updated target repos -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 3a45bee1ef44b61672104f390d4fda9182ec4b3e Renata 1582209940 +0100 commit: Updated target of delegated role 1 -3a45bee1ef44b61672104f390d4fda9182ec4b3e b3bc7a6110915bb39139242769f19014b78d4f0d Renata 1582210067 +0100 commit: Updated target of delegated role 2 -b3bc7a6110915bb39139242769f19014b78d4f0d 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582210883 +0100 reset: moving to HEAD~2 -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582211104 +0100 reset: moving to HEAD -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582211539 +0100 reset: moving to HEAD -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582218503 +0100 reset: moving to HEAD -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 675a11576c9d04d0133a9310bacc17dce5b57820 Renata 1582219322 +0100 commit: Updated delegated role 1 target -675a11576c9d04d0133a9310bacc17dce5b57820 675a11576c9d04d0133a9310bacc17dce5b57820 Renata 1582219457 +0100 reset: moving to HEAD -675a11576c9d04d0133a9310bacc17dce5b57820 065861eb323c2dc984d2b02a0d748e3985ed2181 Renata 1582219587 +0100 commit: Updated delegated role 2 target -065861eb323c2dc984d2b02a0d748e3985ed2181 133d243cf01e396959386f1035e2b83b849b2069 Renata 1591100935 +0200 commit: Updated repositoriesdb -133d243cf01e396959386f1035e2b83b849b2069 133d243cf01e396959386f1035e2b83b849b2069 Renata 1591101226 +0200 reset: moving to HEAD -133d243cf01e396959386f1035e2b83b849b2069 6d52398d988a52619a17c64ccf1b9364ffbe3373 Renata 1591101697 +0200 commit: Updated repositories.json again diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/logs/refs/heads/master deleted file mode 100644 index 97a93482a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/logs/refs/heads/master +++ /dev/null @@ -1,10 +0,0 @@ -0000000000000000000000000000000000000000 75af4f5b0d795d93599bfce074959dfe52de5013 Renata 1582208683 +0100 commit (initial): Initial metadata -75af4f5b0d795d93599bfce074959dfe52de5013 49f469f4fbc0e93537f2ffa002169a21fa0acfd8 Renata 1582209508 +0100 commit: Added initial targets -49f469f4fbc0e93537f2ffa002169a21fa0acfd8 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582209766 +0100 commit: Updated target repos -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 3a45bee1ef44b61672104f390d4fda9182ec4b3e Renata 1582209940 +0100 commit: Updated target of delegated role 1 -3a45bee1ef44b61672104f390d4fda9182ec4b3e b3bc7a6110915bb39139242769f19014b78d4f0d Renata 1582210067 +0100 commit: Updated target of delegated role 2 -b3bc7a6110915bb39139242769f19014b78d4f0d 9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 Renata 1582210883 +0100 reset: moving to HEAD~2 -9358aac36eaa67d241c4a5ae4bbe6fbf13b588f5 675a11576c9d04d0133a9310bacc17dce5b57820 Renata 1582219322 +0100 commit: Updated delegated role 1 target -675a11576c9d04d0133a9310bacc17dce5b57820 065861eb323c2dc984d2b02a0d748e3985ed2181 Renata 1582219587 +0100 commit: Updated delegated role 2 target -065861eb323c2dc984d2b02a0d748e3985ed2181 133d243cf01e396959386f1035e2b83b849b2069 Renata 1591100935 +0200 commit: Updated repositoriesdb -133d243cf01e396959386f1035e2b83b849b2069 6d52398d988a52619a17c64ccf1b9364ffbe3373 Renata 1591101697 +0200 commit: Updated repositories.json again diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/06/5861eb323c2dc984d2b02a0d748e3985ed2181 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/06/5861eb323c2dc984d2b02a0d748e3985ed2181 deleted file mode 100644 index 58d084a1e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/06/5861eb323c2dc984d2b02a0d748e3985ed2181 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/07/311cbf1c720849ff41bc1ca958edda075282d5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/07/311cbf1c720849ff41bc1ca958edda075282d5 deleted file mode 100644 index 61c1bea22..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/07/311cbf1c720849ff41bc1ca958edda075282d5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/08/e549a5c36cb33638d919297fe904de26d82373 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/08/e549a5c36cb33638d919297fe904de26d82373 deleted file mode 100644 index 73c8732ff..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/08/e549a5c36cb33638d919297fe904de26d82373 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/09/d36265540d942fc1c1ecdd9840d9c1058b00dc b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/09/d36265540d942fc1c1ecdd9840d9c1058b00dc deleted file mode 100644 index f3bb6a575..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/09/d36265540d942fc1c1ecdd9840d9c1058b00dc and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0b/fb3b1140022b7a566925c47788ba708e6891c5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0b/fb3b1140022b7a566925c47788ba708e6891c5 deleted file mode 100644 index 1d48eeb0d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0b/fb3b1140022b7a566925c47788ba708e6891c5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0d/6ab5e65b842074d7c5faddaf3741a3119f364d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0d/6ab5e65b842074d7c5faddaf3741a3119f364d deleted file mode 100644 index 70ad8bfa7..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0d/6ab5e65b842074d7c5faddaf3741a3119f364d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0f/0e33594798ef6c538cb5b786cf5df79c8bef3a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0f/0e33594798ef6c538cb5b786cf5df79c8bef3a deleted file mode 100644 index c70e2d224..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/0f/0e33594798ef6c538cb5b786cf5df79c8bef3a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/10/18904fc92c8ca105ec4ca3c245a1c735fb085e b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/10/18904fc92c8ca105ec4ca3c245a1c735fb085e deleted file mode 100644 index 89691104a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/10/18904fc92c8ca105ec4ca3c245a1c735fb085e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/13/3d243cf01e396959386f1035e2b83b849b2069 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/13/3d243cf01e396959386f1035e2b83b849b2069 deleted file mode 100644 index c67b66b64..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/13/3d243cf01e396959386f1035e2b83b849b2069 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/19/9082901fcfc16b844c2e6d583b8b41a1b2395f b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/19/9082901fcfc16b844c2e6d583b8b41a1b2395f deleted file mode 100644 index 8065753a0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/19/9082901fcfc16b844c2e6d583b8b41a1b2395f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 deleted file mode 100644 index 316e2141e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/20/94633604881276f1751cc28ce070cc2ff5ce12 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/20/94633604881276f1751cc28ce070cc2ff5ce12 deleted file mode 100644 index 3ced00b97..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/20/94633604881276f1751cc28ce070cc2ff5ce12 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/23/393edb70c5995054a268ae65f926ab64a1b843 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/23/393edb70c5995054a268ae65f926ab64a1b843 deleted file mode 100644 index bab906883..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/23/393edb70c5995054a268ae65f926ab64a1b843 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/2b/f26e9abb1d708dc5f665df071a045f4fd8e76b b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/2b/f26e9abb1d708dc5f665df071a045f4fd8e76b deleted file mode 100644 index cc09258af..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/2b/f26e9abb1d708dc5f665df071a045f4fd8e76b +++ /dev/null @@ -1,2 +0,0 @@ -xSËn%E e¯¸ê53r¹üª|+Š\UöI”{AŒPþç4° ©»Õíöëœ:g><ÍSÃFßüys:Î÷ŸýòÛKœÛÓ7§SO§ã—ø|¿+rPx*Yª÷>êR…¹»â–†êAÝ{A· ´m¢Ì«ÅÇ·×~5æ­›ê„íÒ’()cÌacwY4šdèؾÍ9; …Lzƒ¦PÝ£j9çFÖ=Æè™Ëë#±ª 5ƳÚOꋈ†û±Üd3wÄpU$vÍ•ÂjRÃhî6ZŒZ¯9ŒÁc«NÝ–n 8£À÷!lkؤHO›»å²E9f#3å­“›·aÖº/ב^ÐFT{†Ä@@y;û ÄÍP¶xö¾ ’ÓìEmLE—šf‘Ü &dî­… yÍÕŠ‚î±GkH";Å\ ÐÈà*k³Cã…L¬sM¤](HJ+%¹B£½N©+D››V SUÆX¹e—PѤ„$RÏËÝ¡ŽnyÉÁ¥ÔÙe®,kX±XiZ‹e†×›ÓeŠ«óâÍcoŽ;î.ŸŸãÍ"çG>ÿôt¹çˆ?žïß½y”ZàÈß5ºEº…þý{Ò¯qñ¿ûœŽñÉ/±ï^ž¢}üùüôøÏÏÓñ{¼œï¯~óåë»;ÿ[ƒÿ«æåééòÕÄö¯æù—óWsû5·×eŽós¬»/kí#¼£ü“›"ñõ/K,O \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/2c/1d7b8978e360d175d5ae4f4c828ffb3a8d7d0d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/2c/1d7b8978e360d175d5ae4f4c828ffb3a8d7d0d deleted file mode 100644 index afdd93045..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/2c/1d7b8978e360d175d5ae4f4c828ffb3a8d7d0d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/34/63dbab621993a56b7f0307d6fe91fbc02e1859 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/34/63dbab621993a56b7f0307d6fe91fbc02e1859 deleted file mode 100644 index a278ed0e2..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/34/63dbab621993a56b7f0307d6fe91fbc02e1859 +++ /dev/null @@ -1,2 +0,0 @@ -xuSÛŽœ5 æzŸbô_Óʇ$vö9¸¡Ê‰í²°tW;¢BûîxfA-•F¿4Žã|þëñi°}÷÷Ýé8?|üd—?^â|ÜŸ~º;ªx:¿Åç¯ÊÑÂRš¦ó¬Ÿ,g!Hb=¢±qÎA¦¤®Czß²Žïoóê™ë´…—‰.àÒÚä>„fFlíÛZ$Íåh &c¹ð^ÀK­õŒ±¹‰ê‚l Ve Á‰kCßÑT%¢àiª±w¯¨ -–úZÚ”Œ´{!1gÄ$GÜ ecËÀôZ@ÚÚ”0Ûœ]ØW¡m<a†w Vš{I’´‘}Ù¢‰a³x ±Zm×Pb z´Z >Í r+šjGté³í`•A8¹&¡g¯+sÙ¶Z« b…¦«¤‰ÜÓ]€ÆØu¶ ÅGÚžŒ{3+¸çÞ–ÔÌa¦†Õ¶¾;qÓUÔì5<[Öó> uJ“n#Ûè4ŠÝ‘ JÓ1Š;ÑzoÓ@Ú¢Ü@0Š]qò=#Éõj¾Ä¬Ê\*Ì}SDBvÑf“g«¿{B¨Ï ^rìÂÒ—b†a¢( §dé¾Qy”E¦!gŸ»fÌèÔVî@¥ íµ‹˜¡Ò¬ìR®2 \R¶Ú.1÷P.ûÍš%¤­IÙ#\e6Þ½xɸz¹HŠ^MZàV °©¨S°,äÛ¹ï,R¨Dôá^úcòZ2 ‘ ’ ôØ%æƒÍúQax½;ý\¡¸%/®»&îøpùü׈œ?Ùóù—§Ë-8Güõüð–̓Šñw@ïH~@½ÇyÏóÇ·¦ßãbÿÎ9ñÑ.á^žßÿz~úôßáéø3^ηB»æòõ-ÿ¿Cß¼Ã_Ýyyzº|³¿j¼ØËǸœ¿ÙK·ÞúÜÀççؾÀ<ð=¼mù¥VÐ_ï^ÿTMS \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/35/1feadd89a19a88d3d865c6021280306fc34a19 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/35/1feadd89a19a88d3d865c6021280306fc34a19 deleted file mode 100644 index 0c0da2e35..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/35/1feadd89a19a88d3d865c6021280306fc34a19 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/36/422c689bed6fd5fa08c3f63c3b4a98d3859c20 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/36/422c689bed6fd5fa08c3f63c3b4a98d3859c20 deleted file mode 100644 index bee1afdf0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/36/422c689bed6fd5fa08c3f63c3b4a98d3859c20 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/38/0a81f5f1a0b3ea2c05072d9d02337ebf5c8f05 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/38/0a81f5f1a0b3ea2c05072d9d02337ebf5c8f05 deleted file mode 100644 index 60d7347d0..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/38/0a81f5f1a0b3ea2c05072d9d02337ebf5c8f05 +++ /dev/null @@ -1,3 +0,0 @@ -x½Á -ƒ0 †wÕ§žÕ¢Žöc·á¡Öà -ÕJ›²ÃðÝW++ˆŽ¶ÐC’&ÿÿ¥‘ªINÅñðŒDèŒ@¥rN–®ÿXfdè•éðâ&‹Õˆ³Z΋7/7wÞAòœ.ωwb 3;¶ Ag-Hè\ÖfZI0tßm%Z§qE„[ƒªß€Ì¶„I©™˜Å; (¸wàªï:JÔV’S¨¦4¤d¥Ü’^^’@3ßU‡êfõWÌê#¦žâéˆV¤å \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/38/fc13d53e917d2d611c49cad553d4dd18d643f5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/38/fc13d53e917d2d611c49cad553d4dd18d643f5 deleted file mode 100644 index e2588ebc9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/38/fc13d53e917d2d611c49cad553d4dd18d643f5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/39/a7eb67b5806aaca554c7df624ec19898452be5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/39/a7eb67b5806aaca554c7df624ec19898452be5 deleted file mode 100644 index a365dd6e1..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/39/a7eb67b5806aaca554c7df624ec19898452be5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/3a/45bee1ef44b61672104f390d4fda9182ec4b3e b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/3a/45bee1ef44b61672104f390d4fda9182ec4b3e deleted file mode 100644 index 9bc7b6620..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/3a/45bee1ef44b61672104f390d4fda9182ec4b3e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/3c/d17636fb3c59404247846f385fd9d2ba6eb8f8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/3c/d17636fb3c59404247846f385fd9d2ba6eb8f8 deleted file mode 100644 index 2b2201441..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/3c/d17636fb3c59404247846f385fd9d2ba6eb8f8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/43/5e1c07ba77ae291435d40a12b232d57d8ac315 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/43/5e1c07ba77ae291435d40a12b232d57d8ac315 deleted file mode 100644 index eb4344aa6..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/43/5e1c07ba77ae291435d40a12b232d57d8ac315 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a deleted file mode 100644 index 328e2453d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/49/f469f4fbc0e93537f2ffa002169a21fa0acfd8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/49/f469f4fbc0e93537f2ffa002169a21fa0acfd8 deleted file mode 100644 index c650c7b33..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/49/f469f4fbc0e93537f2ffa002169a21fa0acfd8 +++ /dev/null @@ -1,3 +0,0 @@ -x•ÎQjÃ0Ð~ëû_(kIk¯ „ô -½ÁJZ¹‚ØÎ&篮пaà1SŽmëÞÇ;U!ǹÅ1ÏLœï±´ b«:Ï 90»‡œº,$-6ÊX—D5J)·Á—˜(Õ¦ä«NÁÉË~~t¸¼‡oë&ýþUŽí -ñØJ„ Ÿ8!ºÑŽs¦ÿdî»V­Ð÷n]î`r®jO÷Fv \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/2ab083dc1000aadc8376974d78f5e19ce0b934 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/2ab083dc1000aadc8376974d78f5e19ce0b934 deleted file mode 100644 index 6e958c615..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/2ab083dc1000aadc8376974d78f5e19ce0b934 +++ /dev/null @@ -1 +0,0 @@ -xSÑŽ$5 äy¿bÔÏÜÉvì8¾ïà „Vvâ Ëíjg@œÐþ;žYÐÁÃIhZÓ݉»R®rÅãSœ¿ùóîtœ>~òËo/y>>œ~¸;jñt:~ÉÏ«VNßÊc«·fu©B¬¦´:’z¦dró¶­“4Öè:@db®Ô8¾½áÕ1W4_Ú B¢­Á]3±±ÍÙ ÷š®C±m0ëŒÖË°yÝmsÄÒ§wîumº[ììé ÔÕ2HÃÈ`…€ƒŽèؼg+G7™-)Ë—b¾©~{Ÿ²)ªmïsÌ #Š7ap“ *Ãkj¨H˜ÅFiŒdhC­ Š=k†°ŒMáBdFuÎ%ÙÅ…K³=UsŽœˆ­<”VÊòð’ZÈÔ²nk҆ݨz³˲UÇ1Çì5¶(R’Õ™S“3(wㆦ!ÅdL.EdY¯†°eÉS†µ½{·iWÌ4ǾEë[vØÞW'ûì]ÌIijÙQax½;ýX¡¸%/¯»&|~ÎkDΟüùüÓÓåœ#ÿx~xËæA@ðèéw(¸þþ­è×¼øß8§cåc~ôK®û—§ÇÄ÷?ŸŸ>ý³y:~Ï—óÃm¯¹|}Kç¿¡ÿõÍËÓÓå«…ø/ð‹¿|ÌËù«µt«­¿™ãüœóþ ÍßÃ[—_Öä®D|ý ŽBMü \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/5b8d339e8b6928dbeb7e8bb25014e62c04586e b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/5b8d339e8b6928dbeb7e8bb25014e62c04586e deleted file mode 100644 index c8e8847fd..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/5b8d339e8b6928dbeb7e8bb25014e62c04586e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/ca6a3ca7794d727aa754b230f6ee9e2eaa5219 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/ca6a3ca7794d727aa754b230f6ee9e2eaa5219 deleted file mode 100644 index f8286268a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/50/ca6a3ca7794d727aa754b230f6ee9e2eaa5219 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/55/a9112df980755786110f1407ee497df3a1d202 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/55/a9112df980755786110f1407ee497df3a1d202 deleted file mode 100644 index 654d3a6b3..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/55/a9112df980755786110f1407ee497df3a1d202 +++ /dev/null @@ -1 +0,0 @@ -x½P_ ‚0ïU?…ܳ&%$ô1¢·èaéaƒéd»~÷æI‘ÑC5»Ýn¿¥Qž¯f—0ò ¶ÚJÒF¢…u4tù¥5ÚV˜n…©6~r1á1gTÿqÇp}ç¶`>O‡íÁ+Ù¤„–×–‚Ð$%*¬|U&F+´ék¶è>ƒ €ÂYÒõ“ž„Rú”¸F8:bC²`†B×µ$¯’ŒC €Î-šŒhºû­‹ï%¼Ò·|?Lc9–éÓ¸%ÍÖßÅ2˜Øíæs·Ù_Ýfßq;ypËéuaw~íÅæ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/56/3ec629e3ca145321906e2b9c05dacab754ffba b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/56/3ec629e3ca145321906e2b9c05dacab754ffba deleted file mode 100644 index 61f76fcf9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/56/3ec629e3ca145321906e2b9c05dacab754ffba and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/56/e55733885bb7468a54c08e479fab3fbacb95d8 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/56/e55733885bb7468a54c08e479fab3fbacb95d8 deleted file mode 100644 index 79f457cb8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/56/e55733885bb7468a54c08e479fab3fbacb95d8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/57/71c016f51c715afe5620e6b3d89c8d60841d19 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/57/71c016f51c715afe5620e6b3d89c8d60841d19 deleted file mode 100644 index b47099583..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/57/71c016f51c715afe5620e6b3d89c8d60841d19 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/5e/77c3404878642e880a4badcbae0872ee112d51 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/5e/77c3404878642e880a4badcbae0872ee112d51 deleted file mode 100644 index 19aed1cb2..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/5e/77c3404878642e880a4badcbae0872ee112d51 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/5f/c4d344dec9db2442dfb16a9c10f0b704cdbf1b b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/5f/c4d344dec9db2442dfb16a9c10f0b704cdbf1b deleted file mode 100644 index 7cd54b5e6..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/5f/c4d344dec9db2442dfb16a9c10f0b704cdbf1b and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/60/662b905abd07315157f7a8d275866e04331efb b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/60/662b905abd07315157f7a8d275866e04331efb deleted file mode 100644 index abc2e467d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/60/662b905abd07315157f7a8d275866e04331efb and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/62/fd48fb7398986d346c569eeb28055687ecee39 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/62/fd48fb7398986d346c569eeb28055687ecee39 deleted file mode 100644 index 14894a9e9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/62/fd48fb7398986d346c569eeb28055687ecee39 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/64/b70aac440e1c1ad7280863bb692446dc79dc3b b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/64/b70aac440e1c1ad7280863bb692446dc79dc3b deleted file mode 100644 index 53bf603b4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/64/b70aac440e1c1ad7280863bb692446dc79dc3b and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 deleted file mode 100644 index 2c7e0aaf5..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/67/4d1a405f939a7e320b81e8b34e9207b9278789 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/67/4d1a405f939a7e320b81e8b34e9207b9278789 deleted file mode 100644 index 9c8d7459f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/67/4d1a405f939a7e320b81e8b34e9207b9278789 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/67/5a11576c9d04d0133a9310bacc17dce5b57820 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/67/5a11576c9d04d0133a9310bacc17dce5b57820 deleted file mode 100644 index 4611b5ff2..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/67/5a11576c9d04d0133a9310bacc17dce5b57820 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/6d/52398d988a52619a17c64ccf1b9364ffbe3373 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/6d/52398d988a52619a17c64ccf1b9364ffbe3373 deleted file mode 100644 index 929ca45e7..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/6d/52398d988a52619a17c64ccf1b9364ffbe3373 +++ /dev/null @@ -1 +0,0 @@ -x•ŽAj!E³öµª¬¶[!„œa (µœÒmc›œ?^!»Ç‡÷y©í{`yy]pc¢ ¥Í¢_B) ÅDI‚óš³à欷ٙSºˆ9Û…SARkpýZÙ©žã¼ˆ×`äg|¶=d¼þN{‚îR¿ï©ío@.!­aƒZD3×7ôŸšù8³ ÍÐõlW­W½î_W;@žRóJ*IŽ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/6f/6a596212998cf979d524ba2e75d3102df093f1 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/6f/6a596212998cf979d524ba2e75d3102df093f1 deleted file mode 100644 index a9eb627d4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/6f/6a596212998cf979d524ba2e75d3102df093f1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/73/465573a9be30eec3fea9fd26f6deb8e8547be2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/73/465573a9be30eec3fea9fd26f6deb8e8547be2 deleted file mode 100644 index 62277f75e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/73/465573a9be30eec3fea9fd26f6deb8e8547be2 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/73/c29ea58f9f0a4130009731defb2bbd331f08ba b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/73/c29ea58f9f0a4130009731defb2bbd331f08ba deleted file mode 100644 index 208745093..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/73/c29ea58f9f0a4130009731defb2bbd331f08ba and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/75/af4f5b0d795d93599bfce074959dfe52de5013 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/75/af4f5b0d795d93599bfce074959dfe52de5013 deleted file mode 100644 index 65bb80e4f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/75/af4f5b0d795d93599bfce074959dfe52de5013 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/7e/ae17781392b913a52d288d6970d2c784d77724 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/7e/ae17781392b913a52d288d6970d2c784d77724 deleted file mode 100644 index 7ec5f01fa..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/7e/ae17781392b913a52d288d6970d2c784d77724 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/86/14901c29c0c21f169fcf817406777a02a1ac58 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/86/14901c29c0c21f169fcf817406777a02a1ac58 deleted file mode 100644 index 34e57efda..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/86/14901c29c0c21f169fcf817406777a02a1ac58 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/88/e510809e2b49e2d12953b551a0eab6c6ea8d59 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/88/e510809e2b49e2d12953b551a0eab6c6ea8d59 deleted file mode 100644 index 3d696812d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/88/e510809e2b49e2d12953b551a0eab6c6ea8d59 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/8c/9ebb6df33276ec8e8f07b8ad4aa7846146ff1b b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/8c/9ebb6df33276ec8e8f07b8ad4aa7846146ff1b deleted file mode 100644 index f69e0936b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/8c/9ebb6df33276ec8e8f07b8ad4aa7846146ff1b and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/8e/aa34662b7cfef68f525b4d45680b9f7b2a227f b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/8e/aa34662b7cfef68f525b4d45680b9f7b2a227f deleted file mode 100644 index d115b238e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/8e/aa34662b7cfef68f525b4d45680b9f7b2a227f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/93/58aac36eaa67d241c4a5ae4bbe6fbf13b588f5 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/93/58aac36eaa67d241c4a5ae4bbe6fbf13b588f5 deleted file mode 100644 index 5ccf7dbf4..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/93/58aac36eaa67d241c4a5ae4bbe6fbf13b588f5 +++ /dev/null @@ -1,3 +0,0 @@ -x•ŽQ -Â0DýÎ)ö_ͦIñ ‚Ø6›*ئÄÕó›+ø1ðxÌÌu]Ÿ -Dî MJ³$ ~Šž0úè} 3¹Á‘å){$—hvn²) © ¡§L3JrÞÅB¥0"Ù˜lGžK ôQÜdce8»Ýa¼.+?_§¹®°~$ÂÔ÷àˆÑô¶ŸSùS3÷=³J嶈B“½¾Í§qF4 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/94/a4fd803afd5ce00e15395d2c2e6c12d0510cc2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/94/a4fd803afd5ce00e15395d2c2e6c12d0510cc2 deleted file mode 100644 index 69afba60a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/94/a4fd803afd5ce00e15395d2c2e6c12d0510cc2 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/99/bac5cf5f64900a450608c9457a0913feff05fe b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/99/bac5cf5f64900a450608c9457a0913feff05fe deleted file mode 100644 index edc3580cf..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/99/bac5cf5f64900a450608c9457a0913feff05fe +++ /dev/null @@ -1,6 +0,0 @@ -xuSÁn$E 圯hõ™]Ù®*Û•ïàB‘«ì -‰fÄ -åßqO@»¢nµÔ.—ýüüÞx> ëwßmûåéñÅ®œã²ßo?Ým[·mÿ-¾}"ùÛ}m÷€?¾'ýWû·Î¶{<Ç£]ÃΧçÀÏ¿^N/ÿnûŸq¾<ÝõðåÛ»;ÿ‡>¼S¾¹s>®&â7‰W;?Æõòa.Ýrós³_^c>|…¹ãgxŸòk,¡¿Ý½ý‡dLh \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/9c/248b5aa0e24ac4c22cca3c8b7b49751ad513f7 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/9c/248b5aa0e24ac4c22cca3c8b7b49751ad513f7 deleted file mode 100644 index 9c4d8604f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/9c/248b5aa0e24ac4c22cca3c8b7b49751ad513f7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/a1/ff16a04ef193a4bfbdd27020f42c057d99dcdf b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/a1/ff16a04ef193a4bfbdd27020f42c057d99dcdf deleted file mode 100644 index 9e64cb9cb..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/a1/ff16a04ef193a4bfbdd27020f42c057d99dcdf and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/a6/d9758d43c48e7a3c7483b804573628d1afebf7 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/a6/d9758d43c48e7a3c7483b804573628d1afebf7 deleted file mode 100644 index 84e3a6bd6..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/a6/d9758d43c48e7a3c7483b804573628d1afebf7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/aa/200a6d4637133f2aefe9ad72485b80e6de167d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/aa/200a6d4637133f2aefe9ad72485b80e6de167d deleted file mode 100644 index 5acaf2300..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/aa/200a6d4637133f2aefe9ad72485b80e6de167d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/af/296e52e97d8ad36cf49513616c39021be59576 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/af/296e52e97d8ad36cf49513616c39021be59576 deleted file mode 100644 index 196ee7950..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/af/296e52e97d8ad36cf49513616c39021be59576 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/b3/bc7a6110915bb39139242769f19014b78d4f0d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/b3/bc7a6110915bb39139242769f19014b78d4f0d deleted file mode 100644 index a9f5b57df..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/b3/bc7a6110915bb39139242769f19014b78d4f0d +++ /dev/null @@ -1,3 +0,0 @@ -x•Ž[ -Â0EýÎ*æ_<¦I -"®Ap“dZ mSÂèú îÀ¯{8pàæºm‹€uá$<¦ ‰2¢f“ •`£ŽÞ¥äG‹èKcÉ.©ƒïŽpH̆'ÄäÖhœÜ¨ N…F-gLŽ½åU½þŒ«þÓgÛg<ƽ^cÞO>_NOÿ~Üö/q¾<¼ðÈåË[:ÿû†~êÍùtºþðªçû¸^þ{sÙ/Ïáw?hîøÞ¶üQKê/7/ßhðMk \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/f7/827807893ee42a4ec834d781824c9856068ebe b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/f7/827807893ee42a4ec834d781824c9856068ebe deleted file mode 100644 index 972da0be9..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/f7/827807893ee42a4ec834d781824c9856068ebe and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/f9/8de9065b752075755766ad234321abd504edf7 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/f9/8de9065b752075755766ad234321abd504edf7 deleted file mode 100644 index 112e80cfc..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/f9/8de9065b752075755766ad234321abd504edf7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fa/ee0fffd7fc7662cea0aff117e6af33f589cb8a b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fa/ee0fffd7fc7662cea0aff117e6af33f589cb8a deleted file mode 100644 index 813ce6326..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fa/ee0fffd7fc7662cea0aff117e6af33f589cb8a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fc/cebc54e5d17da61cc0eaf3cbe96f20c7489431 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fc/cebc54e5d17da61cc0eaf3cbe96f20c7489431 deleted file mode 100644 index d980e1a3f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fc/cebc54e5d17da61cc0eaf3cbe96f20c7489431 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fd/4a49d3b9fb0abd7999939f5137a2ebb4de0db2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fd/4a49d3b9fb0abd7999939f5137a2ebb4de0db2 deleted file mode 100644 index 245d179df..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fd/4a49d3b9fb0abd7999939f5137a2ebb4de0db2 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fe/7a275d0e6486c5193fb6ba5791d74382bae66d b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fe/7a275d0e6486c5193fb6ba5791d74382bae66d deleted file mode 100644 index f574db072..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/objects/fe/7a275d0e6486c5193fb6ba5791d74382bae66d and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/refs/heads/master deleted file mode 100644 index 2b7dcc9dc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -6d52398d988a52619a17c64ccf1b9364ffbe3373 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/1.root.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/1.root.json deleted file mode 100644 index a6d9758d4..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/1.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714", - "sig": "9a2dcabb06679edced2c2cd676eb01932a8a7d17bff3b98135e889ce8ac48415035a53cddd2269cf6a0ccc3c80a9d334e1c15d5551405fd81543492e77c1eef75ed785891f9aa388d9d3daeab44bf2c247464aead34d8ce4a1b680a55f2c0dd7a759ab5f030fe2e136a89d81c237edc14bf94ec48e585cb336828043faaec691889a60b2afa4c2e165f471548fa83bf11d95a3146801ef0fcd9477eea06c92a2767ec5e98014279b4e773833a513f96179c8a5db6b9a6ec96de1e5115cd61d2fa968c86077eec06fafd12a004158e1fb3296b6050d1a5a7a448cbb10ca48d810298cc08e926828a88864191d0f591a8249f41eff7d424ccb6499ecd870ecd8dfa13b948002908d8709a8d1790a064d4bb5ff229bf75b9f0238ff7ed4b7ef4e6d21157f988a22043eb184876aa4bf56097ec480eae4f9b031350c0f099689f1e213875498d19bdda3c627bbcfbac2844285e5b666b221c0f3ba2400a743d37d4b8b9ea1a3a0c2fede44bc7f0c1610390cf0675aabc533e9c99acd64778189cf16" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2021-02-19T20:12:20Z", - "keys": { - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt8lxr3x5fdX888ETUN6L\nheNzR9B6taDcFrxzfhLKHMBr1ibsW6cC65XdFWTjXlyEwv0O6Q8KtRxsZ4VWZC++\njPBmqx64pIwavlKKVTxYKyDiviKaFQSpHFbzWJadyylrnK0TVdPuaOvBv6kfszim\ncIRIPdbqWBCt34UG79fAbDLH23lA5dFhQVEW0v1r8Wt937lj24YCAw9aBLwbkjSs\nyTYHYKJiIb64YK75OCU7BNrG56uwtlGjNDrlDJbWqnkjaSzDp8KhDNm/iq3O1QDq\njTY5WkMR75Kn+cPJ06kxHcJ9sbmorXFBQwiFe9iDe/AQG5xrjkm/vDWLL0iC1ZKP\nM4t1qPRKYiijm4emnZ4IHkx7EgcDBNNoOorsMDj7IQqMb2t2mJsW4/1wjdUGOmWF\nKzFWLYux8uwTQPHinNl12CtQeTkLs5KvDK5Wja/dbps8Riw2+qL5u4auuTP5MHKk\nQdRmlMFDS5B+ka/GyitXucx1WeXp1sZ79WCOn7aTkLMtAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAlVOTOqAJpxv/33JXMObi\nXD3luL+yuDf+rhIEG6II8JA6qbYW8aEx9yj+Ku4sDQD1BLJ44ebEX7qxzLJPv3LC\nYQN12La6nUS9kuK2tI1SISrBKjddaC+p/l+aMqPDT6lnt/qnbsZc2SCNdK0CPAnh\nWSOZyxf+e1ZRkKT20guqNV2W30ww764uNn5ST4SDdKqgQgUBPDaPZSlGLcAXxXCK\nQEP/b8jyiz3BFxZyJwCk2H7e41gG9nBceX/ARvCZFZMuGIR7zK6cd8A+6WDF7eM1\n5onj1lYPLL7Mi+bFAbDzCF75NQL+nSTjn4e9olLfiXap/XbnYck0huRAbaIpDZxC\nIZhX8VUlgeO9Y5/PeS16etCsP/Ch4YL5ijZQma0yUDh5Qmier9X3YHV5nTBYu/zN\n5U9tLzZ+GnKG8jDgKQJwFDLv60Hk27KlrCHkrWXZnI9TIXa7d4cpp5RUVfpU4Dal\nwrWGXzHg/EjYHx5qXJc93dUoGvSKS5Jz/Y8MNeVppIvZAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAufSY8KwZIja0Na750LCC\nHovf3Ktfh7jnmaNXsFvlTXfnyOaHfJTCU+6pXTdAHYoIcnZLEx8gEC1PobibvFqt\nicM4ZDh8OQMlgUofXmGOgwLaRaPYEZ3nZPAQKtE1ISDbyZ61FnjLAQOHXDlA/kUy\nJLH6KBeVS18kvFqCnelgiJADWGroWJP6vRer2WRxvhSKp2Uh9EUL2zSjzo2Kfome\nqp3Lx+AP5tRza2UTnrEPkIjqQUAqUcQN5bRJ77hGWCtjtAx1M3yXs6cou/Au1Xg2\njLeDSbgi+57cxVuYmHUQwk+XLOabXgdUDOav5rBHoU4owXDo2lWI6ktKV1SEsxl7\nNNI6rQ0ef3tbDjhCjjBLYbhEngXAUI/VMHycJB1tIvzVb7zrvuTSYcMmBAS6Tg62\nJgMzAIh7Qc8SUgR9JaDgGGksKSXtEruvR6kGDApHglIUbTgKyT9fh8sZ5m0czzKW\nLBSXwYmZHnt0bKNFdf2gvkqfP4iV4moRkZi5Qzf7BostAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwvyLoT3TNFzwOXbwO5eU\n8eGrIFyXGa97w0cp44l4rASZKJ7I9/AjoCuitKYiodIPtVP5dGtY+dZFNQvXjdQp\n7Te/bDyj4T64jmlOFJ5MT+Qx4g9tqaW6w6v886ZqlUTe422v2cinwXAFlodDMOxK\niZ088vFGON8Ju1jsRN2L3P4tW2mu1wOV6RDUTm+qP3VrxnWo4aleTWAVjU80v/vm\nId4HZvwYDATnkdhKgPsEFTbiPsXil00UKfO5FAExdls1978REdLLfEgLJnYtIOpH\nqmigmGiIchZlGAl8JYrCRrYgMWxiEWnXfQWqRGDJ/AJV6Nbuf9wrStd3i3yPcJHV\nb1oHLBDCCJ6k7Qa3LJIYXk/a/N6NB9g3/Bfg8nJVuCF+LQ8M7mhC9xCXCOjPIyGd\nUNyx4BqxKtSOSSJrR9OLIFDKdxw8kKWC+5DPQXlTA1bAjdMeR6ZXWYLxMOSn2jep\nySAx3eU3UdhOzG7Esw7vMbVa1oyBNloyas7uwXV9tMu1AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/delegated_role1.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/delegated_role1.json deleted file mode 100644 index 674d1a405..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/delegated_role1.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "signatures": [ - { - "keyid": "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3", - "sig": "5fc61df24e9aaa396044f7e5e51787cef47aecd0f625655b3e3bc940a2983545a8933ec0dfc1fcfaa5158589609af9007c6789dab3ace3de504b026723b1d224de65f5dfc6aefef88c9544005134703f03320e22c4ff034e03a729ffa91a257ea6f059cf08fbc6e258c5d1d0388d2d1da50e5d9ed98fb3cd180df5dcf110cfc85d40ea77f680c56b73aca8ec4bbcfb35ffba1abb4be960fe1a1756693f383de11cfaff0284fab677924bc6f89691a32e948c3a394b114dc1967bbb4e7e369f27bf71bee947a155f5f748b25fd965841aaf28ff4b1ad8ab8865bd6e0257c127e3006c2af25e0051025d39abef5c555957d02ba28583b7e7ddf1cfa3e4100e08ee8640a8cca5399bddecf3f254a36482d6104c155c843d7d31d7f63eeedb1b1a3619f087eab9a90a370454b9b8b470d3b5f3775a69ec8a287b4539f587b39b0282fe470ca754904037e4469db54118741283afc8304d527a8bd7def43c825852421301fbe7a0558e09e802275cbee06b942904c4a1c9819ba48405ea2cb9f9f50e" - }, - { - "keyid": "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db", - "sig": "61a2f141484220b32169c8845b88f1fe861c0da8488c50d55b223b9dcc7476c9b7a8a06fa9d56d80ca7bdae286d82789551481283e01bd0f2c2f1182d097ef2daf09f73d28666c3ee6030eebb0afceaabb1c044e5bfb7c7104401fc7ac684025bd60b4a5a6c99986c095b3bfad4ae454f0d2cb81e1a1c0b58eab163ccb9d5f3563189b40fabb8bb024cc2a59f71ed8033d15b222ee6c15b8641771033b7f480a159802078c90677cecec142ee0861fae32af91996fb6b879f30e92351c8d76a5d0a54462fb166891ee6a66a469e439f4fa6ea404540324d79c11c1691def8403e2923dd063a58dd4e8d42ac88d8603f1919406c6e663a4931f37670a59a4ba8e2d4f8945623f514093f7e171734cfc4f15eb8f972313ff44b6b3391f9e1850c171af5e977bb4211316b05cdb0399f413408e776c4d953445c911114214363b944ecce91da2a99ffa9d351ace2b1f30e1443a03d989412db630ef82baa6bc271a868a040c7426965319d21eb0ad69b591b36b012297d5d2ec393a78ae58e38c97" - }, - { - "keyid": "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1", - "sig": "2445359fa672236a86f62cd8ceb6a7dd9329a387ab57a66773859d31c778343de71ecaa76055a3ac660c21f9a237707a215b22cba16b412894b16e2eed9e4f3b821dab710dbb7add0f4aeef9afb3b4dddd7fa5514b9f2090edc77dd4ddf6c9145a6146b10a6369bda4173eb01c7b576765565f6d2cbf7e249adfd6f403758d4f15fc93dfd53350393dd045add130e0050f52a1fc8128703d3d0fb700b5423900b87daeb44113177bb7f05514af74e99b981069aa73d0f9c48eb74be95f73c238ed192dbea517bca6ee33214d338f6f4b59491273916a2a3c6446e6b0435c616d3e362d66d29b686a590d28c32e8f5ee3631d2c1f718573413ad65ec3c7600543bacda3789012355875674cae56694ebb6e37521f2965a9cd168aa6383a980aed88300d6a74a6fe9998371bcbb2fef9fc4be15ea0fe46e828e7c41b888748dd275ae020790d8ab33d432c58a4c712ef5d9700933f6c3e6ac76952068589e9c3da6709f308b6bdb736d467b9f384b1b015c3d2d26c43cb104fe6221480add7e213" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2020-08-31T14:24:03Z", - "spec_version": "1.0", - "targets": { - "namespace/TargetRepo1": { - "hashes": { - "sha256": "e990ed5fd65bbe79358b4814c7a6870b3f6c344ca037addfc21739d1ce88c3e6", - "sha512": "6e5a3ceb90e8d6ac342c8c7b9b9a94d979e76ccb5fc7649ca2747adf4dd1443e117c8699de8f54c0fae0412c06e620760ab38726fed16714caaf8ce91f77ccab" - }, - "length": 60 - }, - "namespace/TargetRepo2": { - "hashes": { - "sha256": "ff8b894135de7185ae984e1f7e39d6ecae4863b351c468c42fe661b27bb81a21", - "sha512": "5480c6b6f09e37e89b710506edc8c38529fd64b827ed6cae014930152720f021940cc784cd032215b48c3c05b275e85770654ad7ced588da69a6fcb3b5367b89" - }, - "length": 60 - } - }, - "version": 5 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/delegated_role2.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/delegated_role2.json deleted file mode 100644 index 60662b905..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/delegated_role2.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "signatures": [ - { - "keyid": "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816", - "sig": "b00bc77b7a42367b51b6a70420054c08c14759e8947868180862411ccea037d213c720418091f97ed1627524f8f333bce68199c5a13ae5e5bfaa70600a4c953bf5e4bcd258f0c2ea8406079525b1a74c79b656bd688365d26ecfa4128885c049ff80e4fc1961e3027a50145c961cb11c671c44bdc1eb385e8acb91aa886b439dfb45e44ad5e7e163af47aabbcd4edc9b9d11aa9f03770c944c8b4da9f5f5345f83e59d031aeedd008fcd382b44651e9662ae85ce51e1602ee9fe8adeb78cdcde191167396bde44518ea7413dbbe4e125aea4b9cb02f8715c7e9d174096459caed25f2787f9ec1d5d854627a5e4b68ec6634d90edeaed0157bb142b53ec4ddcaff49949a6b57eee155ab62ef345f5a805e99d4670224e0d866e07bfea3385f297c9d84f6d24958e2d3478c5705ca6298f41c087cac3f6dd2f3626fa26cfb08718909aa46173455eeae0cb141cba2b5b0632f01cae982d155e2b0a80938654c344e44b2b062be85317c849fade2b884f7b2f3f3acc47dd01649cd436c0acdfed8f" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2020-08-31T14:24:03Z", - "spec_version": "1.0", - "targets": { - "namespace/TargetRepo3": { - "hashes": { - "sha256": "e7c7d7e4757fb13dc7efdfc1ebcab01ff97bf6389c516c9bad4569a3baeb24b2", - "sha512": "18cb07f17f9ba02669c5e5d956df36ce4b75ce5eae75c6e5aefbcec78c4194e390e2ee39867293272e3ca436a74c2b42bde8b3cff738a4648a3ef463a7558c1b" - }, - "length": 60 - } - }, - "version": 5 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/root.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/root.json deleted file mode 100644 index a6d9758d4..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714", - "sig": "9a2dcabb06679edced2c2cd676eb01932a8a7d17bff3b98135e889ce8ac48415035a53cddd2269cf6a0ccc3c80a9d334e1c15d5551405fd81543492e77c1eef75ed785891f9aa388d9d3daeab44bf2c247464aead34d8ce4a1b680a55f2c0dd7a759ab5f030fe2e136a89d81c237edc14bf94ec48e585cb336828043faaec691889a60b2afa4c2e165f471548fa83bf11d95a3146801ef0fcd9477eea06c92a2767ec5e98014279b4e773833a513f96179c8a5db6b9a6ec96de1e5115cd61d2fa968c86077eec06fafd12a004158e1fb3296b6050d1a5a7a448cbb10ca48d810298cc08e926828a88864191d0f591a8249f41eff7d424ccb6499ecd870ecd8dfa13b948002908d8709a8d1790a064d4bb5ff229bf75b9f0238ff7ed4b7ef4e6d21157f988a22043eb184876aa4bf56097ec480eae4f9b031350c0f099689f1e213875498d19bdda3c627bbcfbac2844285e5b666b221c0f3ba2400a743d37d4b8b9ea1a3a0c2fede44bc7f0c1610390cf0675aabc533e9c99acd64778189cf16" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2021-02-19T20:12:20Z", - "keys": { - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt8lxr3x5fdX888ETUN6L\nheNzR9B6taDcFrxzfhLKHMBr1ibsW6cC65XdFWTjXlyEwv0O6Q8KtRxsZ4VWZC++\njPBmqx64pIwavlKKVTxYKyDiviKaFQSpHFbzWJadyylrnK0TVdPuaOvBv6kfszim\ncIRIPdbqWBCt34UG79fAbDLH23lA5dFhQVEW0v1r8Wt937lj24YCAw9aBLwbkjSs\nyTYHYKJiIb64YK75OCU7BNrG56uwtlGjNDrlDJbWqnkjaSzDp8KhDNm/iq3O1QDq\njTY5WkMR75Kn+cPJ06kxHcJ9sbmorXFBQwiFe9iDe/AQG5xrjkm/vDWLL0iC1ZKP\nM4t1qPRKYiijm4emnZ4IHkx7EgcDBNNoOorsMDj7IQqMb2t2mJsW4/1wjdUGOmWF\nKzFWLYux8uwTQPHinNl12CtQeTkLs5KvDK5Wja/dbps8Riw2+qL5u4auuTP5MHKk\nQdRmlMFDS5B+ka/GyitXucx1WeXp1sZ79WCOn7aTkLMtAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAlVOTOqAJpxv/33JXMObi\nXD3luL+yuDf+rhIEG6II8JA6qbYW8aEx9yj+Ku4sDQD1BLJ44ebEX7qxzLJPv3LC\nYQN12La6nUS9kuK2tI1SISrBKjddaC+p/l+aMqPDT6lnt/qnbsZc2SCNdK0CPAnh\nWSOZyxf+e1ZRkKT20guqNV2W30ww764uNn5ST4SDdKqgQgUBPDaPZSlGLcAXxXCK\nQEP/b8jyiz3BFxZyJwCk2H7e41gG9nBceX/ARvCZFZMuGIR7zK6cd8A+6WDF7eM1\n5onj1lYPLL7Mi+bFAbDzCF75NQL+nSTjn4e9olLfiXap/XbnYck0huRAbaIpDZxC\nIZhX8VUlgeO9Y5/PeS16etCsP/Ch4YL5ijZQma0yUDh5Qmier9X3YHV5nTBYu/zN\n5U9tLzZ+GnKG8jDgKQJwFDLv60Hk27KlrCHkrWXZnI9TIXa7d4cpp5RUVfpU4Dal\nwrWGXzHg/EjYHx5qXJc93dUoGvSKS5Jz/Y8MNeVppIvZAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAufSY8KwZIja0Na750LCC\nHovf3Ktfh7jnmaNXsFvlTXfnyOaHfJTCU+6pXTdAHYoIcnZLEx8gEC1PobibvFqt\nicM4ZDh8OQMlgUofXmGOgwLaRaPYEZ3nZPAQKtE1ISDbyZ61FnjLAQOHXDlA/kUy\nJLH6KBeVS18kvFqCnelgiJADWGroWJP6vRer2WRxvhSKp2Uh9EUL2zSjzo2Kfome\nqp3Lx+AP5tRza2UTnrEPkIjqQUAqUcQN5bRJ77hGWCtjtAx1M3yXs6cou/Au1Xg2\njLeDSbgi+57cxVuYmHUQwk+XLOabXgdUDOav5rBHoU4owXDo2lWI6ktKV1SEsxl7\nNNI6rQ0ef3tbDjhCjjBLYbhEngXAUI/VMHycJB1tIvzVb7zrvuTSYcMmBAS6Tg62\nJgMzAIh7Qc8SUgR9JaDgGGksKSXtEruvR6kGDApHglIUbTgKyT9fh8sZ5m0czzKW\nLBSXwYmZHnt0bKNFdf2gvkqfP4iV4moRkZi5Qzf7BostAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwvyLoT3TNFzwOXbwO5eU\n8eGrIFyXGa97w0cp44l4rASZKJ7I9/AjoCuitKYiodIPtVP5dGtY+dZFNQvXjdQp\n7Te/bDyj4T64jmlOFJ5MT+Qx4g9tqaW6w6v886ZqlUTe422v2cinwXAFlodDMOxK\niZ088vFGON8Ju1jsRN2L3P4tW2mu1wOV6RDUTm+qP3VrxnWo4aleTWAVjU80v/vm\nId4HZvwYDATnkdhKgPsEFTbiPsXil00UKfO5FAExdls1978REdLLfEgLJnYtIOpH\nqmigmGiIchZlGAl8JYrCRrYgMWxiEWnXfQWqRGDJ/AJV6Nbuf9wrStd3i3yPcJHV\nb1oHLBDCCJ6k7Qa3LJIYXk/a/N6NB9g3/Bfg8nJVuCF+LQ8M7mhC9xCXCOjPIyGd\nUNyx4BqxKtSOSSJrR9OLIFDKdxw8kKWC+5DPQXlTA1bAjdMeR6ZXWYLxMOSn2jep\nySAx3eU3UdhOzG7Esw7vMbVa1oyBNloyas7uwXV9tMu1AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/snapshot.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/snapshot.json deleted file mode 100644 index 38fc13d53..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/snapshot.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "signatures": [ - { - "keyid": "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b", - "sig": "3be506a0d86563b1b66cf1ffd728c5e8b0330f234c787beec84f203ffab3baff1805829179d0848058e25113c46f4687cead288191ee0c964b9ae44637681b32c3ecad723587574b98727db94162053d8c374f5a0c767c16606191ebba17afb523fb31f4caf444cdaa2974243c855f4debf89b9f6c8eec32074645549c6d22d8adce5a99187b2a15a3ef728e3abb6e210e4e296bcd186290b10df6f03e36873a75dd00734ad667bbce483052513681728e76ffe289ea904b6c481427835dec9c141990f35474690a9bb426f9c4519dceac7a2616cec4d863fe75bae47bb6f53fb3b4cca03423bab163406b07a7d9695e6569f911c6b23046e4b694a0c12ed29a27b74ed0f05ae86d0e9083e82dd314ad7ebc20cc3c5cf7cd6abb742c5ab73cbb64ca96ce836d9f18a05aff6f07710b1267e7b1fb6af1e52a71448bb28cd96bcc90a07293ee939f98c3d1ed69605d167cc765da9ce062294326bac8b81d045422448637bfbcdc1da108f4541e631133760636da6e1b66b7117f7e53608c5e4ff5" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2020-06-09T14:34:45Z", - "meta": { - "delegated_role1.json": { - "version": 5 - }, - "delegated_role2.json": { - "version": 5 - }, - "root.json": { - "version": 1 - }, - "targets.json": { - "version": 4 - } - }, - "spec_version": "1.0", - "version": 7 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/targets.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/targets.json deleted file mode 100644 index bca0efd5e..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/targets.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "signatures": [ - { - "keyid": "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23", - "sig": "499a08917778d6b6a35bb52e4efcd06f5a4a7ed6fbc5106c6278f572ec29ddfa8420d9ebb088962a7c806d803f382755725de4cf73f7a7ee44cfa006d79eda8798d4e8642b66a6a611dd0b9544457a3d49dddc152d729aa4db17ce87ff8303c4d35cc4332270f0de0d44e30af8f484d5af6616b2919590628c2071a9628e5ea874440c493922089f56586047fc1313edc0098b4192e3122c7185cc32978d0f49625ee4357d2a0c038f51ac7350e9dcc14197733b4340b5d4b3e8fca041448675d82de8976644cd63db158b5a8db1918ffb9d90809f934957fe3aa23f6ecc9df783ad5b04002fd6c6d8fa40ae67986df77ef2f84c032a175dbdaa94a22f673f2a921bf7a9a6b52da3209f887ae50ac626143dcc21683299a48d8c9b0177e27341ecc9658510b8e099f45f399c66a8c8a280ae624551b09436d841885e5ea9aaeb6a846e181599a6b249c1e1f6e9445128a961a171e9b87ee7880f31c3e8b9eb5d094c8cb643343577a9333362905105e4bac0eaf8bde2a283fef063646d831ce5" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": { - "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA1VArRM8KSmO04ov5RArA\n+lXBK+a5Pn9NuQSUMxyuCGqIRT51VrammOpubgDs+PmXdwKxC6aGqMHtsaU8UJHb\nPxXq8b1Idm8Cac0ypjnwjdPhnpG0GVRSrK9bej2MFCICHz3YkX47wqhMnCyt03hk\ncR718wLdLw3LKIcmNTzx+w2RHzVzsVgfZMpczfc0jOheDz4vUPSc4s3pY8CPmLvu\n9qNpmlWSka4GOY9qdCp6P4FGABUj7RM68UBhuv3w4fBgwhfonUvjEIy0QqzyGt29\ncWpm9eBU7XEuHda2o3DsVB0tLqInk2Yyn6oqnE5jEEgLONQx+XOcQ3MqSUQbtEtj\nocR4aVptstmt0tbAQoa6L4QkGCltpZ5y0zuMpxQ9g46FP4uHQ0qPqGm8ZJKaXY0M\nV+ahDJEuYYGciOlQoyzH3/Iw8PIpAJK0jwTS0U7FQLVlZ+WamZiHgUKglwmZRFe0\nug9B5LvoKRNyxvwrOflu3Ly0wcd/w5LAYK6Nc+bCTLmhAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA4+WTKegsztvnGpOfXKuT\nqx/ZhfZodAyI0ye69G4VHwfVP805O9T6xoKxGDA8PTpxBSe01HgZw5HgW7CJMY1Z\nFwQ0/do2pI1Ef++JyhMNucCaTiyQcAMT50/0WBWMWCemt05kb/Kbdp+ViOc/Ayp1\n5J9ok4+MyCXpBlNdOdsUw3SK6ps1kqMQkiH0jigfZGIYg9zeJ8qDT/EGu0hHSzDw\nxGTBTGPjMvUWXL98ZE1cBJA+ePP6YNQc9qIIxWeMYUO6Kx6O8QoifEdZK/AHGwcY\n4MNVtXsQ61xINtYDl1jTtz1COIBKGNvDWllF5llOZK3vQvbBPgvUpf1Ia4eWl92B\ncWN5d0gAd/rirugT5As6tsB3b4OvI8SxAU0OBqEwqi8uEL9tdB8CCBwHGdMHntJ/\n8dqIpBjNIdI58iGdKTznP2k4yokxE7sIGrM3g3UfZ5Ux8LuUEF7MXsvkTeP057G2\nWqbdaalAw4z3SGJdBDbUO7MIzWdbJVjoeak/jCNQ3pifAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwK53ZZC2/GWry1pdOtFz\n6u7lRu5XwzcBcYHx9q2gsso5MiXrBHV2M5NCjPTJSLnZ9XLhC4bbnIqkeT3VCjVf\nqQn18aj7egTjSZgM+FIYSRzmkwixUt9hFZS0OovLl3MIqqYk/jyyLd/gFC9GODBy\nkVty76wzc+taQfnDpdhE+ZvOy/SCgHwkkhCfiTw0/LXdHiefm5x9ee4KfVrhbTn0\n6ZFzkbzqbXGWgIdSZF4/ZQAG0y/aEsU1e6uKaWdAsH8+qQV8pH80zqc+OHC+1PTk\nV+0POcdvmO1LD85uPi8EtPi66SaGfnNYk5fq/Joq7fo2cRFCuYX6AjMqzqaQ9eaw\nAj4t9DxpbD57oAlJlTnU0/bfmxDNSqnzHDoXU8pkC39QxvbzNlA+IcT0QUWPi7jL\nuBrupBJjg8lobootu7CTJb96R0bBQFE1AHDIzXWkaQzr5JWXoTsizHV3WlYRwe6U\nzvcDLCKJJDQedFs2PxJZ/p3LDULm276ePbGK/EQDAI73AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEArpF5XZXda0P5M5IbOV/t\nhyZpAtGNMPAsCKXbKBJrNbriV4mBs6v6/9oYPdyz2Y1U2fIhLIQWfFCTQddpVL7r\ndU+5fYvrbuteUwd4lZ46SGqL1Xt6nzYG8igdpXWxVJJyTnp2sTT7Btz8CbdTQ5hm\nGYCWsAhPlncHpxnJj1HuZeFPZxs9f6B5TiBCrhicWH2ay9/Lz+mwQk1fDC2VwGD6\nVVMpFtMm8sO8AxV8audi9GjRaOCOTdtlk2mvGtxj/vqB9AMErkgG5Bxer3s2Ry9f\noF0gHOUmmNW4pmk8Iqf0OZpWmGz2Nh1Qgw8IMqQWxsDq0T/1VUxFU0DoLf4qnnI2\nD6RfGuNCB13QanYhXh4apdamIa8fqRnMmdyvvKm7Y9CAZRASW8ltzfVIT/DMmm3s\nbnN4uFoXWvBVihXqBk5Jx2uKDUo3duY/Z9kHp/e+IdGNElLNMQNHJustGHVIq3ES\n7cFlDJze0Z0jXV+TMIMtrFIPmzp3NJaLl7tF2nrk41/bAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": [ - { - "keyids": [ - "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3", - "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1", - "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db" - ], - "name": "delegated_role1", - "paths": [ - "namespace/TargetRepo1", - "namespace/TargetRepo2" - ], - "terminating": false, - "threshold": 1 - }, - { - "keyids": [ - "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816" - ], - "name": "delegated_role2", - "paths": [ - "namespace/TargetRepo3" - ], - "terminating": false, - "threshold": 1 - } - ] - }, - "expires": "2020-08-31T14:34:45Z", - "spec_version": "1.0", - "targets": { - "repositories.json": { - "hashes": { - "sha256": "f4d429d67f4b699aa8eca79dc399562f2a99ef5a22538ae55f4f9cbe63b9ff8b", - "sha512": "97d9c8053338ea321e5bd93587dde0c286911ad2ec9be9326553413714c01b97410daebb80705cdbd2e136eb9516762e0a84983958154288797d0c9d5f4cfb1d" - }, - "length": 776 - } - }, - "version": 4 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/timestamp.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/timestamp.json deleted file mode 100644 index cc7614e69..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/metadata/timestamp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "signatures": [ - { - "keyid": "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327", - "sig": "062d93c6279b2b93a72eb88404f1aaf52436525e8351776ea84fd185c62319a0e67096e9111956d262f248921b5e7c3fe44bf45b137681fd2d03fd676f1ebe6a2c2b2c444e88cce73f8726e5b9d6293650fedbf57c2ad58eaf009fb54620f5b58bc28f6c6244a78af7282c01ce2655dd821dc294001c03f9bfa77d65c43a1955785d53dc848ba9e24e6b23063981d0d26ac5e481445c02d6e0af25e4b023b113800a7678a6802f9499cc1e7fe6dd1e95be31f7f1d532664da25c05c2aea2b7724b623db94774f2759022eb9a191ccbefe655724007b3ce5ac67ed6eb3df5f33aa8d9d52f6b9445b8fa303b6b63fc776829b6a7d4f8057ab7a9f239c9ef5c9ad6d80ca14b15bcf334cebf655d1420bb322dffabe62f77500ef845854eb04c93b464f00fd04916ae387c4c3e5d24fea78fabba5176202cdac161f081d344e282a494a74fe280bf6775f9dc60548c7f59c317116659a2f4fff5aa2d342946474b617ff487d6be973b582ef068c2a78014cfdb91ec4f4f17582adacd927ddec7be72" - } - ], - "signed": { - "_type": "timestamp", - "expires": "2020-06-03T14:34:45Z", - "meta": { - "snapshot.json": { - "hashes": { - "sha256": "7275062883ae4da312db3decb2db0851db540607ca119e14c2509484c5ae9527" - }, - "length": 1214, - "version": 7 - } - }, - "spec_version": "1.0", - "version": 7 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo1 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo1 deleted file mode 100644 index 1018904fc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo1 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "commit": "467a6482e3d43a53b629f8b152af31a6ad4cd0f5" -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo2 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo2 deleted file mode 100644 index 8eaa34662..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo2 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "commit": "54369bdc051c041eee84680a69ef0c02953266e1" -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo3 b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo3 deleted file mode 100644 index fe7a275d0..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/namespace/TargetRepo3 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "commit": "f24a34c1cf7eda83cce81980649995c3a26a0438" -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/repositories.json b/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/repositories.json deleted file mode 100644 index 55a9112df..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/organization/auth_repo/targets/repositories.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "repositories": { - "namespace/TargetRepo1": { - "urls": [ - "../../../origin/test-updater-delegated-roles/namespace/TargetRepo1" - ], - "custom": { - "allow-unauthenticated-commits":true, - "type":"type1" - } - }, - "namespace/TargetRepo2": { - "urls": [ - "../../../origin/test-updater-delegated-roles/namespace/TargetRepo2" - ], - "custom": { - "type": "type2" - } - }, - "namespace/TargetRepo3": { - "urls": [ - "../../../origin/test-updater-delegated-roles/namespace/TargetRepo3" - ], - "custom": { - "type": "type3" - } - } - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/COMMIT_EDITMSG deleted file mode 100644 index 3122ba677..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file3 again diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/ORIG_HEAD deleted file mode 100644 index f477082ed..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/config b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/description b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/index b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/index deleted file mode 100644 index 8dc370c0e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/logs/HEAD deleted file mode 100644 index df7cffaba..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/logs/HEAD +++ /dev/null @@ -1,7 +0,0 @@ -0000000000000000000000000000000000000000 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1559986692 +0200 commit (initial): Initial test files -c1ecc553f4318637b40fa04032d94a64d3080ea4 bbd3170a8b88b8e454bf3722343bb4a2835a6cce Renata 1560358832 +0200 commit: Updated file 1 -bbd3170a8b88b8e454bf3722343bb4a2835a6cce f724551bff06e7eedc432f4fc7e07ca3b3fe4203 Renata 1560359301 +0200 commit: Updated file1 -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1560433371 +0200 reset: moving to HEAD~2 -c1ecc553f4318637b40fa04032d94a64d3080ea4 22030c3a7c7f80814c3e1a0b35b4cf133de8764e Renata 1560524535 +0200 commit: Updated file 1 -22030c3a7c7f80814c3e1a0b35b4cf133de8764e 841ea504c1748bdf888387d84c93e7a7d1ac2274 Renata 1560525745 +0200 commit: Updated file 2 -841ea504c1748bdf888387d84c93e7a7d1ac2274 b047c591809362a0b155d18839df22acb9c4c409 Renata 1560525981 +0200 commit: Updated file3 again diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/logs/refs/heads/master deleted file mode 100644 index df7cffaba..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/logs/refs/heads/master +++ /dev/null @@ -1,7 +0,0 @@ -0000000000000000000000000000000000000000 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1559986692 +0200 commit (initial): Initial test files -c1ecc553f4318637b40fa04032d94a64d3080ea4 bbd3170a8b88b8e454bf3722343bb4a2835a6cce Renata 1560358832 +0200 commit: Updated file 1 -bbd3170a8b88b8e454bf3722343bb4a2835a6cce f724551bff06e7eedc432f4fc7e07ca3b3fe4203 Renata 1560359301 +0200 commit: Updated file1 -f724551bff06e7eedc432f4fc7e07ca3b3fe4203 c1ecc553f4318637b40fa04032d94a64d3080ea4 Renata 1560433371 +0200 reset: moving to HEAD~2 -c1ecc553f4318637b40fa04032d94a64d3080ea4 22030c3a7c7f80814c3e1a0b35b4cf133de8764e Renata 1560524535 +0200 commit: Updated file 1 -22030c3a7c7f80814c3e1a0b35b4cf133de8764e 841ea504c1748bdf888387d84c93e7a7d1ac2274 Renata 1560525745 +0200 commit: Updated file 2 -841ea504c1748bdf888387d84c93e7a7d1ac2274 b047c591809362a0b155d18839df22acb9c4c409 Renata 1560525981 +0200 commit: Updated file3 again diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/16/28fc827c8de3cc82d5f76c97e4ede0fdf25970 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/16/28fc827c8de3cc82d5f76c97e4ede0fdf25970 deleted file mode 100644 index 44b87c051..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/16/28fc827c8de3cc82d5f76c97e4ede0fdf25970 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/22/030c3a7c7f80814c3e1a0b35b4cf133de8764e b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/22/030c3a7c7f80814c3e1a0b35b4cf133de8764e deleted file mode 100644 index 6464e8c2a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/22/030c3a7c7f80814c3e1a0b35b4cf133de8764e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd deleted file mode 100644 index 14c79b160..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/3d/2bcf0dabaaa3f10323d1b56ed2ed3a3f4fc9bd and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/74/4fe0b351f9ab576ae0d20968bf6ceb0976a691 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/74/4fe0b351f9ab576ae0d20968bf6ceb0976a691 deleted file mode 100644 index 4c0f1384e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/74/4fe0b351f9ab576ae0d20968bf6ceb0976a691 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/76/497fdc0dec30958a35bea267862c4d7f56647f b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/76/497fdc0dec30958a35bea267862c4d7f56647f deleted file mode 100644 index 4ebd6f217..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/76/497fdc0dec30958a35bea267862c4d7f56647f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/84/1ea504c1748bdf888387d84c93e7a7d1ac2274 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/84/1ea504c1748bdf888387d84c93e7a7d1ac2274 deleted file mode 100644 index 823a7486d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/84/1ea504c1748bdf888387d84c93e7a7d1ac2274 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a deleted file mode 100644 index efa3c3780..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/86/eebb3a3703d0b9259ec0eb4843c1ccf8e8077a +++ /dev/null @@ -1 +0,0 @@ -x%‹Á €0 y3…W@<`hQ*"µMÕäÑñ EòÃ>c–ˆóX®‡•B JË£a„Ä>ö¯uj‚mö¤·T \™ÍÜ‹l(Òÿ÷ Ø Ó \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 deleted file mode 100644 index 639667dfd..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/9d/22333b71737d2a8998f4d0dd0ae791fcf8b103 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf deleted file mode 100644 index 342a8d00a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/9d/bd9258ba353523b4f09f78361570d0d9238aaf and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 deleted file mode 100644 index 54149b7f4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/a3/75263bd2344da4b3dc767f3e35e8b3c436a403 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/b0/47c591809362a0b155d18839df22acb9c4c409 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/b0/47c591809362a0b155d18839df22acb9c4c409 deleted file mode 100644 index 929338f1c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/b0/47c591809362a0b155d18839df22acb9c4c409 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 deleted file mode 100644 index 19010f622..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/b9/b40b3e7159902e794ed7db244b2cf55b30a568 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce deleted file mode 100644 index af719c046..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/bb/d3170a8b88b8e454bf3722343bb4a2835a6cce and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 deleted file mode 100644 index ac48d69dd..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c1/ecc553f4318637b40fa04032d94a64d3080ea4 +++ /dev/null @@ -1 +0,0 @@ -x•‘I›@„sæWô%ƒi6K™(ìf0Ë`–[c §¡Íê±}œ‰rË%ïTú¤R•^ϧ™$+_æ±®‚²ÈK°¬x(JXeIn` ÅZ)áQ€8È e~? ª{4#ð}?…òŸ¡ßŽçÓ°ÅíV‘¤-XŽç8æAasýŸ6|ÁÁàëïÓLÛñA` vl_}K"ó“3€$4jºªV1M—MbyCïæV.ªÃ.Ti»{‰CÓRé]Æ«:î¿œqhekØ°î%ëáŠÔ*ïõhz;Q6Ö÷)~%æR5Nê.¶Ñ_c‘¸—ûé­ã@'§w¥']ï÷½´2mô–6L«¶Wƒ×¾)ä¸4Åu9"o+”ctÝÚ:{wd€:[‚`î±>Á·ê½ Ð(ƒä=:wéÙñ]&[Wg¤ÔkB}³„Š1O;S¾e •Ó ÇÂêá1/8ß_÷¬u-ÙÛAf)½È¥b“†:ùšWQ:!äÝ‚æâÂÜA9ïIÝ@Ÿ´.Dï³9ˆ—ÂU¶™tM²“ßð›(á2ÕÚã 0¬JPÜ‚šÆÐÁÐÔ¦M¡mïžQŸ?:°è­Tr\‡JÛ^^ž<)µÜ×\Y:î<†ÏÏ xŽ’2V5}ã_›2NOf‚(˜ëi ¡õÄü.³ÖÞ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 deleted file mode 100644 index db45f8bc7..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c5/d432429b7a0161f151317cfa6da04d7b8a4b60 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c6/f787e7e67df73f8d5ce5e945af8aef1c71f154 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c6/f787e7e67df73f8d5ce5e945af8aef1c71f154 deleted file mode 100644 index 9c20be511..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/c6/f787e7e67df73f8d5ce5e945af8aef1c71f154 +++ /dev/null @@ -1,2 +0,0 @@ -xŒQ -€ Dûîs…ˆ>ºGXs¥uE7ðø™03Ǹ¨ç±\4Œ4M î”Jdwƒcÿ[å¢ØÖiOzk6’Ü@ˆb6<'†¤•ñOÆ~¾|ï#Ù \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 deleted file mode 100644 index 8904e790b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/d5/39d29be5cbf2073a9b5f8ab55792d764a15005 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/dc/a3a71926e6985b004690d3f3cbca99632d951e b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/dc/a3a71926e6985b004690d3f3cbca99632d951e deleted file mode 100644 index 967889e84..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/dc/a3a71926e6985b004690d3f3cbca99632d951e and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/e9/00725bc7f886b24dc284739be009c4668282c0 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/e9/00725bc7f886b24dc284739be009c4668282c0 deleted file mode 100644 index 12e701c0d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/e9/00725bc7f886b24dc284739be009c4668282c0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 deleted file mode 100644 index 74429630c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/objects/f7/24551bff06e7eedc432f4fc7e07ca3b3fe4203 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/refs/heads/master deleted file mode 100644 index 0fd311689..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -b047c591809362a0b155d18839df22acb9c4c409 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file1.txt deleted file mode 100644 index 744fe0b35..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file1.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 1 of repo 1 -Updated text \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file2.txt deleted file mode 100644 index 1628fc827..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file2.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 2 of repo 1 -More text \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file3.txt b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file3.txt deleted file mode 100644 index c6f787e7e..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo1/repo1_file3.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 3 of repo 1 -This file contains a little bit more updated text \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/COMMIT_EDITMSG deleted file mode 100644 index 8fe4a1834..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/ORIG_HEAD deleted file mode 100644 index 041c364c6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -3a9c6c6145cd7d8e2beefd5e18335b023e260492 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/config b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/description b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/index b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/index deleted file mode 100644 index 5734a2a3b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/logs/HEAD deleted file mode 100644 index 7bc6b9ddb..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/logs/HEAD +++ /dev/null @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1559986797 +0200 commit (initial): Initial test files -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 Renata 1560359233 +0200 commit: Updated file2 -00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 3a9c6c6145cd7d8e2beefd5e18335b023e260492 Renata 1560359372 +0200 commit: Added new file file3 -3a9c6c6145cd7d8e2beefd5e18335b023e260492 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1560433380 +0200 reset: moving to HEAD~2 -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 f63a454d65a492bfd1f51b3174391919d018ffcc Renata 1560525784 +0200 commit: Updated file1 -f63a454d65a492bfd1f51b3174391919d018ffcc 916e3b7bee8868cc9ac378a11ab86cfed7012c77 Renata 1560526012 +0200 commit: Updated file2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/logs/refs/heads/master deleted file mode 100644 index 7bc6b9ddb..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/logs/refs/heads/master +++ /dev/null @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1559986797 +0200 commit (initial): Initial test files -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 Renata 1560359233 +0200 commit: Updated file2 -00f7a8895f7fabda62b7d0fcee5b27b89094cbe9 3a9c6c6145cd7d8e2beefd5e18335b023e260492 Renata 1560359372 +0200 commit: Added new file file3 -3a9c6c6145cd7d8e2beefd5e18335b023e260492 e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 Renata 1560433380 +0200 reset: moving to HEAD~2 -e48aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 f63a454d65a492bfd1f51b3174391919d018ffcc Renata 1560525784 +0200 commit: Updated file1 -f63a454d65a492bfd1f51b3174391919d018ffcc 916e3b7bee8868cc9ac378a11ab86cfed7012c77 Renata 1560526012 +0200 commit: Updated file2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 deleted file mode 100644 index 3aee50134..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/00/f7a8895f7fabda62b7d0fcee5b27b89094cbe9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 deleted file mode 100644 index 087b472b0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/2d/3c13fa1b386234b08e4afe2d9fb175ed2bbdb8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa deleted file mode 100644 index 09d13f56e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/2f/c534882a6cab95090cd440a26c94271da675fa and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/36/f02e24f3d87c214f1139250bce7310845f6228 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/36/f02e24f3d87c214f1139250bce7310845f6228 deleted file mode 100644 index 8a67ff64c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/36/f02e24f3d87c214f1139250bce7310845f6228 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 deleted file mode 100644 index 3caceda18..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/3a/9c6c6145cd7d8e2beefd5e18335b023e260492 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/40/a92f3894711962e2804a6181470b2fd5f21609 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/40/a92f3894711962e2804a6181470b2fd5f21609 deleted file mode 100644 index a320e2559..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/40/a92f3894711962e2804a6181470b2fd5f21609 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 deleted file mode 100644 index f04c5be73..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/41/58568dcd26c49162a7b58c6ba8c602ece92151 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca deleted file mode 100644 index 131a0cd58..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/41/7f4caee889564333a5af1a19f4b36acd79dcca and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 deleted file mode 100644 index adf64119a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f deleted file mode 100644 index 4855cdd63..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/54/d9e398f3c8d1bd0a59e6e8607b7d5ebba2466f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/89/757187ac008f057b2710dffe8bf8d50ef274e2 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/89/757187ac008f057b2710dffe8bf8d50ef274e2 deleted file mode 100644 index e450ad6a7..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/89/757187ac008f057b2710dffe8bf8d50ef274e2 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/91/6e3b7bee8868cc9ac378a11ab86cfed7012c77 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/91/6e3b7bee8868cc9ac378a11ab86cfed7012c77 deleted file mode 100644 index 4ed816065..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/91/6e3b7bee8868cc9ac378a11ab86cfed7012c77 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 deleted file mode 100644 index 4bc9f84e3..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/a3/a620ed31707973f26ddee45730ee70d6e11773 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/ac/93e4403894c426da9001459dabf36f64621f49 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/ac/93e4403894c426da9001459dabf36f64621f49 deleted file mode 100644 index 242e2c8b4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/ac/93e4403894c426da9001459dabf36f64621f49 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 deleted file mode 100644 index 9d86edc0e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/e4/8aa4cbe35328c6da2c2b0cc7fe24a4f5d7d125 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/f6/3a454d65a492bfd1f51b3174391919d018ffcc b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/f6/3a454d65a492bfd1f51b3174391919d018ffcc deleted file mode 100644 index 60eea1c34..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/f6/3a454d65a492bfd1f51b3174391919d018ffcc and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb deleted file mode 100644 index 704fc7fc8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/objects/fc/c954b553ff8f4f9c00050e199439e3e2ad39eb and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/refs/heads/master deleted file mode 100644 index cd9557877..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -916e3b7bee8868cc9ac378a11ab86cfed7012c77 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/repo2_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/repo2_file1.txt deleted file mode 100644 index 40a92f389..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/repo2_file1.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 1 of repo 2 -Adding another line \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/repo2_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/repo2_file2.txt deleted file mode 100644 index 36f02e24f..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo2/repo2_file2.txt +++ /dev/null @@ -1 +0,0 @@ -This is some changed text of file 2 of repo 2 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/another_file.txt b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/another_file.txt deleted file mode 100644 index 6fd826cb4..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/another_file.txt +++ /dev/null @@ -1 +0,0 @@ -There is some text in the new file \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/COMMIT_EDITMSG deleted file mode 100644 index 76c97b17e..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/ORIG_HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/ORIG_HEAD deleted file mode 100644 index a97d5b665..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/config b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/config deleted file mode 100644 index 8ad0b1bad..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/description b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/index b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/index deleted file mode 100644 index ee97fd6ca..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/logs/HEAD deleted file mode 100644 index 01bbc2d4f..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/logs/HEAD +++ /dev/null @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1559986919 +0200 commit (initial): Initial test files -7d5a746e791e512ecaa7bbf644205077e8cce10b 7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 Renata 1560359205 +0200 commit: Updated file3 -7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1560433388 +0200 reset: moving to HEAD~1 -7d5a746e791e512ecaa7bbf644205077e8cce10b f759b977c2acdb637a9b2e5b9e9c111df49daf02 Renata 1560524579 +0200 commit: Updated file 3 -f759b977c2acdb637a9b2e5b9e9c111df49daf02 bfe46421a4e5ca657bedfceae44196fa7e02eb01 Renata 1560525835 +0200 commit: Added a new file -bfe46421a4e5ca657bedfceae44196fa7e02eb01 fc59e8890573dd39f45cc9e539f06989817d1124 Renata 1560526056 +0200 commit: Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/logs/refs/heads/master deleted file mode 100644 index 01bbc2d4f..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/logs/refs/heads/master +++ /dev/null @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1559986919 +0200 commit (initial): Initial test files -7d5a746e791e512ecaa7bbf644205077e8cce10b 7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 Renata 1560359205 +0200 commit: Updated file3 -7cd397388ca17d2853d73d5cc0f2fc07686ad0c8 7d5a746e791e512ecaa7bbf644205077e8cce10b Renata 1560433388 +0200 reset: moving to HEAD~1 -7d5a746e791e512ecaa7bbf644205077e8cce10b f759b977c2acdb637a9b2e5b9e9c111df49daf02 Renata 1560524579 +0200 commit: Updated file 3 -f759b977c2acdb637a9b2e5b9e9c111df49daf02 bfe46421a4e5ca657bedfceae44196fa7e02eb01 Renata 1560525835 +0200 commit: Added a new file -bfe46421a4e5ca657bedfceae44196fa7e02eb01 fc59e8890573dd39f45cc9e539f06989817d1124 Renata 1560526056 +0200 commit: Updated file 2 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 deleted file mode 100644 index 71e4096be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/15/9e591cff1ecfd07de0ece98dacb69b8627d013 +++ /dev/null @@ -1,3 +0,0 @@ -xŒÁ À ûf -PºAwè ‚@ -Œ_@òöÎö,ö¶×—²bI¥hºÒ˜0hHDÌ+Øí:5Ác}ZÇ*HNQ¤8WÒÍí¥ykÀHë&å •~ó¤%^ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/28/1eb1c1333d948ed9d871d6d3c5987d1832c017 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/28/1eb1c1333d948ed9d871d6d3c5987d1832c017 deleted file mode 100644 index 0034c1098..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/28/1eb1c1333d948ed9d871d6d3c5987d1832c017 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 deleted file mode 100644 index adf64119a..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/57/a3cafb8ccdded2f5241975207b66094e4d7735 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/57/a3cafb8ccdded2f5241975207b66094e4d7735 deleted file mode 100644 index b5dfa61e2..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/57/a3cafb8ccdded2f5241975207b66094e4d7735 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/5f/49ee2d84cd72a68f221e1fa88fa90361521f63 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/5f/49ee2d84cd72a68f221e1fa88fa90361521f63 deleted file mode 100644 index 712a6c334..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/5f/49ee2d84cd72a68f221e1fa88fa90361521f63 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/6f/b0e24b79c5da90576284d4716f094e51428815 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/6f/b0e24b79c5da90576284d4716f094e51428815 deleted file mode 100644 index ba8cebeb7..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/6f/b0e24b79c5da90576284d4716f094e51428815 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/6f/d826cb4710f0f2877b65fd71aae186aeed6435 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/6f/d826cb4710f0f2877b65fd71aae186aeed6435 deleted file mode 100644 index ae926f8e0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/6f/d826cb4710f0f2877b65fd71aae186aeed6435 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/7c/d397388ca17d2853d73d5cc0f2fc07686ad0c8 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/7c/d397388ca17d2853d73d5cc0f2fc07686ad0c8 deleted file mode 100644 index dff8580eb..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/7c/d397388ca17d2853d73d5cc0f2fc07686ad0c8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/7d/5a746e791e512ecaa7bbf644205077e8cce10b b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/7d/5a746e791e512ecaa7bbf644205077e8cce10b deleted file mode 100644 index f67ef08b3..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/7d/5a746e791e512ecaa7bbf644205077e8cce10b and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/97/4083f24d6b8a6a6592488887cf1cdaf22a2132 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/97/4083f24d6b8a6a6592488887cf1cdaf22a2132 deleted file mode 100644 index 8dbdb20a0..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/97/4083f24d6b8a6a6592488887cf1cdaf22a2132 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 deleted file mode 100644 index d1f03b94d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/98/f2a726cc799366eb516dace7fb2f95bfb741d5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 deleted file mode 100644 index ae368a7a4..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/b6/fd8a3b438f681629313e4acdd7728827cceae6 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/bf/e46421a4e5ca657bedfceae44196fa7e02eb01 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/bf/e46421a4e5ca657bedfceae44196fa7e02eb01 deleted file mode 100644 index a9949ab1b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/bf/e46421a4e5ca657bedfceae44196fa7e02eb01 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/c7/1b1fbedeaacd365ef5ae5f4792bca0dec8c98f b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/c7/1b1fbedeaacd365ef5ae5f4792bca0dec8c98f deleted file mode 100644 index e6e4d9d64..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/c7/1b1fbedeaacd365ef5ae5f4792bca0dec8c98f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/de/97a13db5f0a17eb8971538c2d781ceb1aa167a b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/de/97a13db5f0a17eb8971538c2d781ceb1aa167a deleted file mode 100644 index 395186f9c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/de/97a13db5f0a17eb8971538c2d781ceb1aa167a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 deleted file mode 100644 index 711223894..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/f7/59b977c2acdb637a9b2e5b9e9c111df49daf02 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/f7/59b977c2acdb637a9b2e5b9e9c111df49daf02 deleted file mode 100644 index a8f81aa59..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/f7/59b977c2acdb637a9b2e5b9e9c111df49daf02 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/fc/59e8890573dd39f45cc9e539f06989817d1124 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/fc/59e8890573dd39f45cc9e539f06989817d1124 deleted file mode 100644 index 902859a03..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/objects/fc/59e8890573dd39f45cc9e539f06989817d1124 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/refs/heads/master deleted file mode 100644 index d85047f78..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -fc59e8890573dd39f45cc9e539f06989817d1124 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/repo3_file1.txt b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/repo3_file1.txt deleted file mode 100644 index 159e591cf..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/repo3_file1.txt +++ /dev/null @@ -1,3 +0,0 @@ -This is some example text of file 1 of repo 2 -This file also has more lines of text -And the third one \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/repo3_file2.txt b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/repo3_file2.txt deleted file mode 100644 index de97a13db..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/repo3_file2.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is some example text of file 2 of repo 3 -Added some more changed text \ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/COMMIT_EDITMSG deleted file mode 100644 index 797ab5cb1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Targets updated diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/config b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/config deleted file mode 100644 index d08c739a9..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/config +++ /dev/null @@ -1,9 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true -[gui] - wmstate = normal - geometry = 1322x693+228+228 254 315 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/description b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/gitk.cache b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/gitk.cache deleted file mode 100644 index fd4d46794..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/gitk.cache +++ /dev/null @@ -1,5 +0,0 @@ -1 3 -4c3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 491e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7 {ce5a43b925d48173cd7362edafa2cdd1b4fdbbf4 491e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7} -842e8fd374ba5e3d7716912b25b7d45bc4910ec1 4c3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 {02f80297e66719d5b3b07fa276884bf74a78bf99 4c3c1a37cc22c5a6abb110aa42bc5ed97dfb9637} -ad8810a4a28014e5ea94462b9465c36e6a03725d 842e8fd374ba5e3d7716912b25b7d45bc4910ec1 842e8fd374ba5e3d7716912b25b7d45bc4910ec1 -1 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/post-update.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/update.sample b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/index b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/index deleted file mode 100644 index 5b9ec4a12..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/info/exclude b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/logs/HEAD b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/logs/HEAD deleted file mode 100644 index d570b6f27..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/logs/HEAD +++ /dev/null @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 491e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7 Renata 1560446629 +0200 commit (initial): Initial metadata -491e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7 ce5a43b925d48173cd7362edafa2cdd1b4fdbbf4 Renata 1560446634 +0200 commit: Added initial targets -ce5a43b925d48173cd7362edafa2cdd1b4fdbbf4 4c3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 Renata 1560525504 +0200 commit: Targets updated -4c3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 02f80297e66719d5b3b07fa276884bf74a78bf99 Renata 1560525797 +0200 commit: Targets updated -02f80297e66719d5b3b07fa276884bf74a78bf99 842e8fd374ba5e3d7716912b25b7d45bc4910ec1 Renata 1560525849 +0200 commit: Targets updated -842e8fd374ba5e3d7716912b25b7d45bc4910ec1 ad8810a4a28014e5ea94462b9465c36e6a03725d Renata 1560526068 +0200 commit: Targets updated diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/logs/refs/heads/master b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/logs/refs/heads/master deleted file mode 100644 index d570b6f27..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/logs/refs/heads/master +++ /dev/null @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 491e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7 Renata 1560446629 +0200 commit (initial): Initial metadata -491e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7 ce5a43b925d48173cd7362edafa2cdd1b4fdbbf4 Renata 1560446634 +0200 commit: Added initial targets -ce5a43b925d48173cd7362edafa2cdd1b4fdbbf4 4c3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 Renata 1560525504 +0200 commit: Targets updated -4c3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 02f80297e66719d5b3b07fa276884bf74a78bf99 Renata 1560525797 +0200 commit: Targets updated -02f80297e66719d5b3b07fa276884bf74a78bf99 842e8fd374ba5e3d7716912b25b7d45bc4910ec1 Renata 1560525849 +0200 commit: Targets updated -842e8fd374ba5e3d7716912b25b7d45bc4910ec1 ad8810a4a28014e5ea94462b9465c36e6a03725d Renata 1560526068 +0200 commit: Targets updated diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/01/5c847991d8c975aa66638f4828b31c0f520435 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/01/5c847991d8c975aa66638f4828b31c0f520435 deleted file mode 100644 index ab876c95e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/01/5c847991d8c975aa66638f4828b31c0f520435 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/02/f80297e66719d5b3b07fa276884bf74a78bf99 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/02/f80297e66719d5b3b07fa276884bf74a78bf99 deleted file mode 100644 index 69d7d1b5c..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/02/f80297e66719d5b3b07fa276884bf74a78bf99 +++ /dev/null @@ -1,3 +0,0 @@ -x•‘ËŽ›@D³æ+z’iÀÐ e¢€y ÌËž±w M7`Àcóõqe—Mîªt¤R•n箫'€DéÓ4–%(sHeREUTH!”VQ‚ -´"y. …,J"]‘’ðXöXR!` …(2Vpž Äx%æ…\ škŠ„8|›ªó’²Ç_ïO÷S¨ßY‡ëöKqî¾á,‹2Òà¡!÷¤ÏrSùŸ66°kÍÀç_gXÎ["'é›êÙ.±~sp Ž­ÅÐuc­ëÄ®-kÃïR—CêN :’½ëmãzilÙz Í¿Ó×ìÿåHc[B3}Iø¦r%çá•Î â÷~œH.Ûšïì$6y émÓš­œÚ¤Â2¹ƒq 8»pؾח»ç©~³ B‚²¸/ih!E‰ÊNG£ÆQ±573ó¢MbF(sÀÐ|ûÃÓ”Öiæj©ìÍötí«²~´,וÙmµ.ží4U%ä-Ñ.h“J3ÔŸMË¿gÌä€Õ×›˜û€,Îåmïã^ŽùŽI/Ëf(Ü‹ú±=¶7Xí·úà3.SZü]Žòû†ö‡•ØúÅÓÊlM#mñ>b$ù¸¢õFˆ¨È³Kûì=õ<Àc£­›- ‚ª§ÓKw}~R "‰Å1Ö£zxx"Eð]Á'¥˜o#Œ__9ðÚ@öƒû³ªšÿÚ”ËðÈÊé -nÁSI¸Ÿ+Ýᆠ\ No newline at end of file diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/09/9f33a42eec78ec077baef5d5c44073d3954707 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/09/9f33a42eec78ec077baef5d5c44073d3954707 deleted file mode 100644 index 0fa90a0ba..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/09/9f33a42eec78ec077baef5d5c44073d3954707 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0c/1f6b1a5ccc6321eff980833ceafe1f4cfb8204 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0c/1f6b1a5ccc6321eff980833ceafe1f4cfb8204 deleted file mode 100644 index f07f96b3b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0c/1f6b1a5ccc6321eff980833ceafe1f4cfb8204 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0d/30ea5c05a8f2aa4b9cb0789d04019685332b9a b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0d/30ea5c05a8f2aa4b9cb0789d04019685332b9a deleted file mode 100644 index a1ff5d95e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0d/30ea5c05a8f2aa4b9cb0789d04019685332b9a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0f/1d39a7798e91595409e0baa2def3a1751a6c73 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0f/1d39a7798e91595409e0baa2def3a1751a6c73 deleted file mode 100644 index 0fdd6138b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/0f/1d39a7798e91595409e0baa2def3a1751a6c73 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/15/18d940c22728160ee46f54079b25ca12d8ec8c b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/15/18d940c22728160ee46f54079b25ca12d8ec8c deleted file mode 100644 index 6e5fd64c7..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/15/18d940c22728160ee46f54079b25ca12d8ec8c and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 deleted file mode 100644 index 316e2141e..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1a/6672e9913001b02ce4bde04e597c2ce5a1e465 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1c/af78894adf4834a5420074d38a607824ca9a7a b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1c/af78894adf4834a5420074d38a607824ca9a7a deleted file mode 100644 index 18a30fa20..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1c/af78894adf4834a5420074d38a607824ca9a7a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1f/c1e32498d96c425f38813779e540f8419bd782 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1f/c1e32498d96c425f38813779e540f8419bd782 deleted file mode 100644 index 4571a521f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/1f/c1e32498d96c425f38813779e540f8419bd782 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/22/5362b991be204786ad6317d9b0548b3548bcb1 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/22/5362b991be204786ad6317d9b0548b3548bcb1 deleted file mode 100644 index d6d6aa700..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/22/5362b991be204786ad6317d9b0548b3548bcb1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/25/3fc148011c4af334277c69ed654ae51e40e653 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/25/3fc148011c4af334277c69ed654ae51e40e653 deleted file mode 100644 index 92fe06361..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/25/3fc148011c4af334277c69ed654ae51e40e653 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/2b/69b58e1b8cd0b9e1de567a922ac3172924dfe4 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/2b/69b58e1b8cd0b9e1de567a922ac3172924dfe4 deleted file mode 100644 index 6abf9efa8..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/2b/69b58e1b8cd0b9e1de567a922ac3172924dfe4 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/39/d1c992b99c5a03656c8e40f7e993ccc5191261 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/39/d1c992b99c5a03656c8e40f7e993ccc5191261 deleted file mode 100644 index cd7f92d5f..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/39/d1c992b99c5a03656c8e40f7e993ccc5191261 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/3b/c94fffb63f377dd4ef9d3a25e4f88d7ecad031 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/3b/c94fffb63f377dd4ef9d3a25e4f88d7ecad031 deleted file mode 100644 index 0860b9393..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/3b/c94fffb63f377dd4ef9d3a25e4f88d7ecad031 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/3c/a4a4e716844452c907184514a1e2722a37c2ba b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/3c/a4a4e716844452c907184514a1e2722a37c2ba deleted file mode 100644 index fa2b5b3de..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/3c/a4a4e716844452c907184514a1e2722a37c2ba and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/47/1f921fbc5a43ae8e84b62457ef48e849808a2a b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/47/1f921fbc5a43ae8e84b62457ef48e849808a2a deleted file mode 100644 index b66ca333c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/47/1f921fbc5a43ae8e84b62457ef48e849808a2a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a deleted file mode 100644 index 328e2453d..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/48/aeed30e8b8d6dd4a1f73922440801cb5ed5a9a and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/49/1e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/49/1e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7 deleted file mode 100644 index 38e883ae6..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/49/1e5c80e0e1b6aa76b212cbd3f8e533f3dac9f7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/4c/3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/4c/3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 deleted file mode 100644 index 60ac0ff90..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/4c/3c1a37cc22c5a6abb110aa42bc5ed97dfb9637 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/4c/437ae6c4aa6de522afb8023231f90bd223b7ce b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/4c/437ae6c4aa6de522afb8023231f90bd223b7ce deleted file mode 100644 index c403075cd..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/4c/437ae6c4aa6de522afb8023231f90bd223b7ce and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/53/aeeb5842aeb9e748037288b1f1e4127f95ca06 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/53/aeeb5842aeb9e748037288b1f1e4127f95ca06 deleted file mode 100644 index f01b54a44..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/53/aeeb5842aeb9e748037288b1f1e4127f95ca06 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/57/5c92b8299868115f3c9709d41b9e7195b2246f b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/57/5c92b8299868115f3c9709d41b9e7195b2246f deleted file mode 100644 index a3055155b..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/57/5c92b8299868115f3c9709d41b9e7195b2246f and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5b/60b6fc5077eb50c21a933400ce20c95cc62fb1 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5b/60b6fc5077eb50c21a933400ce20c95cc62fb1 deleted file mode 100644 index 799cfcad1..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5b/60b6fc5077eb50c21a933400ce20c95cc62fb1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5d/4eb65ccfcd7865b273bb37ba851720c06385a9 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5d/4eb65ccfcd7865b273bb37ba851720c06385a9 deleted file mode 100644 index 243774f3c..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5d/4eb65ccfcd7865b273bb37ba851720c06385a9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5e/2bdfc042039a841c1c4066ff04c8e1bbe02455 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5e/2bdfc042039a841c1c4066ff04c8e1bbe02455 deleted file mode 100644 index 2f6fa5817..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/5e/2bdfc042039a841c1c4066ff04c8e1bbe02455 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 deleted file mode 100644 index 2c7e0aaf5..000000000 Binary files a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/65/c9f4818f267a1ea2e7200cfde7df324ce20a33 and /dev/null differ diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/68/834dd00f566b455484e3d60b01a9778877baba b/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/68/834dd00f566b455484e3d60b01a9778877baba deleted file mode 100644 index 01c925fe1..000000000 --- a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/organization/auth_repo/git/objects/68/834dd00f566b455484e3d60b01a9778877baba +++ /dev/null @@ -1,4 +0,0 @@ -xuRÁn,E 䜯Í™<Ùív»;ßÁ „"»Ûû€l”]Ê¿ãÙð”Ó“æ0ª.—«¬²?ζu®?ü{·í—ÓÓ³^ÿzõËþ°ýr·m nÛþ»¿V";÷¡58Vˆ–>@PJ‹::.…© •B§_[Ø /š ƒ$i>÷oz¹æP3˜TÚ")„%x´IŠ]9ÊB­\h1 -»³¡ªÝ»4‰Npˆ— ^j ÐgmÔÑ:ÍÔ@àî -i@]¸´b‚¨“i@å+…º/rݼH £w -³h^ BËE†&Í[9¸ äÙV™pš– ´†R3ª, l®æ98Q•«+§]£Œ0È Q£RÛZÌ]C|NKÏ“H\ª4Brê&¹<‚Gg[V2?˜OéئZe]yå#,ÈÖ„*ĬÚ°dÜ ‰i\z¶ŠQaº˜54nÄÁ#×v Ä’VcÌÑR'm®B\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/post-update.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/update.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/index b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/index deleted file mode 100644 index 8e8303743..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/info/exclude b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/logs/HEAD b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/logs/HEAD deleted file mode 100644 index 6974dfa57..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/logs/HEAD +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 bc637e0720275380be157e5583433167ec9870cb Renata 1580836116 +0100 commit (initial): Initial metadata files -bc637e0720275380be157e5583433167ec9870cb edb0f609abc005e287a341abefb50833554abd87 Renata 1580836565 +0100 commit: Added targets diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/logs/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/logs/refs/heads/master deleted file mode 100644 index 6974dfa57..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/logs/refs/heads/master +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 bc637e0720275380be157e5583433167ec9870cb Renata 1580836116 +0100 commit (initial): Initial metadata files -bc637e0720275380be157e5583433167ec9870cb edb0f609abc005e287a341abefb50833554abd87 Renata 1580836565 +0100 commit: Added targets diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/0a/15d72e859c9c82b3fee516b2e425fc8d358aa3 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/0a/15d72e859c9c82b3fee516b2e425fc8d358aa3 deleted file mode 100644 index b180ed907..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/0a/15d72e859c9c82b3fee516b2e425fc8d358aa3 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/0f/7793a36f38214cc7053177c5648132b36b14df b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/0f/7793a36f38214cc7053177c5648132b36b14df deleted file mode 100644 index e8796bc22..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/0f/7793a36f38214cc7053177c5648132b36b14df and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/16/aed34909178fd46b993a6d37461c077aa27f8a b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/16/aed34909178fd46b993a6d37461c077aa27f8a deleted file mode 100644 index 6f044fb84..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/16/aed34909178fd46b993a6d37461c077aa27f8a and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/2e/bc28f92dac45bf076c97376b3748e819aebb35 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/2e/bc28f92dac45bf076c97376b3748e819aebb35 deleted file mode 100644 index f1d300c8a..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/2e/bc28f92dac45bf076c97376b3748e819aebb35 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 deleted file mode 100644 index adf64119a..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/4f/908e540fe0da3d5f0053ba90cef56c6edaee70 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/4f/908e540fe0da3d5f0053ba90cef56c6edaee70 deleted file mode 100644 index 0f9e27615..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/4f/908e540fe0da3d5f0053ba90cef56c6edaee70 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/6d/a80a6207ce9e8c0ea5a24d0705b3d2d6a96812 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/6d/a80a6207ce9e8c0ea5a24d0705b3d2d6a96812 deleted file mode 100644 index 0ef2a5089..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/6d/a80a6207ce9e8c0ea5a24d0705b3d2d6a96812 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/6e/6a78a47e12514fcd972b12df5af72bd8254f0b b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/6e/6a78a47e12514fcd972b12df5af72bd8254f0b deleted file mode 100644 index 4e71e3300..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/6e/6a78a47e12514fcd972b12df5af72bd8254f0b and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/79/e3471abb416b560726e0de8b8201152df0ec54 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/79/e3471abb416b560726e0de8b8201152df0ec54 deleted file mode 100644 index 4c5c30a3a..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/79/e3471abb416b560726e0de8b8201152df0ec54 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/7e/2431285c446f4d50ac9a526c4042d8ba7b0a47 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/7e/2431285c446f4d50ac9a526c4042d8ba7b0a47 deleted file mode 100644 index f5db07eae..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/7e/2431285c446f4d50ac9a526c4042d8ba7b0a47 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/8f/09fc72990871475f478dd0d3cdbebf8661b045 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/8f/09fc72990871475f478dd0d3cdbebf8661b045 deleted file mode 100644 index e0b375c7f..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/8f/09fc72990871475f478dd0d3cdbebf8661b045 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/9d/fb414a39e32c16efe8dfd08bfcb5f643e3f9e1 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/9d/fb414a39e32c16efe8dfd08bfcb5f643e3f9e1 deleted file mode 100644 index 5bbe15411..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/9d/fb414a39e32c16efe8dfd08bfcb5f643e3f9e1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/9f/0d279df63ba7bb029b2b8b26976845010c6cb4 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/9f/0d279df63ba7bb029b2b8b26976845010c6cb4 deleted file mode 100644 index b99e3acc1..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/9f/0d279df63ba7bb029b2b8b26976845010c6cb4 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/a7/3cd19dee0b69307cfa006cb33aeb29c81ae939 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/a7/3cd19dee0b69307cfa006cb33aeb29c81ae939 deleted file mode 100644 index 1d82cb5f8..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/a7/3cd19dee0b69307cfa006cb33aeb29c81ae939 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/a7/63dc734077f363a19e560c634e98f62b1a264d b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/a7/63dc734077f363a19e560c634e98f62b1a264d deleted file mode 100644 index 03cdda752..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/a7/63dc734077f363a19e560c634e98f62b1a264d +++ /dev/null @@ -1,4 +0,0 @@ -xSËndE e¯hÝ53²]å²+ßÁ -„¢rÙBwÔÝ F(ÿŽo4š‘®jáë×9ÇÇ^Îv@üîï‡Ãv=>ŸÆíK\·ÇÃO‡C‡í·ørôŒl5Æ’ªKF)=?0/B޲ňàˆZFY½ÑФ®M˜'†‡Øöý½_ŽÙ»Ê1dŽY‹ú¯f+ŸÕ*¬ÝP&ädŸÞ*[«Ø¬ö¢ c +DÁÌ%æ¨ÖÌÍÄÖDèeô\ ‚NšP%ØWdc1G+!^¹ŽÄžý`ö˜ÒÄ”[‚%-½CÃ^jH èÀm®6Y›*ä’@ ²¦ñ 3n4m(,«N0Zpõh*¢$ÒL²_§ªbâ"«Wj3ÖÂ$½j]³3÷iù®I®cbOrÑÊÂE+Ѧ>XrKì`ÑO--Š;–)KY¸Ì¥Ñ%)HˆÍy ‰ƒ°&–ÖKø"HZòO‰Çg3¶È¸¦VU‹5ÇD=k^&™<<7j*AŠ6ï‚`Êìu2•E©™ìå]X bð,C°-·EI'Yƒœá)êNÆtqB &OÔ¬h6°TòH[Ø(ê*„J*’—3›ô<³ -S&AÊçÜ­:ל£zôµð.ÌLP£S©•¡dR’­ÎÍrÐ`èÝKÅÒÝt_œóò®Œfè¢s¸EKQŠr¨5E^ÜÉÅö}¶4ÃÛÃáç4ÅÝy±{lwÜötûò»E®§ñzýå|»g‹¿^ïÞÜ>}Büåð‘ÛïI¿ÇmüÛç°y¼Äó¸…?]Î/Ÿ½žOÿýT}f^^jQ<ª-Mbë.{rŠ÷_Éži•kî&Ã^µ¨¾ ª‰(—ç%gÀ¼ØÏù§h&G¡{¼{ï…Ëg÷íoKÜà -5­$±(=µ¤bëíWº[µ¦¦湺öHgSïÇ2=0u™¹©Å%‰¹•Ëm.Î}ÇiPó‹!g³ÕkÍR/- \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/ab/5c4280bbcb1b0ea93944bc5abf682beff570d9 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/ab/5c4280bbcb1b0ea93944bc5abf682beff570d9 deleted file mode 100644 index 57ca6c2c3..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/ab/5c4280bbcb1b0ea93944bc5abf682beff570d9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/bc/637e0720275380be157e5583433167ec9870cb b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/bc/637e0720275380be157e5583433167ec9870cb deleted file mode 100644 index fc52f4bb1..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/bc/637e0720275380be157e5583433167ec9870cb +++ /dev/null @@ -1,2 +0,0 @@ -x•Á -!@;ûsbtÍu!¢k×þ`Ô±]Á¦¾¿­?èöxðx±·Vô<ïd0C´A"C8Ù”-¦°¶ì å@h¢åÅ/IÑK}ÀW‚Ó{üÀ_îJ=ÄÞΠýä´v°G¨6»Í„ÿÌÔu-R¨Bc¡ôÝåRù©>j…9ò \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/c2/927eab6d87815de22d4d236d92beb13510ccb5 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/c2/927eab6d87815de22d4d236d92beb13510ccb5 deleted file mode 100644 index 88173624f..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/c2/927eab6d87815de22d4d236d92beb13510ccb5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/c4/b12aa2a034df40db92e4e62afba02c4e989b0a b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/c4/b12aa2a034df40db92e4e62afba02c4e989b0a deleted file mode 100644 index 00e6bfb21..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/c4/b12aa2a034df40db92e4e62afba02c4e989b0a and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/db/ea2db4572a9566c30cd5adc4898280fae31c8c b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/db/ea2db4572a9566c30cd5adc4898280fae31c8c deleted file mode 100644 index c428240bd..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/db/ea2db4572a9566c30cd5adc4898280fae31c8c and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 deleted file mode 100644 index 711223894..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/ed/b0f609abc005e287a341abefb50833554abd87 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/ed/b0f609abc005e287a341abefb50833554abd87 deleted file mode 100644 index cc68c6712..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/objects/ed/b0f609abc005e287a341abefb50833554abd87 +++ /dev/null @@ -1,2 +0,0 @@ -x•ŽA -Â0]çÙ òÓô')ˆè¼ÁOòR ¶•=¿¹‚»a``Ò¾®KÓƒq‡V=–‰x¤Êb3"¶Q&J(ì’CÀ“zIÅÖtLÎzhðlEö`v´Ö84O)*ù´Ç^õ›4Ñço¯;„ë¼Êò<¥}½hÂuìXÉ©nû\ß™ºåŒ¬›Ôí­~öC_ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/refs/heads/master deleted file mode 100644 index ddbd4e077..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -edb0f609abc005e287a341abefb50833554abd87 diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/1.root.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/1.root.json deleted file mode 100644 index 0a15d72e8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/1.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714", - "sig": "8d666c1a67535add88f84e4504f9ba8cf088584cce9684f9b07b7958d1af09f72092cb1ebed5671c61615ccdbc5a77d214553bc3e0f131f6fd52a3ed9fcdda73db7482cf92b112e66407c24f7eae51c56b0e89de5a7f1e2aa97bcbe51174e6f7da5e7749df41ff9242936480d985bf0076200e32dcc3e65ecb50c4cb1ae016205c1e47baf1d273eeada7f84cbd1684cdbaaae76ead16b9b90531e94057a74f0fe014168db6b5f6707cd90eb8dc88f348e4eaa27a5a074a911e942d8bba83c47e3d253306c2751b2d2a526bb2983214f56b48216d4ae87d83c263d05fc3ae6564fdf817811cd511702f053bfdecea429876f8c0f5736cdd58a0fb894b60337f0041182b10cd8da8b10b837d076ac7845dba572d44cbac14e2ca44ba73d83c23ced03fafc1ade3bebcc3221dee256d727783e1adc58291b7cc3cae1973eb21f69472843b46b7418881d0b60b5d0926014d8b808d4b2403fd0443760bc295bcb26f3d24c3e745921d726006607ee76a8dec7898461b094873cf4948880cdcbe5d88" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2021-02-03T22:50:16Z", - "keys": { - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt8lxr3x5fdX888ETUN6L\nheNzR9B6taDcFrxzfhLKHMBr1ibsW6cC65XdFWTjXlyEwv0O6Q8KtRxsZ4VWZC++\njPBmqx64pIwavlKKVTxYKyDiviKaFQSpHFbzWJadyylrnK0TVdPuaOvBv6kfszim\ncIRIPdbqWBCt34UG79fAbDLH23lA5dFhQVEW0v1r8Wt937lj24YCAw9aBLwbkjSs\nyTYHYKJiIb64YK75OCU7BNrG56uwtlGjNDrlDJbWqnkjaSzDp8KhDNm/iq3O1QDq\njTY5WkMR75Kn+cPJ06kxHcJ9sbmorXFBQwiFe9iDe/AQG5xrjkm/vDWLL0iC1ZKP\nM4t1qPRKYiijm4emnZ4IHkx7EgcDBNNoOorsMDj7IQqMb2t2mJsW4/1wjdUGOmWF\nKzFWLYux8uwTQPHinNl12CtQeTkLs5KvDK5Wja/dbps8Riw2+qL5u4auuTP5MHKk\nQdRmlMFDS5B+ka/GyitXucx1WeXp1sZ79WCOn7aTkLMtAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAlVOTOqAJpxv/33JXMObi\nXD3luL+yuDf+rhIEG6II8JA6qbYW8aEx9yj+Ku4sDQD1BLJ44ebEX7qxzLJPv3LC\nYQN12La6nUS9kuK2tI1SISrBKjddaC+p/l+aMqPDT6lnt/qnbsZc2SCNdK0CPAnh\nWSOZyxf+e1ZRkKT20guqNV2W30ww764uNn5ST4SDdKqgQgUBPDaPZSlGLcAXxXCK\nQEP/b8jyiz3BFxZyJwCk2H7e41gG9nBceX/ARvCZFZMuGIR7zK6cd8A+6WDF7eM1\n5onj1lYPLL7Mi+bFAbDzCF75NQL+nSTjn4e9olLfiXap/XbnYck0huRAbaIpDZxC\nIZhX8VUlgeO9Y5/PeS16etCsP/Ch4YL5ijZQma0yUDh5Qmier9X3YHV5nTBYu/zN\n5U9tLzZ+GnKG8jDgKQJwFDLv60Hk27KlrCHkrWXZnI9TIXa7d4cpp5RUVfpU4Dal\nwrWGXzHg/EjYHx5qXJc93dUoGvSKS5Jz/Y8MNeVppIvZAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAufSY8KwZIja0Na750LCC\nHovf3Ktfh7jnmaNXsFvlTXfnyOaHfJTCU+6pXTdAHYoIcnZLEx8gEC1PobibvFqt\nicM4ZDh8OQMlgUofXmGOgwLaRaPYEZ3nZPAQKtE1ISDbyZ61FnjLAQOHXDlA/kUy\nJLH6KBeVS18kvFqCnelgiJADWGroWJP6vRer2WRxvhSKp2Uh9EUL2zSjzo2Kfome\nqp3Lx+AP5tRza2UTnrEPkIjqQUAqUcQN5bRJ77hGWCtjtAx1M3yXs6cou/Au1Xg2\njLeDSbgi+57cxVuYmHUQwk+XLOabXgdUDOav5rBHoU4owXDo2lWI6ktKV1SEsxl7\nNNI6rQ0ef3tbDjhCjjBLYbhEngXAUI/VMHycJB1tIvzVb7zrvuTSYcMmBAS6Tg62\nJgMzAIh7Qc8SUgR9JaDgGGksKSXtEruvR6kGDApHglIUbTgKyT9fh8sZ5m0czzKW\nLBSXwYmZHnt0bKNFdf2gvkqfP4iV4moRkZi5Qzf7BostAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwvyLoT3TNFzwOXbwO5eU\n8eGrIFyXGa97w0cp44l4rASZKJ7I9/AjoCuitKYiodIPtVP5dGtY+dZFNQvXjdQp\n7Te/bDyj4T64jmlOFJ5MT+Qx4g9tqaW6w6v886ZqlUTe422v2cinwXAFlodDMOxK\niZ088vFGON8Ju1jsRN2L3P4tW2mu1wOV6RDUTm+qP3VrxnWo4aleTWAVjU80v/vm\nId4HZvwYDATnkdhKgPsEFTbiPsXil00UKfO5FAExdls1978REdLLfEgLJnYtIOpH\nqmigmGiIchZlGAl8JYrCRrYgMWxiEWnXfQWqRGDJ/AJV6Nbuf9wrStd3i3yPcJHV\nb1oHLBDCCJ6k7Qa3LJIYXk/a/N6NB9g3/Bfg8nJVuCF+LQ8M7mhC9xCXCOjPIyGd\nUNyx4BqxKtSOSSJrR9OLIFDKdxw8kKWC+5DPQXlTA1bAjdMeR6ZXWYLxMOSn2jep\nySAx3eU3UdhOzG7Esw7vMbVa1oyBNloyas7uwXV9tMu1AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/delegated_role1.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/delegated_role1.json deleted file mode 100644 index c2927eab6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/delegated_role1.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "signatures": [ - { - "keyid": "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1", - "sig": "937e5bf8bf61d48da8750a2333d63fc90515c161a8896a38df23d91de697c2504d632adaa42d4b15d927be990b49af214d792fe963b4e21b5cd9ffa4c13d78826feaa21a87a2976c045f91dd8989925b260f6eb863e82e6479cf10977d644bc8db9130869d09a92b5bbded2dfaeff6163fa0bdd31c7c723d4590e4f1efb683b30d8c0b6b5a59dea5964779a290b147be554c445cd33f7fd5e1347ee6f1503bfaa3c7149299e319239da65ea3ee5e237e2eac2e440b600288a16417b626ad65c6acd2c9e31b23cd7d94db9f7c3d993208777cbd7567d671fc40df2af2f1ffb22ee62d16361eb9de3e5304c9fba14002e576198e18b33adafce3e04f22bf95e4e1b594bc16d1940e0d263550b9bdef554e62ac441a40ddd715aebf446249e6c5ec54c7d685b06c751f0fe09b28b93b885172189e321b95d274b8d50a29e30e0f94fe40d56880dfa30050b4a56ebcf95d210aa1f6fea9ef2188868647330d04fc291b067579ed7b6ba01f07d66e80f8d5f0d12b861ed1be4d6f5dbcd9d13e64d643" - }, - { - "keyid": "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db", - "sig": "75f1474e7c6911630dc85e4b1e650459d8a5fa7cdb630c5484a8bf5c2424ef7367847aead52e0c5b14cfb956dc463ffc2f2d196c7258c0ca53d95ccac55a05d7f29e2424258817d5a3723a898fdec487530a27db623affbd4ea9ea372d3a25fcf45978b56f4a080aa4c01b7821c4bdd687d984ccb5e011932dee64ce46b134d214b533ab18144843569e268adda7b6bb06df7ad69fc33b1e9f3884c788f5f5f0ed36e9a49ba3be0ec821cf724947234d7d6c6d07bbdac597e8ce053bed8872353eec7c08661f0c17590d1ad9104d429fe8428d5de84bb9d00ebe174250fb42a799e8d4b671e58737ac782dbe549241361d25e00f11a30fab18cc310f91570d040054a9e9643f41e19b55ba4787eb6d81ba93bf90c39cea905ace68d99ce958e0aa4b708e43a25c9a6824e9d03bbedcdb9d911fc0a12ca9616a6044cddc1b4a2245ac9b138fa0185020cec1f2168b9063ed48df2893b854fa1a7d332d90c3b8bda15fa4788f8a22cbc1e1973d9ab1310cec38f7dd46bd82fe9def3caf6318eb7f" - }, - { - "keyid": "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3", - "sig": "65cdf5f38dacf24d2240bfa487496f13b754ffb8639f827f8796fe0937676d6ad7face66209eae30635ec1fcc7745c1cb9bba835c5416b10fc924d495af8870ae8964d07f5f47b52bff0938ee4ba8662961a34c669cd7d4a37a79f176fee4b3f770cf5a1f8f57fb3cb8939c269f7e4ca3a4ced1307c1a86be1e6612cff4a5a345d47aca8ac1896a2016ebe3f9c2be35474aa880f6f18058611f7211027edd4543dc8a3aed55c667db5d96f55a3a6078d2c4c117f3e6565a65883f76cac7a3624cf4bfe265a5deee58d98feb478def7a48ba114d1a915b8aabdc0472f9bef4c35408ce918720bd0fe226d1c938de5177bd6d53566e94bcc5c7322e64f672ca8bf77fee90031947981c27c06c4943036c14fba79286e25b78f75cf84de7d3f630a1801b8d6a1e549f3efe985a8090d7c54343fc8527d6bbe7d5d5a3a7d48c3f09d78a1fffe126d74c13f7954ba8e5a1688d85b7e14d808f93f9a2f819e967dfe08645cb3d4e0a6d1b3de846d06ab7ea5eb05aaf6a13b78f732fab7f1f7f9ff4383" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2020-02-05T18:14:02Z", - "spec_version": "1.0", - "targets": { - "dir1/delegated_role1_1.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - }, - "dir1/delegated_role1_2.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - } - }, - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/delegated_role2.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/delegated_role2.json deleted file mode 100644 index 0f7793a36..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/delegated_role2.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "signatures": [ - { - "keyid": "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816", - "sig": "79a8186bda7a97927aa38a2f0061107a00d4b3406655dfe004632716050da26c3c3f7d0ff1000770ccbf6e532dc562aecad211252e31651c682cfe16e4ae2345718857e51a10f5c369d7a2305f5de6aadb72d83d0d369c8d2afbb83390b1513d916b8474d567ea38f5d2231c1cbe4a40d9810da8b97975c0131c86cf693b4b00cb62673255af1589b02d6c778d60c6d570d8e385f79db1b29e887f4203fc13419e5bfe11832b4f0b19417bfc66149ecf862d3587c260302f3fa3c3ba8ba70d68d84d20130609e57ad866425a0f2633d9134044832ff97f815adf122cd65c9eacb17ea10bb38aeaa265d3bf095775500d365abb84a5ca0429ce59624ac3ddd55605d0914669d9e2b81d3d96741b5ea8bc7fb64829b77ba78e4dadfdea7cbba5e21b421cdd7c259c26149701e24ea26b8f0c893f9db7a49c5a595c1fb80a25c6df04de30bff5b5909256dd46dccd7289933c8c5417dcae68c30423f99c5f9d7bea808f45b57d5f047262ba138f537f7a6ff3dde63b0ccae3a68248344cdbc6430d" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": { - "39488e374e65b072b1196eef5ee0bebc5fac0574f5a5bcea1240c5c071571bae": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAuOoH2wIn1ThP8zYJ0JEA\nqS0vjNo8mjidSDgRpWTcXLWoipI7tqvVADnbi0rnMdeccsMliQnpcdqH4L1FBJKK\nLtKsfAUttZw+fGlYSJNATJoFOXzJwoDCV5o/0YEragvTz1xZJgSXcSd44VOrkk+0\nMqGgatSgIlTXU4TMl7VnCUg2j6cjiARstePKKfFSVE30nFNW5PnTmZuTzvYAMM5e\n2fvfPmoFvTaNE/vJQazUiRY1ugnR3uTEvIbAlJ6ZK7K6AYYS1A9/UmF+ai6BySGo\nc7BTuudOsLveeK/WAtOCEjb7x/Sp2s4LFJiRh+T40Bd1SiVT0ZWe9Kp1uVKw1ljB\nWGXUqPPGfa0ya/eAhhqLXOclO1QtpTSdRzHhWjxTqiIyc5RuPN+oNn0mur9LgcA/\nBf2kfNCDhKnqEBwF1EfAgQTZcKcz9zaPJz+8vd2NaPgY+BXvz7E0Sz9qymf8BrhD\nGJoHO8K9PgS0Ijbbe+230HSHTXaCTLK6PHdjCWILsSQDAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": [ - { - "keyids": [ - "39488e374e65b072b1196eef5ee0bebc5fac0574f5a5bcea1240c5c071571bae" - ], - "name": "inner_delegated_role", - "paths": [ - "dir2/inner_delegated_role.txt" - ], - "terminating": false, - "threshold": 1 - } - ] - }, - "expires": "2020-02-05T18:14:02Z", - "spec_version": "1.0", - "targets": { - "dir2/delegated_role2_1.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - }, - "dir2/delegated_role2_2.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - } - }, - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/inner_delegated_role.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/inner_delegated_role.json deleted file mode 100644 index 16aed3490..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/inner_delegated_role.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "signatures": [ - { - "keyid": "39488e374e65b072b1196eef5ee0bebc5fac0574f5a5bcea1240c5c071571bae", - "sig": "1cbbaeb1dbddbab718a22a2f80eafa73834778a3babadf5154f65833a01152642517c0a03b28eb452c3b1fcf51c9e65050bc7f284eb3fe6a25ff3b1b9ab116366cc70d5e5685c95297c09fcc292431aa2544b63a954c14a830e64798001eba3eeb0fe860f46bf7bf433769d69110954dd5e1e459b77a84010db1f6a493342c0ac5c3ad93fe8618bb9b1a752326627f2be4c4d8977f74c3c340bdd619db204fe633927253fdaf30a9b8ff78ac2744f41122f5a25c0dcd7f48f369fccaabe126249b951c9bbf660cedd22d46049e70cb782ff5c7447884a13ddeaa75f5486d9f00892c52ace05d0676f8ede8d3907132b05608b7422757e8943f6c84d23cc029bbb418c8e2d69900b86744a5eef98b38a2a0e8d6509264176f9a795a1cc1b67715b0ca4b7faeec20b2355747df7bfd6f0e85717f428424a32f716d26344ae368f9510fcb067c260fd1be361d5c9fe6bbd207066b1da31ae22429a2449ed7c6b6cf102a82ebbc42294b22522447a7f2963e0200668584600af507472208e9ce74e5" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2020-02-05T18:14:02Z", - "spec_version": "1.0", - "targets": { - "dir2/inner_delegated_role.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - } - }, - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/root.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/root.json deleted file mode 100644 index 0a15d72e8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714", - "sig": "8d666c1a67535add88f84e4504f9ba8cf088584cce9684f9b07b7958d1af09f72092cb1ebed5671c61615ccdbc5a77d214553bc3e0f131f6fd52a3ed9fcdda73db7482cf92b112e66407c24f7eae51c56b0e89de5a7f1e2aa97bcbe51174e6f7da5e7749df41ff9242936480d985bf0076200e32dcc3e65ecb50c4cb1ae016205c1e47baf1d273eeada7f84cbd1684cdbaaae76ead16b9b90531e94057a74f0fe014168db6b5f6707cd90eb8dc88f348e4eaa27a5a074a911e942d8bba83c47e3d253306c2751b2d2a526bb2983214f56b48216d4ae87d83c263d05fc3ae6564fdf817811cd511702f053bfdecea429876f8c0f5736cdd58a0fb894b60337f0041182b10cd8da8b10b837d076ac7845dba572d44cbac14e2ca44ba73d83c23ced03fafc1ade3bebcc3221dee256d727783e1adc58291b7cc3cae1973eb21f69472843b46b7418881d0b60b5d0926014d8b808d4b2403fd0443760bc295bcb26f3d24c3e745921d726006607ee76a8dec7898461b094873cf4948880cdcbe5d88" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2021-02-03T22:50:16Z", - "keys": { - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt8lxr3x5fdX888ETUN6L\nheNzR9B6taDcFrxzfhLKHMBr1ibsW6cC65XdFWTjXlyEwv0O6Q8KtRxsZ4VWZC++\njPBmqx64pIwavlKKVTxYKyDiviKaFQSpHFbzWJadyylrnK0TVdPuaOvBv6kfszim\ncIRIPdbqWBCt34UG79fAbDLH23lA5dFhQVEW0v1r8Wt937lj24YCAw9aBLwbkjSs\nyTYHYKJiIb64YK75OCU7BNrG56uwtlGjNDrlDJbWqnkjaSzDp8KhDNm/iq3O1QDq\njTY5WkMR75Kn+cPJ06kxHcJ9sbmorXFBQwiFe9iDe/AQG5xrjkm/vDWLL0iC1ZKP\nM4t1qPRKYiijm4emnZ4IHkx7EgcDBNNoOorsMDj7IQqMb2t2mJsW4/1wjdUGOmWF\nKzFWLYux8uwTQPHinNl12CtQeTkLs5KvDK5Wja/dbps8Riw2+qL5u4auuTP5MHKk\nQdRmlMFDS5B+ka/GyitXucx1WeXp1sZ79WCOn7aTkLMtAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAlVOTOqAJpxv/33JXMObi\nXD3luL+yuDf+rhIEG6II8JA6qbYW8aEx9yj+Ku4sDQD1BLJ44ebEX7qxzLJPv3LC\nYQN12La6nUS9kuK2tI1SISrBKjddaC+p/l+aMqPDT6lnt/qnbsZc2SCNdK0CPAnh\nWSOZyxf+e1ZRkKT20guqNV2W30ww764uNn5ST4SDdKqgQgUBPDaPZSlGLcAXxXCK\nQEP/b8jyiz3BFxZyJwCk2H7e41gG9nBceX/ARvCZFZMuGIR7zK6cd8A+6WDF7eM1\n5onj1lYPLL7Mi+bFAbDzCF75NQL+nSTjn4e9olLfiXap/XbnYck0huRAbaIpDZxC\nIZhX8VUlgeO9Y5/PeS16etCsP/Ch4YL5ijZQma0yUDh5Qmier9X3YHV5nTBYu/zN\n5U9tLzZ+GnKG8jDgKQJwFDLv60Hk27KlrCHkrWXZnI9TIXa7d4cpp5RUVfpU4Dal\nwrWGXzHg/EjYHx5qXJc93dUoGvSKS5Jz/Y8MNeVppIvZAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAufSY8KwZIja0Na750LCC\nHovf3Ktfh7jnmaNXsFvlTXfnyOaHfJTCU+6pXTdAHYoIcnZLEx8gEC1PobibvFqt\nicM4ZDh8OQMlgUofXmGOgwLaRaPYEZ3nZPAQKtE1ISDbyZ61FnjLAQOHXDlA/kUy\nJLH6KBeVS18kvFqCnelgiJADWGroWJP6vRer2WRxvhSKp2Uh9EUL2zSjzo2Kfome\nqp3Lx+AP5tRza2UTnrEPkIjqQUAqUcQN5bRJ77hGWCtjtAx1M3yXs6cou/Au1Xg2\njLeDSbgi+57cxVuYmHUQwk+XLOabXgdUDOav5rBHoU4owXDo2lWI6ktKV1SEsxl7\nNNI6rQ0ef3tbDjhCjjBLYbhEngXAUI/VMHycJB1tIvzVb7zrvuTSYcMmBAS6Tg62\nJgMzAIh7Qc8SUgR9JaDgGGksKSXtEruvR6kGDApHglIUbTgKyT9fh8sZ5m0czzKW\nLBSXwYmZHnt0bKNFdf2gvkqfP4iV4moRkZi5Qzf7BostAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwvyLoT3TNFzwOXbwO5eU\n8eGrIFyXGa97w0cp44l4rASZKJ7I9/AjoCuitKYiodIPtVP5dGtY+dZFNQvXjdQp\n7Te/bDyj4T64jmlOFJ5MT+Qx4g9tqaW6w6v886ZqlUTe422v2cinwXAFlodDMOxK\niZ088vFGON8Ju1jsRN2L3P4tW2mu1wOV6RDUTm+qP3VrxnWo4aleTWAVjU80v/vm\nId4HZvwYDATnkdhKgPsEFTbiPsXil00UKfO5FAExdls1978REdLLfEgLJnYtIOpH\nqmigmGiIchZlGAl8JYrCRrYgMWxiEWnXfQWqRGDJ/AJV6Nbuf9wrStd3i3yPcJHV\nb1oHLBDCCJ6k7Qa3LJIYXk/a/N6NB9g3/Bfg8nJVuCF+LQ8M7mhC9xCXCOjPIyGd\nUNyx4BqxKtSOSSJrR9OLIFDKdxw8kKWC+5DPQXlTA1bAjdMeR6ZXWYLxMOSn2jep\nySAx3eU3UdhOzG7Esw7vMbVa1oyBNloyas7uwXV9tMu1AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "7ce993504e0103bc278880c32f18751ce91d342de2dca91c9b6719688b3b6714" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/snapshot.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/snapshot.json deleted file mode 100644 index 8f09fc729..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/snapshot.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "signatures": [ - { - "keyid": "4eaf748f7a339339770bd372d6127aee5ee43a3f962a8fe28d8678055c1ede7b", - "sig": "b3422f269cc7adbc4957edde82afdc41d2a6ffb110aebf8ecfdb1c1db9e87ad5d70c0caa5c8890ed0f6b6ecb314fe182c0d5a224fed0f9091add1da072d09c11dd071deae1c1ab11227899bcdfc669419541c8fcb841342307638fa7f194a98ea8353bd609ae11203bda8c6aab56bdae491f12fa8f5cb03650bd70cd09a5ca47c0e29e4f764ccf2ffee8f0ca423dbc9b74c2b3fe9d6b3f75b72035c1a4d9ddb44173da89a7f9cab6053aafd4a4f38dd5a655dc6b7d9c706df51a5c153d24d7b6e9c5b0b851044cfffbe9133d1acc8296b69afa70d1370903f1acb6900566595478788f8514450cb6d110e983d1caa0832fd683477c448b66c04c877ca0abee489142a6d094be75ae75febea53282a2913c5313ec8269090d27863b385713d848ccef1c018069d4c25740657a9156340e2a5c2f119f11f308a30e592b89644660d2ec1974f63681185a738ec6a65186ef906295abc4d5d07c75efeb4f54ef4d35446cbc7010221ae736cf4812b8607bbfcc3046e1ff9fb3f0b3dbc95b5f7c4be1" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2020-02-11T18:14:02Z", - "meta": { - "delegated_role1.json": { - "version": 2 - }, - "delegated_role2.json": { - "version": 2 - }, - "inner_delegated_role.json": { - "version": 2 - }, - "root.json": { - "version": 1 - }, - "targets.json": { - "version": 1 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/targets.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/targets.json deleted file mode 100644 index dbea2db45..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/targets.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "signatures": [ - { - "keyid": "6b06cd0c2cf93a77ca76ef7d429787e0ee4c15f7b439bc21ba1afac444c3cf23", - "sig": "911c0860b997d505b2263fe2b90ab80665e52a4ea3f5f6a5d883cf3f01f7efa32e798d163c1f79e5ee7dfbe1b8f4c65701a0e39cc29db49719c682f9da3a863b1cf9bde368d111bbaba90a7b63335c9f32d8be3ac2fb63765899d60c6bb097424f57d3d84a7f85edea41e1f9da318ea620cfac4d55d4972bafae16d386e558723e0fbc12a48d54130ab683a7d1ab908ce8c5999a63e104e1fe4a7fa9855ef4e2eef43d9ce060e57af8ce31119fd37ec0eba88f0ea23e87869d9cd511b7601c8475d463a90df731859f38f6dcdbf9ee4ce72127f81a75fbcfc55d2d8393cf17c3f0ff6eba9f910295eda000d6d3aea72fb8a630859ed479c245ad05b025e5fa18fd5f70f9f6bf5f9abbd7a45341d1a4f2aae711857666047617007519e817aecccc15c3394539c7244e014ec0df8c0d570438fd5f82572b2b9034bf92faf4233887ba11ecde76fd5e72705c6bbd8e9ffc9a3707c3e485adde78cc84bb808edfd2a8b06762d5a5174bd632863c364ed1560285ddf1e4fd04af2b75bd7ea0ecac9b" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": { - "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA1VArRM8KSmO04ov5RArA\n+lXBK+a5Pn9NuQSUMxyuCGqIRT51VrammOpubgDs+PmXdwKxC6aGqMHtsaU8UJHb\nPxXq8b1Idm8Cac0ypjnwjdPhnpG0GVRSrK9bej2MFCICHz3YkX47wqhMnCyt03hk\ncR718wLdLw3LKIcmNTzx+w2RHzVzsVgfZMpczfc0jOheDz4vUPSc4s3pY8CPmLvu\n9qNpmlWSka4GOY9qdCp6P4FGABUj7RM68UBhuv3w4fBgwhfonUvjEIy0QqzyGt29\ncWpm9eBU7XEuHda2o3DsVB0tLqInk2Yyn6oqnE5jEEgLONQx+XOcQ3MqSUQbtEtj\nocR4aVptstmt0tbAQoa6L4QkGCltpZ5y0zuMpxQ9g46FP4uHQ0qPqGm8ZJKaXY0M\nV+ahDJEuYYGciOlQoyzH3/Iw8PIpAJK0jwTS0U7FQLVlZ+WamZiHgUKglwmZRFe0\nug9B5LvoKRNyxvwrOflu3Ly0wcd/w5LAYK6Nc+bCTLmhAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA4+WTKegsztvnGpOfXKuT\nqx/ZhfZodAyI0ye69G4VHwfVP805O9T6xoKxGDA8PTpxBSe01HgZw5HgW7CJMY1Z\nFwQ0/do2pI1Ef++JyhMNucCaTiyQcAMT50/0WBWMWCemt05kb/Kbdp+ViOc/Ayp1\n5J9ok4+MyCXpBlNdOdsUw3SK6ps1kqMQkiH0jigfZGIYg9zeJ8qDT/EGu0hHSzDw\nxGTBTGPjMvUWXL98ZE1cBJA+ePP6YNQc9qIIxWeMYUO6Kx6O8QoifEdZK/AHGwcY\n4MNVtXsQ61xINtYDl1jTtz1COIBKGNvDWllF5llOZK3vQvbBPgvUpf1Ia4eWl92B\ncWN5d0gAd/rirugT5As6tsB3b4OvI8SxAU0OBqEwqi8uEL9tdB8CCBwHGdMHntJ/\n8dqIpBjNIdI58iGdKTznP2k4yokxE7sIGrM3g3UfZ5Ux8LuUEF7MXsvkTeP057G2\nWqbdaalAw4z3SGJdBDbUO7MIzWdbJVjoeak/jCNQ3pifAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwK53ZZC2/GWry1pdOtFz\n6u7lRu5XwzcBcYHx9q2gsso5MiXrBHV2M5NCjPTJSLnZ9XLhC4bbnIqkeT3VCjVf\nqQn18aj7egTjSZgM+FIYSRzmkwixUt9hFZS0OovLl3MIqqYk/jyyLd/gFC9GODBy\nkVty76wzc+taQfnDpdhE+ZvOy/SCgHwkkhCfiTw0/LXdHiefm5x9ee4KfVrhbTn0\n6ZFzkbzqbXGWgIdSZF4/ZQAG0y/aEsU1e6uKaWdAsH8+qQV8pH80zqc+OHC+1PTk\nV+0POcdvmO1LD85uPi8EtPi66SaGfnNYk5fq/Joq7fo2cRFCuYX6AjMqzqaQ9eaw\nAj4t9DxpbD57oAlJlTnU0/bfmxDNSqnzHDoXU8pkC39QxvbzNlA+IcT0QUWPi7jL\nuBrupBJjg8lobootu7CTJb96R0bBQFE1AHDIzXWkaQzr5JWXoTsizHV3WlYRwe6U\nzvcDLCKJJDQedFs2PxJZ/p3LDULm276ePbGK/EQDAI73AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEArpF5XZXda0P5M5IbOV/t\nhyZpAtGNMPAsCKXbKBJrNbriV4mBs6v6/9oYPdyz2Y1U2fIhLIQWfFCTQddpVL7r\ndU+5fYvrbuteUwd4lZ46SGqL1Xt6nzYG8igdpXWxVJJyTnp2sTT7Btz8CbdTQ5hm\nGYCWsAhPlncHpxnJj1HuZeFPZxs9f6B5TiBCrhicWH2ay9/Lz+mwQk1fDC2VwGD6\nVVMpFtMm8sO8AxV8audi9GjRaOCOTdtlk2mvGtxj/vqB9AMErkgG5Bxer3s2Ry9f\noF0gHOUmmNW4pmk8Iqf0OZpWmGz2Nh1Qgw8IMqQWxsDq0T/1VUxFU0DoLf4qnnI2\nD6RfGuNCB13QanYhXh4apdamIa8fqRnMmdyvvKm7Y9CAZRASW8ltzfVIT/DMmm3s\nbnN4uFoXWvBVihXqBk5Jx2uKDUo3duY/Z9kHp/e+IdGNElLNMQNHJustGHVIq3ES\n7cFlDJze0Z0jXV+TMIMtrFIPmzp3NJaLl7tF2nrk41/bAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": [ - { - "keyids": [ - "f146d35c82fb908bb7ffac935d6566905d7a55225d9587229ca0e984495a57b3", - "504cfdfeb80398a228996fc13b4e0e4b407d0687317cdc55446d2d7e6581a6f1", - "8f2b17b53bca1a124c20d552d2289a49db5f977ece2a77dd1c04cb7933f4f3db" - ], - "name": "delegated_role1", - "paths": [ - "dir1/*" - ], - "terminating": false, - "threshold": 2 - }, - { - "keyids": [ - "034e60bab6cd9e0e5a9f8bf8061b0dcb19f9c87cf0dd7583b72e3bef9e8f1816" - ], - "name": "delegated_role2", - "paths": [ - "dir2/*" - ], - "terminating": false, - "threshold": 1 - } - ] - }, - "expires": "2020-05-06T00:29:06Z", - "spec_version": "1.0", - "targets": {}, - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/timestamp.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/timestamp.json deleted file mode 100644 index a73cd19de..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/metadata/timestamp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "signatures": [ - { - "keyid": "bc3c5112b846efd7952c6ad3fccfbd210dad12b92e1d38f08d82598c5b21f327", - "sig": "b19f68de4a0a02d2afb8b602bdf157e01ee73fb98fb86c1a8157c19636d9a284b3f07773555ed7086e4b88e86a6506d5a511a272bc13245f74955f611ce054e9eada0b8a032f1c1583f157c63bc2d5dee415f7badd6de6dc02accda3e3175720d82b9478e8f9035ad200ad2980821c2e0385fb06d6c6bf3b29927df53e85acc55be16f266277409bdafec3a7260cfdacc6cb80feedac0ce74501ca8a0a760c946ad637100b2fa144a207f981cc85233128fa737e333e41ac079ee0e59d42311d9f5e930d43d9bd0841da21415521030e18a9c26a0fe290e583ef22720ebaad38d9b900dbe8d435a0b2caeccbcd62058da46d21bf496d8dde112655de571bb0ed7687c818c1dd1406515e7756fc4cd2b24dab61473bbe9388ef29420edf0716d154e0ecb194fd2c4470134cebe1e751fbc2bb31e158f101affbe8529fba69d85318ce5f7e87b2a5e626b8d4dd78c75b0dd0bd16775e0c4be8b292086ef15b83228e47f240da818eaba9b2605607ac25d296afef0b8ad542e3e7435b17e137678c" - } - ], - "signed": { - "_type": "timestamp", - "expires": "2020-02-05T18:14:02Z", - "meta": { - "snapshot.json": { - "hashes": { - "sha256": "df46203f345069ee66b5258842d59ff6c4eaeaa6bad0a1d97dc38855d98e1d75" - }, - "length": 1271, - "version": 2 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/COMMIT_EDITMSG deleted file mode 100644 index 869e51e9e..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Added targets diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/HEAD b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/ORIG_HEAD b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/ORIG_HEAD deleted file mode 100644 index 4b2092272..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -0c12282401d6a7560a631097d6731be34cfafea3 diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/config b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/config deleted file mode 100644 index 818624df6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/config +++ /dev/null @@ -1,9 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - ignorecase = true -[gui] - wmstate = zoomed - geometry = 1322x693+228+228 254 315 diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/description b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/post-update.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/update.sample b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/index b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/index deleted file mode 100644 index 8f4b042a7..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/info/exclude b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/logs/HEAD b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/logs/HEAD deleted file mode 100644 index 3c7c2cfc3..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/logs/HEAD +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 0c12282401d6a7560a631097d6731be34cfafea3 Renata 1580908516 +0100 commit (initial): Initial metadata files -0c12282401d6a7560a631097d6731be34cfafea3 0c12282401d6a7560a631097d6731be34cfafea3 Renata 1580908638 +0100 reset: moving to HEAD -0c12282401d6a7560a631097d6731be34cfafea3 36aaa887aaff7e3783f3c9c4d0fbc6744bca9184 Renata 1580908830 +0100 commit: Added targets diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/logs/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/logs/refs/heads/master deleted file mode 100644 index 0d7679798..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/logs/refs/heads/master +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 0c12282401d6a7560a631097d6731be34cfafea3 Renata 1580908516 +0100 commit (initial): Initial metadata files -0c12282401d6a7560a631097d6731be34cfafea3 36aaa887aaff7e3783f3c9c4d0fbc6744bca9184 Renata 1580908830 +0100 commit: Added targets diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/0c/12282401d6a7560a631097d6731be34cfafea3 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/0c/12282401d6a7560a631097d6731be34cfafea3 deleted file mode 100644 index 1e27d27c7..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/0c/12282401d6a7560a631097d6731be34cfafea3 +++ /dev/null @@ -1,2 +0,0 @@ -x•Á -!@;ûsÂ]béÚµ?˜Õ±Ý›úþ¶þ ÛãÁ㥭÷*€Þd0CŽ¨CZ]*‰m°Ù”ˆ 1S4ì½ ýäIÑKÛ€¯$ç÷øA¸Ü;ÕvJ[Ÿ]ÐQ‡5j­v»Ï„ÿÌÔu­R©Ag¡üÝ•Úø©>3t9‘ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/10/7f589d326af2f5744a7f7017744008fc7ada53 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/10/7f589d326af2f5744a7f7017744008fc7ada53 deleted file mode 100644 index 5e28406a1..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/10/7f589d326af2f5744a7f7017744008fc7ada53 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/1a/7147583bd29de0395e3f73a09e822daebd9f4e b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/1a/7147583bd29de0395e3f73a09e822daebd9f4e deleted file mode 100644 index 5debea970..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/1a/7147583bd29de0395e3f73a09e822daebd9f4e and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/31/5bbafbb9b2ba7721205b3dd8b85fdaac5023f4 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/31/5bbafbb9b2ba7721205b3dd8b85fdaac5023f4 deleted file mode 100644 index 23840e08e..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/31/5bbafbb9b2ba7721205b3dd8b85fdaac5023f4 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/36/aaa887aaff7e3783f3c9c4d0fbc6744bca9184 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/36/aaa887aaff7e3783f3c9c4d0fbc6744bca9184 deleted file mode 100644 index 8d1e17d4d..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/36/aaa887aaff7e3783f3c9c4d0fbc6744bca9184 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/41/36986239d2d0575f768412534d016b9445c3b9 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/41/36986239d2d0575f768412534d016b9445c3b9 deleted file mode 100644 index b59623d4f..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/41/36986239d2d0575f768412534d016b9445c3b9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/42/c869b3628dea0b830478c76d274b63c539382b b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/42/c869b3628dea0b830478c76d274b63c539382b deleted file mode 100644 index b7e058bd9..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/42/c869b3628dea0b830478c76d274b63c539382b +++ /dev/null @@ -1,2 +0,0 @@ -xESÍnœ7 ìÙO±øÎM REù9zjQ$EÆnãd·EƒÂï^î:En‚D 9Ãûòb'€Å?ý{w:ΟŸõò××8÷§ßîN§º<Ž?ãÛã®›ƒ×âAfa ʘƒdÏd΀ښÎÞ¦‘³¯¥„-rÎÝ{ ?~¾áU›+ÚŠf°6p‹5Ø=öˆéÝH«ÃDÂ@nÔ=gUê䈭 ˜1ÒØÜçÍÉbÅƶÙv=éè0FDªæ+SªÊVÆ@ÉÁªšõÁÇra›*}ìjb¼@&œŒ«hh¹«â¨“uc潂kDîaÒ¬-íÉÊ=5sCñ±z"TèTmrÂnÒ6 -Aô1ow/ò5E\Çì¡h05úÜé¶cK.¹j³Š¬O¯a6é•<á0 ²Sã,áK¯ŽZEm¤štÍ»†&ì6D@AIš8ˆ..ad0ØÆá)k£‰¸jÞ &Jß„¸²ç.å€]ئNA’=¦eò*l.¡r«,Y c—°8PL-!‰çÖÚÕ¤Ö`µšIjº–TPýj)PvBXG+‰pš¶’è[×dèeD°¦ sQÁx¸×g“ålQš¤õZ¡#öòe–se—¾2¡ Úk͵w£6)&éð:±Ï콦lÍ(ÔôHDõ߇‚ éF&Ú ‹p9ÆZYì°|‹¨ð&7Á¥£ô)óâ.#ìbµz–C$­£Âðvwú½BqK^\3vMÜñéòí5®¹<>Åù¢O¯·äñÏëã{8lØ>4üÐøè÷@÷~}/zŠ‹~*Üg}=?¼\>þq~yþÿöt<èùáò[À«ãù¡üÍ×–^ ,?¯ëØXtoúe/Q¢X$¦únc§tžm-±ëë(Ó&ò•Uñº%ýt|‰çÏ—‡Âœðýîïøz~¼M×Ú’à½ü8¿†úñzÀÇöNéÇ]ýx»{û^GG \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/43/c588fd957ef0e05f1987fff5e569475960210a b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/43/c588fd957ef0e05f1987fff5e569475960210a deleted file mode 100644 index d714feb31..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/43/c588fd957ef0e05f1987fff5e569475960210a and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/47/dfa36d6f9ee2f771ca90cb81492ffa312f95e4 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/47/dfa36d6f9ee2f771ca90cb81492ffa312f95e4 deleted file mode 100644 index ec09562bd..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/47/dfa36d6f9ee2f771ca90cb81492ffa312f95e4 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/61/e6ce9bef861c090ef7e7479736524ed35c3900 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/61/e6ce9bef861c090ef7e7479736524ed35c3900 deleted file mode 100644 index 023ce4c36..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/61/e6ce9bef861c090ef7e7479736524ed35c3900 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/6d/a80a6207ce9e8c0ea5a24d0705b3d2d6a96812 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/6d/a80a6207ce9e8c0ea5a24d0705b3d2d6a96812 deleted file mode 100644 index 0ef2a5089..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/6d/a80a6207ce9e8c0ea5a24d0705b3d2d6a96812 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/6e/6a78a47e12514fcd972b12df5af72bd8254f0b b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/6e/6a78a47e12514fcd972b12df5af72bd8254f0b deleted file mode 100644 index 4e71e3300..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/6e/6a78a47e12514fcd972b12df5af72bd8254f0b and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/79/e3471abb416b560726e0de8b8201152df0ec54 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/79/e3471abb416b560726e0de8b8201152df0ec54 deleted file mode 100644 index 4c5c30a3a..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/79/e3471abb416b560726e0de8b8201152df0ec54 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/8f/792e7b2ff760cc8c625f51c05dd60a4feb53d6 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/8f/792e7b2ff760cc8c625f51c05dd60a4feb53d6 deleted file mode 100644 index 7da56838e..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/8f/792e7b2ff760cc8c625f51c05dd60a4feb53d6 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/90/95829df339c73505fa4891c02d0399c0bd6446 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/90/95829df339c73505fa4891c02d0399c0bd6446 deleted file mode 100644 index 041c6d394..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/90/95829df339c73505fa4891c02d0399c0bd6446 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/b5/3d50687855670e19adc7eeee0accc8c6e43586 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/b5/3d50687855670e19adc7eeee0accc8c6e43586 deleted file mode 100644 index a198deee4..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/b5/3d50687855670e19adc7eeee0accc8c6e43586 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/cb/df641b5943b47184a563e6088247e02f921209 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/cb/df641b5943b47184a563e6088247e02f921209 deleted file mode 100644 index 1eda35dd2..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/cb/df641b5943b47184a563e6088247e02f921209 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/d6/bbfc3f945de315ccb81e27afda394e973e46ad b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/d6/bbfc3f945de315ccb81e27afda394e973e46ad deleted file mode 100644 index 612373d00..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/d6/bbfc3f945de315ccb81e27afda394e973e46ad and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/d9/108cb115cfce484d2f91baeea92e772841767a b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/d9/108cb115cfce484d2f91baeea92e772841767a deleted file mode 100644 index 18851b5a6..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/d9/108cb115cfce484d2f91baeea92e772841767a and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/db/144edc6d164e06bdf7ec27e6003141cab05f09 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/db/144edc6d164e06bdf7ec27e6003141cab05f09 deleted file mode 100644 index 8a42378ae..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/db/144edc6d164e06bdf7ec27e6003141cab05f09 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 deleted file mode 100644 index 711223894..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/ee/0d090c4edbdf3129f122daaa696e2ec50d1052 b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/ee/0d090c4edbdf3129f122daaa696e2ec50d1052 deleted file mode 100644 index b5ca2e976..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/objects/ee/0d090c4edbdf3129f122daaa696e2ec50d1052 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/refs/heads/master deleted file mode 100644 index 88ac316af..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -36aaa887aaff7e3783f3c9c4d0fbc6744bca9184 diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/1.root.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/1.root.json deleted file mode 100644 index d6bbfc3f9..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/1.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "9c92a391cab4bae8230a574dff97cf88a9833638da65afefbd47779031f6b6b8", - "sig": "29897dd4ac70676c9ceb67f7506860b85b75ed21c37684853243eb23162e7e6c25f16a0cec6817d9785dafce39b03deb097ca84a3607377bbf460feb5c097866e23d1ff54870b8e24aa9226d64bfbcdd4db65de7577d08c97f30345f036a5739c27da95749f3f997406a2c0bb916a029893de05caf8bdd583279ca27435a2d15745f67619b77452cae7ddcd6a2f6ee4e5f919efaddca4e807623dc4baae3d1348c9ed8af5ba5b0e893bd996503ae41d6a8a0a6f5cb2483f7565f1045d7e2cd07d52dc972b5741842fcde780fe5ae909b818ac01baed1e3ae1b009d15f08a5a9ce271722ff935c421c0ad18f07c54543543bbc35c501f113a93771f04ef68013c98fbae553e736d0e309bb46e2968fb73c311af862fbfc378ac3909a63b765e2884b61272ff7ecd332bfd5a2c86f5e28705766de7db50d1c92cfb40c712fba835f3f15165a03a2a78fb4a0ae7b49387693e34944868afcd722cabb5c7c666a633ed06863e540a56880bce524ad835d94cc017de56c150595a95a3b9ce93a3df49" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2021-02-04T19:02:51Z", - "keys": { - "699654bbeb61fea62f41548d7f66f3112a00a7dec07b4c6c99a420ef77d33e5c": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwvyLoT3TNFzwOXbwO5eU\n8eGrIFyXGa97w0cp44l4rASZKJ7I9/AjoCuitKYiodIPtVP5dGtY+dZFNQvXjdQp\n7Te/bDyj4T64jmlOFJ5MT+Qx4g9tqaW6w6v886ZqlUTe422v2cinwXAFlodDMOxK\niZ088vFGON8Ju1jsRN2L3P4tW2mu1wOV6RDUTm+qP3VrxnWo4aleTWAVjU80v/vm\nId4HZvwYDATnkdhKgPsEFTbiPsXil00UKfO5FAExdls1978REdLLfEgLJnYtIOpH\nqmigmGiIchZlGAl8JYrCRrYgMWxiEWnXfQWqRGDJ/AJV6Nbuf9wrStd3i3yPcJHV\nb1oHLBDCCJ6k7Qa3LJIYXk/a/N6NB9g3/Bfg8nJVuCF+LQ8M7mhC9xCXCOjPIyGd\nUNyx4BqxKtSOSSJrR9OLIFDKdxw8kKWC+5DPQXlTA1bAjdMeR6ZXWYLxMOSn2jep\nySAx3eU3UdhOzG7Esw7vMbVa1oyBNloyas7uwXV9tMu1AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "7c70a1b8116ea8cb635ec1ef479492df6f9f0485b63d0927e1bab4b33e29cd54": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAlVOTOqAJpxv/33JXMObi\nXD3luL+yuDf+rhIEG6II8JA6qbYW8aEx9yj+Ku4sDQD1BLJ44ebEX7qxzLJPv3LC\nYQN12La6nUS9kuK2tI1SISrBKjddaC+p/l+aMqPDT6lnt/qnbsZc2SCNdK0CPAnh\nWSOZyxf+e1ZRkKT20guqNV2W30ww764uNn5ST4SDdKqgQgUBPDaPZSlGLcAXxXCK\nQEP/b8jyiz3BFxZyJwCk2H7e41gG9nBceX/ARvCZFZMuGIR7zK6cd8A+6WDF7eM1\n5onj1lYPLL7Mi+bFAbDzCF75NQL+nSTjn4e9olLfiXap/XbnYck0huRAbaIpDZxC\nIZhX8VUlgeO9Y5/PeS16etCsP/Ch4YL5ijZQma0yUDh5Qmier9X3YHV5nTBYu/zN\n5U9tLzZ+GnKG8jDgKQJwFDLv60Hk27KlrCHkrWXZnI9TIXa7d4cpp5RUVfpU4Dal\nwrWGXzHg/EjYHx5qXJc93dUoGvSKS5Jz/Y8MNeVppIvZAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "9c92a391cab4bae8230a574dff97cf88a9833638da65afefbd47779031f6b6b8": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAufSY8KwZIja0Na750LCC\nHovf3Ktfh7jnmaNXsFvlTXfnyOaHfJTCU+6pXTdAHYoIcnZLEx8gEC1PobibvFqt\nicM4ZDh8OQMlgUofXmGOgwLaRaPYEZ3nZPAQKtE1ISDbyZ61FnjLAQOHXDlA/kUy\nJLH6KBeVS18kvFqCnelgiJADWGroWJP6vRer2WRxvhSKp2Uh9EUL2zSjzo2Kfome\nqp3Lx+AP5tRza2UTnrEPkIjqQUAqUcQN5bRJ77hGWCtjtAx1M3yXs6cou/Au1Xg2\njLeDSbgi+57cxVuYmHUQwk+XLOabXgdUDOav5rBHoU4owXDo2lWI6ktKV1SEsxl7\nNNI6rQ0ef3tbDjhCjjBLYbhEngXAUI/VMHycJB1tIvzVb7zrvuTSYcMmBAS6Tg62\nJgMzAIh7Qc8SUgR9JaDgGGksKSXtEruvR6kGDApHglIUbTgKyT9fh8sZ5m0czzKW\nLBSXwYmZHnt0bKNFdf2gvkqfP4iV4moRkZi5Qzf7BostAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "b160335321b9d13b224ffb43d96d68e8565c516f8adca98ff5e50ea060c88345": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt8lxr3x5fdX888ETUN6L\nheNzR9B6taDcFrxzfhLKHMBr1ibsW6cC65XdFWTjXlyEwv0O6Q8KtRxsZ4VWZC++\njPBmqx64pIwavlKKVTxYKyDiviKaFQSpHFbzWJadyylrnK0TVdPuaOvBv6kfszim\ncIRIPdbqWBCt34UG79fAbDLH23lA5dFhQVEW0v1r8Wt937lj24YCAw9aBLwbkjSs\nyTYHYKJiIb64YK75OCU7BNrG56uwtlGjNDrlDJbWqnkjaSzDp8KhDNm/iq3O1QDq\njTY5WkMR75Kn+cPJ06kxHcJ9sbmorXFBQwiFe9iDe/AQG5xrjkm/vDWLL0iC1ZKP\nM4t1qPRKYiijm4emnZ4IHkx7EgcDBNNoOorsMDj7IQqMb2t2mJsW4/1wjdUGOmWF\nKzFWLYux8uwTQPHinNl12CtQeTkLs5KvDK5Wja/dbps8Riw2+qL5u4auuTP5MHKk\nQdRmlMFDS5B+ka/GyitXucx1WeXp1sZ79WCOn7aTkLMtAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "9c92a391cab4bae8230a574dff97cf88a9833638da65afefbd47779031f6b6b8" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "b160335321b9d13b224ffb43d96d68e8565c516f8adca98ff5e50ea060c88345" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "7c70a1b8116ea8cb635ec1ef479492df6f9f0485b63d0927e1bab4b33e29cd54" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "699654bbeb61fea62f41548d7f66f3112a00a7dec07b4c6c99a420ef77d33e5c" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/delegated_role1.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/delegated_role1.json deleted file mode 100644 index 315bbafbb..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/delegated_role1.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "signatures": [ - { - "keyid": "501fc6692914ea3c7d4ac4de596907c82aeddc0766bf5c2e1c5542b1c6879e5b", - "sig": "9aa42df6a9c88d14e50a223a2dd170aaea747378f54ea4de1a8d29e34b2b65ce7b1e3fa6680c66b5b0c17ea900a6cc52fa86ec3b36137ef842848b88810d791f246f75bf04df989e1cd5608cab7320dd09ed3ae61f04555b314c51d2ad5e9d37441b3864bd4b3623cd590e2e160ae988f355901608d5a8f745d8cd887a54cd89f6c44dc6e5b12173e524b6004b101d4ec18b5127bcffa048d9b1458c083a8da4a951ac0c689f9a45d18456378f5d41f9e3cf88d8619a525c11fe4a17e53fff8d47df7f5d9b6222d7061a9e5c7758c5d02bd37c204dfe773d2861176cb8a253f894b06e06c8f586394770fc6dfb690c0c05fa6b66b3d109700735f1724da0ae06e6d89de8a1bb0d4906bbbc2088ba72011a274a1206a40af860482ab8e842eb918a2ca7aff45fd2203878f54e605b8abcae6cf3342a8e0f3cbb2a949610fa3dd677ca60e9a969702c44edfcc4e17cefe9ddd96264f098afa0366bf73731b123cfa81f7a101f7ac5cd3a27dbce05e3accf1f9543fd5e9073d87edf5f5495c6333f" - }, - { - "keyid": "ae9c8b250bc4c8acaae52b8f0e3bc9d134bf7fc358c61a1efe6ecef16e01e5ca", - "sig": "05b7f6f3bf01e71544eae2988e5f8316243be83f6e86ddfff0d117813255c633c984686bd44cc7f9cf382a6ffdcba894ec2e2e6410880a6c8ef517f02e837ba3bd54563de29ec965c8b03dd5a62dd2278cb1582cbe7462f548cd1ea60123dcdd36f5f20b455152716d94334c426b10d24e3607b28c4a57f9a3bfb41c309e4c646e56ab5ea94cc841ba2118b1e8da749778b9812df9acfc7d2b3a7c62a6f0cd763dc730e92d8e5d6911e0bd987c73c734d2919ed773b8627563c22382320282e07e3378311b58b7755ec2da0c1fe3ae75ab07ccfb69914065819c0f293ab7c918532477d1e28482ddbf8ba2c1a1af9c836b5d3ebbf2c212bc96012359f075049b03b375f128c8f12b673c16198792bd93f6420501adc834227e14f990bc43df3fa97f0fb754d6423ab60832bc42e5bdde678d91e210638e60d9f66b4c6b4521bd3a780e69f8d82dab86e19d008e62b8d47382f404b26463f2dc656ae3ff3a67cb3aa43883674d83ec05bc588d3f64443f006381122d71d6a2bcaa65f96c5fb48d" - }, - { - "keyid": "5ada0b066ab18997d0573692a591d5c025e16e09c4298eedba27c21fb35ef10e", - "sig": "59068136ea326773c764d3ef85ade4a7cd18bb9837c784eb33eb13b18a989cda9d939e98eec7341a76d6a56d29d9a08081b3f54df5f1d593c8add7be68d5ec3ef3b8cbbd4402c4e0ef927bf72b8b9a8ba269903f99e7b1be8b035eb774adcaa40bfb8babc386292531a4a8f3f8723f55af4d018d68834f08224b2a9ffe2d416cc5f75dc0ca364a8e69eb09e76f0065caca0e0460b1da61808d8ce4ec9fa2e3b094c6edbc0cd8826c0936ac47fedfd3fc006612e9db5c129e85d2bff2fa6de2fd307ee5cf11f7e2a73fd886dc263f4bf0b56e53b06b8ee0bab29e0ce0742cf3d28b45dd59f70bf4e3e6932e1df7098c1c663bca95e2a55b24421fab7e119e2133cad2fbe22b75743c1d01493ebb2f932e6c7cc3956ca919578359e2e578e1db3c0a67606789d175d2759eeaec1fab948f052df8ab67ded70f4daa4466e7f6320649684477c322f7c5d33f78211a6882e2338387b782f07d0dad6e0a05f016b4e1b27618623ad9a638767d16141e17f57858f608b89bc748d6b2b214cc830d0a64" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2020-02-06T14:19:06Z", - "spec_version": "1.0", - "targets": { - "dir1/delegated_role1_1.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - }, - "dir1/delegated_role1_2.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - } - }, - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/delegated_role2.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/delegated_role2.json deleted file mode 100644 index cbdf641b5..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/delegated_role2.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "signatures": [ - { - "keyid": "f38aa831c6bbb2a676917724a2407034ef27ad4d953232c2d2ec6d6abe4672d3", - "sig": "aa10bb65c1bcf15b87446740870ad5ff0232d64950bf083038df0c9af11cda62b09ed1121fca1efc1a5eab92be12f44d2d8504cfd28d4f71493dd182e6617ac5b411059ad4909d800fe5ec098ad0f4a90cd86293b9001f0602dcdfa3f25899709910a70828eec0b6fca3e6248b41475a57ef6c4e68d1991019258ad94df3ac7ffe797efde01249161b9f3889a5a5260f063c5f7022b7084b0b7ddafd95e12573619c03773257d3181be66d7ea44583b085a1c23ae0c1997580034308e77b650c83e4e3eb8fa3938d01b974d197d909f72b9385c92b5426aef0e15dd43c3f0ab0a4df79bb1bd9692f4bbb0c980d26c8002c10ffe699ac8c713befee4360f7fb27fb7ba7a2f087d3e33e0ae887797413c42c9196e8a3e7e6e0507b74dac5ff4f123dcef4496e39d5910ff5fd7d3346bb1059de50042739fd93b9f5a12e12f86ebe6111903af4ac30602826882a195cf20bc0c0233448a4d4e80883da94e10247c29844d2017934f794bbb12abaca59b642c3e637a3a1f8a56f432e69309cf73826" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": { - "7898a7e4654f79f9ffcc49c7dcd3350944f138c1bdc3c0bcb2572bddb4963dc1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAuOoH2wIn1ThP8zYJ0JEA\nqS0vjNo8mjidSDgRpWTcXLWoipI7tqvVADnbi0rnMdeccsMliQnpcdqH4L1FBJKK\nLtKsfAUttZw+fGlYSJNATJoFOXzJwoDCV5o/0YEragvTz1xZJgSXcSd44VOrkk+0\nMqGgatSgIlTXU4TMl7VnCUg2j6cjiARstePKKfFSVE30nFNW5PnTmZuTzvYAMM5e\n2fvfPmoFvTaNE/vJQazUiRY1ugnR3uTEvIbAlJ6ZK7K6AYYS1A9/UmF+ai6BySGo\nc7BTuudOsLveeK/WAtOCEjb7x/Sp2s4LFJiRh+T40Bd1SiVT0ZWe9Kp1uVKw1ljB\nWGXUqPPGfa0ya/eAhhqLXOclO1QtpTSdRzHhWjxTqiIyc5RuPN+oNn0mur9LgcA/\nBf2kfNCDhKnqEBwF1EfAgQTZcKcz9zaPJz+8vd2NaPgY+BXvz7E0Sz9qymf8BrhD\nGJoHO8K9PgS0Ijbbe+230HSHTXaCTLK6PHdjCWILsSQDAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - } - }, - "roles": [ - { - "keyids": [ - "7898a7e4654f79f9ffcc49c7dcd3350944f138c1bdc3c0bcb2572bddb4963dc1" - ], - "name": "inner_delegated_role", - "paths": [ - "dir2/inner_delegated_role.txt" - ], - "terminating": false, - "threshold": 1 - } - ] - }, - "expires": "2020-02-06T14:19:06Z", - "spec_version": "1.0", - "targets": { - "dir2/delegated_role2_1.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - }, - "dir2/delegated_role2_2.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - } - }, - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/inner_delegated_role.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/inner_delegated_role.json deleted file mode 100644 index 47dfa36d6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/inner_delegated_role.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "signatures": [ - { - "keyid": "7898a7e4654f79f9ffcc49c7dcd3350944f138c1bdc3c0bcb2572bddb4963dc1", - "sig": "697bd74f1db544a29cb7334fa25e877a56225265246246b30c914e469f21176cee7ae9624683c0077ec5f2a0bf38a6f7c1d395881b018646b697f1214a5d82e0f1943faa6a951e386d4d56ad85d510c550d715c8ee2de8f11a02e5c4ad0d0e142c33a90d5053402af9018ad186c032b5350b81b6d9230c07e8c6ee4329631275384ff575bd096064c9d1fe077ace2986629688518532cdcd4150d444ef94189bfb15a3b5f3f633e270b545d66ab4da130a3cf039df266a68fe00259cf2aea937331473709cc3ad41fd5616c3f99ed5900691c4140e88e79d68084550b402a96af394ba0aaf2799bbd743483cca4800b4009a7644638bb0086d63addfe908ece4da01ea66790928f1b2963d3baf4e822215e57ecc535353ec695f63a4f53d3bf8ad7199c78f75349a95459bb290a81cd2aa56eb641523b5f6bb5c7a0a959e7fefb51083803bc76684f0e59e5ee7770ebe5eaecc100a19d83a24c5f0599a9bf2cb3cb2e16882c821e2f884b1f123164f84004184d5b3e6d964d3c475bfbe045ac2" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2020-02-06T14:19:06Z", - "spec_version": "1.0", - "targets": { - "dir2/inner_delegated_role.txt": { - "hashes": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" - }, - "length": 0 - } - }, - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/root.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/root.json deleted file mode 100644 index d6bbfc3f9..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "9c92a391cab4bae8230a574dff97cf88a9833638da65afefbd47779031f6b6b8", - "sig": "29897dd4ac70676c9ceb67f7506860b85b75ed21c37684853243eb23162e7e6c25f16a0cec6817d9785dafce39b03deb097ca84a3607377bbf460feb5c097866e23d1ff54870b8e24aa9226d64bfbcdd4db65de7577d08c97f30345f036a5739c27da95749f3f997406a2c0bb916a029893de05caf8bdd583279ca27435a2d15745f67619b77452cae7ddcd6a2f6ee4e5f919efaddca4e807623dc4baae3d1348c9ed8af5ba5b0e893bd996503ae41d6a8a0a6f5cb2483f7565f1045d7e2cd07d52dc972b5741842fcde780fe5ae909b818ac01baed1e3ae1b009d15f08a5a9ce271722ff935c421c0ad18f07c54543543bbc35c501f113a93771f04ef68013c98fbae553e736d0e309bb46e2968fb73c311af862fbfc378ac3909a63b765e2884b61272ff7ecd332bfd5a2c86f5e28705766de7db50d1c92cfb40c712fba835f3f15165a03a2a78fb4a0ae7b49387693e34944868afcd722cabb5c7c666a633ed06863e540a56880bce524ad835d94cc017de56c150595a95a3b9ce93a3df49" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2021-02-04T19:02:51Z", - "keys": { - "699654bbeb61fea62f41548d7f66f3112a00a7dec07b4c6c99a420ef77d33e5c": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwvyLoT3TNFzwOXbwO5eU\n8eGrIFyXGa97w0cp44l4rASZKJ7I9/AjoCuitKYiodIPtVP5dGtY+dZFNQvXjdQp\n7Te/bDyj4T64jmlOFJ5MT+Qx4g9tqaW6w6v886ZqlUTe422v2cinwXAFlodDMOxK\niZ088vFGON8Ju1jsRN2L3P4tW2mu1wOV6RDUTm+qP3VrxnWo4aleTWAVjU80v/vm\nId4HZvwYDATnkdhKgPsEFTbiPsXil00UKfO5FAExdls1978REdLLfEgLJnYtIOpH\nqmigmGiIchZlGAl8JYrCRrYgMWxiEWnXfQWqRGDJ/AJV6Nbuf9wrStd3i3yPcJHV\nb1oHLBDCCJ6k7Qa3LJIYXk/a/N6NB9g3/Bfg8nJVuCF+LQ8M7mhC9xCXCOjPIyGd\nUNyx4BqxKtSOSSJrR9OLIFDKdxw8kKWC+5DPQXlTA1bAjdMeR6ZXWYLxMOSn2jep\nySAx3eU3UdhOzG7Esw7vMbVa1oyBNloyas7uwXV9tMu1AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "7c70a1b8116ea8cb635ec1ef479492df6f9f0485b63d0927e1bab4b33e29cd54": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAlVOTOqAJpxv/33JXMObi\nXD3luL+yuDf+rhIEG6II8JA6qbYW8aEx9yj+Ku4sDQD1BLJ44ebEX7qxzLJPv3LC\nYQN12La6nUS9kuK2tI1SISrBKjddaC+p/l+aMqPDT6lnt/qnbsZc2SCNdK0CPAnh\nWSOZyxf+e1ZRkKT20guqNV2W30ww764uNn5ST4SDdKqgQgUBPDaPZSlGLcAXxXCK\nQEP/b8jyiz3BFxZyJwCk2H7e41gG9nBceX/ARvCZFZMuGIR7zK6cd8A+6WDF7eM1\n5onj1lYPLL7Mi+bFAbDzCF75NQL+nSTjn4e9olLfiXap/XbnYck0huRAbaIpDZxC\nIZhX8VUlgeO9Y5/PeS16etCsP/Ch4YL5ijZQma0yUDh5Qmier9X3YHV5nTBYu/zN\n5U9tLzZ+GnKG8jDgKQJwFDLv60Hk27KlrCHkrWXZnI9TIXa7d4cpp5RUVfpU4Dal\nwrWGXzHg/EjYHx5qXJc93dUoGvSKS5Jz/Y8MNeVppIvZAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "9c92a391cab4bae8230a574dff97cf88a9833638da65afefbd47779031f6b6b8": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAufSY8KwZIja0Na750LCC\nHovf3Ktfh7jnmaNXsFvlTXfnyOaHfJTCU+6pXTdAHYoIcnZLEx8gEC1PobibvFqt\nicM4ZDh8OQMlgUofXmGOgwLaRaPYEZ3nZPAQKtE1ISDbyZ61FnjLAQOHXDlA/kUy\nJLH6KBeVS18kvFqCnelgiJADWGroWJP6vRer2WRxvhSKp2Uh9EUL2zSjzo2Kfome\nqp3Lx+AP5tRza2UTnrEPkIjqQUAqUcQN5bRJ77hGWCtjtAx1M3yXs6cou/Au1Xg2\njLeDSbgi+57cxVuYmHUQwk+XLOabXgdUDOav5rBHoU4owXDo2lWI6ktKV1SEsxl7\nNNI6rQ0ef3tbDjhCjjBLYbhEngXAUI/VMHycJB1tIvzVb7zrvuTSYcMmBAS6Tg62\nJgMzAIh7Qc8SUgR9JaDgGGksKSXtEruvR6kGDApHglIUbTgKyT9fh8sZ5m0czzKW\nLBSXwYmZHnt0bKNFdf2gvkqfP4iV4moRkZi5Qzf7BostAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "b160335321b9d13b224ffb43d96d68e8565c516f8adca98ff5e50ea060c88345": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt8lxr3x5fdX888ETUN6L\nheNzR9B6taDcFrxzfhLKHMBr1ibsW6cC65XdFWTjXlyEwv0O6Q8KtRxsZ4VWZC++\njPBmqx64pIwavlKKVTxYKyDiviKaFQSpHFbzWJadyylrnK0TVdPuaOvBv6kfszim\ncIRIPdbqWBCt34UG79fAbDLH23lA5dFhQVEW0v1r8Wt937lj24YCAw9aBLwbkjSs\nyTYHYKJiIb64YK75OCU7BNrG56uwtlGjNDrlDJbWqnkjaSzDp8KhDNm/iq3O1QDq\njTY5WkMR75Kn+cPJ06kxHcJ9sbmorXFBQwiFe9iDe/AQG5xrjkm/vDWLL0iC1ZKP\nM4t1qPRKYiijm4emnZ4IHkx7EgcDBNNoOorsMDj7IQqMb2t2mJsW4/1wjdUGOmWF\nKzFWLYux8uwTQPHinNl12CtQeTkLs5KvDK5Wja/dbps8Riw2+qL5u4auuTP5MHKk\nQdRmlMFDS5B+ka/GyitXucx1WeXp1sZ79WCOn7aTkLMtAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "9c92a391cab4bae8230a574dff97cf88a9833638da65afefbd47779031f6b6b8" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "b160335321b9d13b224ffb43d96d68e8565c516f8adca98ff5e50ea060c88345" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "7c70a1b8116ea8cb635ec1ef479492df6f9f0485b63d0927e1bab4b33e29cd54" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "699654bbeb61fea62f41548d7f66f3112a00a7dec07b4c6c99a420ef77d33e5c" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/snapshot.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/snapshot.json deleted file mode 100644 index 1a7147583..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/snapshot.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b160335321b9d13b224ffb43d96d68e8565c516f8adca98ff5e50ea060c88345", - "sig": "5cda6216a139bce6192ee534d318ff1ccdbc493d84f131daa77d9d28c31b9655f85c580dbfbf4ebd3203831517899e6d6d53b1d6d57120be362aa5d7e424ed335614800ae588f3b1537ec9788b10fb52866d2904190e663c28004ceec5675a6020f0945bf09678067d47ac31c93ffd425270c4c1dba92d83e98a6bffc773071da2fc7debca49fd35810fb20447f81399e026f7dd84b5dd7f256d3b29ddfe5b65efb1845b1257e9d5b5649c2a3d7326300f601349a7d57d8bb1da96fb50edabcc68ad2938be9708bd34c62cb11db2b5d26de65d01bc26e305e2c32625b98676c81ca79efe8f03d5f2c3171f7344cc5e3a37f2fd82c20e171647c7f5b9684ef4492cab99c79ae731142593047380071991d732ae5ea94bd597367dc93cc0af68db596766258ba3305dd23798983899b421be63ce13b8d449d4e51f9a1b35b116bcae38305e5a38b0e2965d9fa65d3aeef54e8ee75ac2a10c91026a6ab3c47047879eca7982d896e332e4d363d68264e7bb8de4ba9aaec6910632b943bc73c09ce0" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2020-02-12T14:19:06Z", - "meta": { - "delegated_role1.json": { - "version": 2 - }, - "delegated_role2.json": { - "version": 2 - }, - "inner_delegated_role.json": { - "version": 2 - }, - "root.json": { - "version": 1 - }, - "targets.json": { - "version": 1 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/targets.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/targets.json deleted file mode 100644 index 9095829df..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/targets.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "signatures": [ - { - "keyid": "7c70a1b8116ea8cb635ec1ef479492df6f9f0485b63d0927e1bab4b33e29cd54", - "sig": "4633196ed60f9915064f3b4e680a4a8d0f82cc22d812a5b76fa3f60eed5ad6f4350d2dd55c774ab498d8569628ffec55a423e772dbc991913080690da01d070a6eb6f784c4d7eeb0f92f6385641ddd98a3d4fc2f07b89f024032297c505eef7e54b900a92f4c009e19792a8249411a9da6d83c4a804fee3ee53399c959e7e25b786a2dd88289e8b25a5158ae3a5c078fb4c66b08b92afb1608afa7c50875d72d35e9a77c65446c9ca0cccd958c35d7cd31e91bd29cc16f060df6d08e0c5537bf78813b381ec26b2999bc55e2e9e78b8d168d071924b278e010d733d9288a762e19cf0defe3dcae3ba646782a3d76ce35bdad28204b503b67ed97cfeed7a17731b7ff84e04101e0f39d0f6f79fc04a64f5d1e4a41a00b75ee6575624667dfc6bae27fac3b825d334184f00712de450931eba3e1afbe9b70ef86a749243025bc8a62663fff1f13b0ce09d1f5b2f9c128f6f29a47209300d96ef348a4ad2b4895ec09b7521ab67b5358f0c2d568228e5d1878e316a8e305ae73536620ebb16def24" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": { - "501fc6692914ea3c7d4ac4de596907c82aeddc0766bf5c2e1c5542b1c6879e5b": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAwK53ZZC2/GWry1pdOtFz\n6u7lRu5XwzcBcYHx9q2gsso5MiXrBHV2M5NCjPTJSLnZ9XLhC4bbnIqkeT3VCjVf\nqQn18aj7egTjSZgM+FIYSRzmkwixUt9hFZS0OovLl3MIqqYk/jyyLd/gFC9GODBy\nkVty76wzc+taQfnDpdhE+ZvOy/SCgHwkkhCfiTw0/LXdHiefm5x9ee4KfVrhbTn0\n6ZFzkbzqbXGWgIdSZF4/ZQAG0y/aEsU1e6uKaWdAsH8+qQV8pH80zqc+OHC+1PTk\nV+0POcdvmO1LD85uPi8EtPi66SaGfnNYk5fq/Joq7fo2cRFCuYX6AjMqzqaQ9eaw\nAj4t9DxpbD57oAlJlTnU0/bfmxDNSqnzHDoXU8pkC39QxvbzNlA+IcT0QUWPi7jL\nuBrupBJjg8lobootu7CTJb96R0bBQFE1AHDIzXWkaQzr5JWXoTsizHV3WlYRwe6U\nzvcDLCKJJDQedFs2PxJZ/p3LDULm276ePbGK/EQDAI73AgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "5ada0b066ab18997d0573692a591d5c025e16e09c4298eedba27c21fb35ef10e": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEArpF5XZXda0P5M5IbOV/t\nhyZpAtGNMPAsCKXbKBJrNbriV4mBs6v6/9oYPdyz2Y1U2fIhLIQWfFCTQddpVL7r\ndU+5fYvrbuteUwd4lZ46SGqL1Xt6nzYG8igdpXWxVJJyTnp2sTT7Btz8CbdTQ5hm\nGYCWsAhPlncHpxnJj1HuZeFPZxs9f6B5TiBCrhicWH2ay9/Lz+mwQk1fDC2VwGD6\nVVMpFtMm8sO8AxV8audi9GjRaOCOTdtlk2mvGtxj/vqB9AMErkgG5Bxer3s2Ry9f\noF0gHOUmmNW4pmk8Iqf0OZpWmGz2Nh1Qgw8IMqQWxsDq0T/1VUxFU0DoLf4qnnI2\nD6RfGuNCB13QanYhXh4apdamIa8fqRnMmdyvvKm7Y9CAZRASW8ltzfVIT/DMmm3s\nbnN4uFoXWvBVihXqBk5Jx2uKDUo3duY/Z9kHp/e+IdGNElLNMQNHJustGHVIq3ES\n7cFlDJze0Z0jXV+TMIMtrFIPmzp3NJaLl7tF2nrk41/bAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "ae9c8b250bc4c8acaae52b8f0e3bc9d134bf7fc358c61a1efe6ecef16e01e5ca": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA4+WTKegsztvnGpOfXKuT\nqx/ZhfZodAyI0ye69G4VHwfVP805O9T6xoKxGDA8PTpxBSe01HgZw5HgW7CJMY1Z\nFwQ0/do2pI1Ef++JyhMNucCaTiyQcAMT50/0WBWMWCemt05kb/Kbdp+ViOc/Ayp1\n5J9ok4+MyCXpBlNdOdsUw3SK6ps1kqMQkiH0jigfZGIYg9zeJ8qDT/EGu0hHSzDw\nxGTBTGPjMvUWXL98ZE1cBJA+ePP6YNQc9qIIxWeMYUO6Kx6O8QoifEdZK/AHGwcY\n4MNVtXsQ61xINtYDl1jTtz1COIBKGNvDWllF5llOZK3vQvbBPgvUpf1Ia4eWl92B\ncWN5d0gAd/rirugT5As6tsB3b4OvI8SxAU0OBqEwqi8uEL9tdB8CCBwHGdMHntJ/\n8dqIpBjNIdI58iGdKTznP2k4yokxE7sIGrM3g3UfZ5Ux8LuUEF7MXsvkTeP057G2\nWqbdaalAw4z3SGJdBDbUO7MIzWdbJVjoeak/jCNQ3pifAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "f38aa831c6bbb2a676917724a2407034ef27ad4d953232c2d2ec6d6abe4672d3": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA1VArRM8KSmO04ov5RArA\n+lXBK+a5Pn9NuQSUMxyuCGqIRT51VrammOpubgDs+PmXdwKxC6aGqMHtsaU8UJHb\nPxXq8b1Idm8Cac0ypjnwjdPhnpG0GVRSrK9bej2MFCICHz3YkX47wqhMnCyt03hk\ncR718wLdLw3LKIcmNTzx+w2RHzVzsVgfZMpczfc0jOheDz4vUPSc4s3pY8CPmLvu\n9qNpmlWSka4GOY9qdCp6P4FGABUj7RM68UBhuv3w4fBgwhfonUvjEIy0QqzyGt29\ncWpm9eBU7XEuHda2o3DsVB0tLqInk2Yyn6oqnE5jEEgLONQx+XOcQ3MqSUQbtEtj\nocR4aVptstmt0tbAQoa6L4QkGCltpZ5y0zuMpxQ9g46FP4uHQ0qPqGm8ZJKaXY0M\nV+ahDJEuYYGciOlQoyzH3/Iw8PIpAJK0jwTS0U7FQLVlZ+WamZiHgUKglwmZRFe0\nug9B5LvoKRNyxvwrOflu3Ly0wcd/w5LAYK6Nc+bCTLmhAgMBAAE=\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - } - }, - "roles": [ - { - "keyids": [ - "5ada0b066ab18997d0573692a591d5c025e16e09c4298eedba27c21fb35ef10e", - "ae9c8b250bc4c8acaae52b8f0e3bc9d134bf7fc358c61a1efe6ecef16e01e5ca", - "501fc6692914ea3c7d4ac4de596907c82aeddc0766bf5c2e1c5542b1c6879e5b" - ], - "name": "delegated_role1", - "paths": [ - "dir1/*" - ], - "terminating": false, - "threshold": 2 - }, - { - "keyids": [ - "f38aa831c6bbb2a676917724a2407034ef27ad4d953232c2d2ec6d6abe4672d3" - ], - "name": "delegated_role2", - "paths": [ - "dir2/*" - ], - "terminating": false, - "threshold": 1 - } - ] - }, - "expires": "2020-05-06T20:41:41Z", - "spec_version": "1.0", - "targets": {}, - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/timestamp.json b/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/timestamp.json deleted file mode 100644 index 43c588fd9..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/metadata/timestamp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "signatures": [ - { - "keyid": "699654bbeb61fea62f41548d7f66f3112a00a7dec07b4c6c99a420ef77d33e5c", - "sig": "14795c5d8a26b50b613ce0e8692c03b39834b2123c8cc8b44c4e61fc64cb0e9fdacf9664653502befcf6cb393d20536e10aa9cd65c72c710c4c3ca4ebba8b28298a8f6f00f8597efe660b00cdf8d2966dd008e282941de98cf55ca75492a708423e391bf47d47d20c72c152ceb8b6acc84b17c560b6dd3d8882e11070d91b2f7584a595dde8b21d9e33d8b0ff8ea8d8c1fd82ef952b6266b8d03fc855779c0fe518143e1e3746385b6437a0aedf1565438497248f37f9c516c3ae9325541803e15e6c221dd15c9234698e1b4f58baa08bc9375f29ba868d2107c4d3b386f24f3a2fc002eab6cf4fc848eeddb029049126d71ec70c36897970d7e3832dcdc4a0aff62c1070257353a7efeb240b6ed720c2ad3baec88b739cc28aa425baf15544eb66a45ad5fa7fa2b2292e7850e4321ccdb829cdbe8c38644714845d2c6974b7ec180336fcbb2825457c76fed072feb53c9792dca616edbffae752414df8e04433718f9da4951b3832bdbf87f99b0bea1c14996eb2d60ee262722f664d667e99b" - } - ], - "signed": { - "_type": "timestamp", - "expires": "2020-02-06T14:19:06Z", - "meta": { - "snapshot.json": { - "hashes": { - "sha256": "83f34b0632bed081a12c6bce79dd31a2bb08b4610c60929c9115a0b86dabb042" - }, - "length": 1271, - "version": 2 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/COMMIT_EDITMSG deleted file mode 100644 index 2efefc191..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Add targets diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/HEAD b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/config b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/config deleted file mode 100644 index 6c9406b7d..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/config +++ /dev/null @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/description b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/post-update.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-commit.sample deleted file mode 100644 index 6a7564163..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/update.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/index b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/index deleted file mode 100644 index aa6813358..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/info/exclude b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/logs/HEAD b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/logs/HEAD deleted file mode 100644 index ac14b6b42..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/logs/HEAD +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 f9f365d26b05ac86e353740a697679820912b104 Daniel Elero 1566219831 +0200 commit (initial): Generated initial metadata -f9f365d26b05ac86e353740a697679820912b104 665bec3cdc6d37dadfb1b55b8507ac1f6ca01725 Daniel Elero 1566221320 +0200 commit: Add targets diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/logs/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/logs/refs/heads/master deleted file mode 100644 index ac14b6b42..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/logs/refs/heads/master +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 f9f365d26b05ac86e353740a697679820912b104 Daniel Elero 1566219831 +0200 commit (initial): Generated initial metadata -f9f365d26b05ac86e353740a697679820912b104 665bec3cdc6d37dadfb1b55b8507ac1f6ca01725 Daniel Elero 1566221320 +0200 commit: Add targets diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/1f/5a76fb5103137e06563e8aeb762edccc5a90ec b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/1f/5a76fb5103137e06563e8aeb762edccc5a90ec deleted file mode 100644 index 459fddddd..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/1f/5a76fb5103137e06563e8aeb762edccc5a90ec and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/2d/1ae569a7b9a93a34888928c015678eed0ead3a b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/2d/1ae569a7b9a93a34888928c015678eed0ead3a deleted file mode 100644 index 15539b7ec..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/2d/1ae569a7b9a93a34888928c015678eed0ead3a and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/3d/9c3c1f4a0958e25126b57609e9aa93c42d017d b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/3d/9c3c1f4a0958e25126b57609e9aa93c42d017d deleted file mode 100644 index 5d1fe7963..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/3d/9c3c1f4a0958e25126b57609e9aa93c42d017d and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/45/a8125eddad56648ca141e39af819798a024678 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/45/a8125eddad56648ca141e39af819798a024678 deleted file mode 100644 index 1b12271cb..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/45/a8125eddad56648ca141e39af819798a024678 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/4c/45a320639509b78ff924f28a738029a8ae4ed8 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/4c/45a320639509b78ff924f28a738029a8ae4ed8 deleted file mode 100644 index e9c7c7600..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/4c/45a320639509b78ff924f28a738029a8ae4ed8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/4f/677601ad24169ee6d3050cf7695a62df43b344 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/4f/677601ad24169ee6d3050cf7695a62df43b344 deleted file mode 100644 index de4477c8b..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/4f/677601ad24169ee6d3050cf7695a62df43b344 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/66/5bec3cdc6d37dadfb1b55b8507ac1f6ca01725 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/66/5bec3cdc6d37dadfb1b55b8507ac1f6ca01725 deleted file mode 100644 index 54d475c23..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/66/5bec3cdc6d37dadfb1b55b8507ac1f6ca01725 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/96/7b7d2751a75b430f776e3757ab1cfcd198f51f b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/96/7b7d2751a75b430f776e3757ab1cfcd198f51f deleted file mode 100644 index 729467622..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/96/7b7d2751a75b430f776e3757ab1cfcd198f51f and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/98/68f8640709a1864a694f2fe6f1c8b5b7a34d34 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/98/68f8640709a1864a694f2fe6f1c8b5b7a34d34 deleted file mode 100644 index 7722beb5e..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/98/68f8640709a1864a694f2fe6f1c8b5b7a34d34 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/a0/07068ac874054972cf732e73cd12250e938d34 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/a0/07068ac874054972cf732e73cd12250e938d34 deleted file mode 100644 index a0e7a0eca..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/a0/07068ac874054972cf732e73cd12250e938d34 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/a1/2ec4cc26e0eab063db1fd6d6b1226910d60003 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/a1/2ec4cc26e0eab063db1fd6d6b1226910d60003 deleted file mode 100644 index dc0f956e8..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/a1/2ec4cc26e0eab063db1fd6d6b1226910d60003 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/c6/33684a64836f5eea10d5dcbaf8955d7856ce22 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/c6/33684a64836f5eea10d5dcbaf8955d7856ce22 deleted file mode 100644 index 127466e64..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/c6/33684a64836f5eea10d5dcbaf8955d7856ce22 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/d3/18d28879afadb57f890c769fec234f8346a6e7 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/d3/18d28879afadb57f890c769fec234f8346a6e7 deleted file mode 100644 index 53af95638..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/d3/18d28879afadb57f890c769fec234f8346a6e7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/dd/4d76675ccdc7b2f143065a7bb06e3a0e8b8af8 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/dd/4d76675ccdc7b2f143065a7bb06e3a0e8b8af8 deleted file mode 100644 index 1cad77700..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/dd/4d76675ccdc7b2f143065a7bb06e3a0e8b8af8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f3/112cc48de92c0f7b7e128d4818654c8c9770ec b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f3/112cc48de92c0f7b7e128d4818654c8c9770ec deleted file mode 100644 index df080fcbe..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f3/112cc48de92c0f7b7e128d4818654c8c9770ec and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f8/f32f26ee1f359566d4e107e8c82425cade306d b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f8/f32f26ee1f359566d4e107e8c82425cade306d deleted file mode 100644 index 4c4475620..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f8/f32f26ee1f359566d4e107e8c82425cade306d and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f9/f365d26b05ac86e353740a697679820912b104 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f9/f365d26b05ac86e353740a697679820912b104 deleted file mode 100644 index 98195f559..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/f9/f365d26b05ac86e353740a697679820912b104 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/fa/5c33dcee6903fa54ab83f9317375ca7d3ff6f6 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/fa/5c33dcee6903fa54ab83f9317375ca7d3ff6f6 deleted file mode 100644 index aa0bcd23e..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/objects/fa/5c33dcee6903fa54ab83f9317375ca7d3ff6f6 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/refs/heads/master deleted file mode 100644 index 3e889792f..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -665bec3cdc6d37dadfb1b55b8507ac1f6ca01725 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/1.root.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/1.root.json deleted file mode 100644 index a007068ac..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/1.root.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "signatures": [ - { - "keyid": "6ff3c2520046e9a069fbaf8c814fe3eb968c1d23c51ef31543301624b0752f8f", - "sig": "976f4acc84462a878dfb309c23a4eff73683b19c99fc3366326f13dfd744a10dc3f50ecb0afc18b052869c616875b26d6e00ecfc500b0a08ca40cf669138d046ed3ae220b7d36f1dfad20d2330f42f984f6c50f1ffc7dbb7efb11beac61d2526f736da2a83a62928064a73789e7e166df31027973d045e86f0b4f8df901c7af1b76957e6c2ac9fedf8e82b493897dda42b1d26bbedcfd6f82f4175af5dac48d03aca2530d065b21dbd4857c8f9a3de75989917f27666869a90a81ee2675e3bb55241695b81f1066ac86e789c0675f34ba3c02f53c5c5d1403af20f470a0deaa6ed1153350a21227ef4b09237ef467c1a20c1f0f3e0a9c8565ca388c8cb58f8a5" - }, - { - "keyid": "ce0d13b08c43a0f8cd4e8036775384244034ef301fe3b88f65766aecf4b76028", - "sig": "0986dcfb3650d6c2cd0d7e12710e87cc2180eb18d36afaee73d1b5aad7d63470e999fbee0ca457d634a12a54e5ee87eb62555e1e5270fa67e7de5e3f79fa0514d72032c6a4e481a3fa6b7cce7865f020e42dd9e294ca9b845d8234e530d12f57435d54476aa6640555a5f356c84ab9f967c66f0fc1c6b33b331555c06f4c37b3d84aa1122a9b6d44a08fed8d715f3f638d8d742d7ac4e58df44d8d99a38b0bd8217cbcd143c86203cc23daf7ab2847c9a38c085301a6e80d4e3f3b2a8461d7deef5433647f9a19d3dedfceb1f87a3c9ddb32ee687e9168548ed1532fca1beba92104adfc4afac41256afd3529b22706560834174ddaa7466da8d8d5dabb66906" - }, - { - "keyid": "01f26d38091140b1f42c19f11c9dff445887034699d621446191f56e30223cd1", - "sig": "271785232a6f5225f8209bda280100c205b7f48ce6341bbd433beb3db5e599c8fc353af5a9016156837ba6cbb992d3a3bf9ab73835029103a984a67eead87d0ba9751885a574178f31d63c30fd24fc42280263ff66c24d7330b9f365c37d67b7dfd791d5364037e14bbdbaa6dd6838c7820b2639b7656f369a0b319882de3c572e00ebb492197e38a838464406eeede1bd3fd5755874584ff7ddc35ca948d5b95dc7f65c5fdd51d19db417c01850c211e5a9329136c641163736c7154775c3a698cca8bef6d9416e8ef8341afa67bf3fffb89b8354db73bbcad549635e1730f29a4b0c2ee66edb994fedcbac06a33d43f591656c5522462348011f461d321310" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2020-08-18T18:52:10Z", - "keys": { - "01f26d38091140b1f42c19f11c9dff445887034699d621446191f56e30223cd1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5EGVh9xqVFFHnGGIofks\ncA3vHWFs1QP60QTX+ZJUPiUJdDb8wuJ6mu9d8bKojE3SEVHCLpJeV4+muMnLtZWq\nAipiuFUU9QDpOYaqQ5SD5n/9sZfiWDzjVsqZA4WMj0OCd/Bkn+umz3ljHFe0EJUE\nCxYRvmArC05UyJej7fCaQ/cD7QELrpmBaE2qLcG0Vfirz9NekaXixGiKNiIjHAj6\nYwIfES9SycVo42LEOskGFciqgfZJVtSaTIurW+KnOToStazEWY8okon91s+5ltIN\nOS68TtBLtph5PXcLhqSozE8SqMW3gZni6zXHHQtuouFLdGkgw+0V2YLX15Ka78zj\nhQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "59b2e97cf13e89fc501a9f1e7f8012354dc07adaa3d7f49c2a811f42fe8b23ef": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtWRrSKtnvbgwzS7VuBVR\nqiYac4pIREIakkofd+NtMYiMtNlV6Dh1KX327Fa2HxFZKr+krcdi0zTVo1tURNME\n61QEVwMNANpDv1mYuBmdDpm/fXViFi32Yw3OQB3Auw9vFLx3VkVdltrtmGHs1Sg4\ngtdVWsFcGDv1D4N3z3m/fCef39OlhVfOmwe3nJJsvZAlBJINa34PvXnkrZ3r+YCD\nb0RNHyJYdAdt/dcpwq+h83NwfHA4bDegjoA7k3B00YPqaQECD5U+thqqF+uaMoVZ\nnCcdtMDQQ0EoqKG+N+cp8+ivdESqtUVuUUaD3gBVtDolByuNW/7/uBG4fRE1Jph9\nHwIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "6ff3c2520046e9a069fbaf8c814fe3eb968c1d23c51ef31543301624b0752f8f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA552O9PX6L8snG/nZdZAe\nuFgIUk8uJihwCJi8Wk2n2kb4+80mMfOItJHcngpcyuPyoUKUAEj5XkK5b+nbGA67\nXa9BcCEGzw1dS0RSkJsL2iStgeprJxmnb0tOYkgjFB3p0agvyVvOCfNWkg4BxnX9\nJqiGRVJkTugkzExZRqop7miJsj1m6YEpbSmfRdWjTz1AuSsVCsXjkS9b1BIgQBZs\nj8x1o98pozmSBsmnc9TsruSUNQX67ZCNFNAhPGKksqQA9L7WAYSN5CP39T7yJE1U\nCByB/qFwGuxrqofmzpsbDg70aGP/UK+0uaqI5Pfwq+rtxCyNr/gOO6UsXATcDxGD\nZQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "95dab4636fa7c23be5d92722c4441935631dd0ba9ac67073c9ad7f3611af26ad": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwN5AWXl26xlAy+Mii9tA\nwXobOP+zUsoqwNKZu355MCzpMRzHqhWe07iDPyeC+ewbSmeWvpIEOwCWh2DyHsFy\nV7FsDHJiiuFHZcAbxTu1zVBf2FwNcQNfNXUr3ShmcyFZrKq6ZaaslD0mhSqdFwVe\nnEke0ufF9yroV4U3IC00KaMOxDT0EH3q1S8SbNtNh4VIQaSwn5CaNpIXek080oQR\nkXLxJivHJfHIq0iFmXdjNr6TXYNygCBGf2nE0R3X+bVt7xF8/dbanfWn+Z04+ZKs\naTaMuOEGLgfchv33neLcCBKp+fKojEcEpVE6g18KPt2So+s3hSHODzP3V3oUYo8E\nlQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "c3b05c33d8f8e821bf69edd76701bbeb1170817f279c3d9b6bb67e40ba9150dd": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwv8CwlU44Y6ERLZI4OYb\nOKL7YgdJzwgDHBBqVw0IOwEvPrK52YJgIUlgkX/POqb3qQnOkwQza5ZZgn2akn3g\nI6Zs9ZCV0t7ZNLX955Uzoul0WfA+EFUA1VI5ujMBH8E9YOKiokCa6rFxgY+9RTrH\nPuIZTySLOTN8je9E9DsdKOkXQXtUvoZlOqM8AbKcywR1CVSKAqmXNkf55txhdXg7\nNoDoK4T1w7Qxfed9Wgruch/12b5cvY6VsQKGOPZ+HbQBN5+wXopezyPBUj1k7qjn\nF+i9FBjKHM62G4mQ3s1iAs7qg6xCjQP4pW3Q6gN5i0iStgmHy1FoynouVtQAc++N\n/QIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "ce0d13b08c43a0f8cd4e8036775384244034ef301fe3b88f65766aecf4b76028": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvkrFf48hTimH2vfqgD5d\ntB5tRFQnZaat5wSmczTgz01wzl/T0/nL6rxnSw4yACnyUcJyxTP8bzLm3aJz63el\nIm91ef65/OVPBbXowoDB/u70lhn8mvT5LTWs9yBKOPQG92cHt2UwcGgPhWwA0wVn\nu1TFtca5hONGNNkpd/bNnbCCfw1awvYXF+FD7WCnzhvq/mZwgklN5ZHNZJp0KBuD\nXi3walJ/0nffvjVSCcTAYMHPLd8SKF+N9yjSDerJ+opk6/8+TnihgXdcCyvh9O+/\nNhVF1BWh+Hv++Ery63tl7N793MSUbJqXsX3Mmf1v7h+8uDRHWwVtN5VHy9XNmysm\nIwIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "01f26d38091140b1f42c19f11c9dff445887034699d621446191f56e30223cd1", - "6ff3c2520046e9a069fbaf8c814fe3eb968c1d23c51ef31543301624b0752f8f", - "ce0d13b08c43a0f8cd4e8036775384244034ef301fe3b88f65766aecf4b76028" - ], - "threshold": 2 - }, - "snapshot": { - "keyids": [ - "59b2e97cf13e89fc501a9f1e7f8012354dc07adaa3d7f49c2a811f42fe8b23ef" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "95dab4636fa7c23be5d92722c4441935631dd0ba9ac67073c9ad7f3611af26ad" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "c3b05c33d8f8e821bf69edd76701bbeb1170817f279c3d9b6bb67e40ba9150dd" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/root.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/root.json deleted file mode 100644 index a007068ac..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/root.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "signatures": [ - { - "keyid": "6ff3c2520046e9a069fbaf8c814fe3eb968c1d23c51ef31543301624b0752f8f", - "sig": "976f4acc84462a878dfb309c23a4eff73683b19c99fc3366326f13dfd744a10dc3f50ecb0afc18b052869c616875b26d6e00ecfc500b0a08ca40cf669138d046ed3ae220b7d36f1dfad20d2330f42f984f6c50f1ffc7dbb7efb11beac61d2526f736da2a83a62928064a73789e7e166df31027973d045e86f0b4f8df901c7af1b76957e6c2ac9fedf8e82b493897dda42b1d26bbedcfd6f82f4175af5dac48d03aca2530d065b21dbd4857c8f9a3de75989917f27666869a90a81ee2675e3bb55241695b81f1066ac86e789c0675f34ba3c02f53c5c5d1403af20f470a0deaa6ed1153350a21227ef4b09237ef467c1a20c1f0f3e0a9c8565ca388c8cb58f8a5" - }, - { - "keyid": "ce0d13b08c43a0f8cd4e8036775384244034ef301fe3b88f65766aecf4b76028", - "sig": "0986dcfb3650d6c2cd0d7e12710e87cc2180eb18d36afaee73d1b5aad7d63470e999fbee0ca457d634a12a54e5ee87eb62555e1e5270fa67e7de5e3f79fa0514d72032c6a4e481a3fa6b7cce7865f020e42dd9e294ca9b845d8234e530d12f57435d54476aa6640555a5f356c84ab9f967c66f0fc1c6b33b331555c06f4c37b3d84aa1122a9b6d44a08fed8d715f3f638d8d742d7ac4e58df44d8d99a38b0bd8217cbcd143c86203cc23daf7ab2847c9a38c085301a6e80d4e3f3b2a8461d7deef5433647f9a19d3dedfceb1f87a3c9ddb32ee687e9168548ed1532fca1beba92104adfc4afac41256afd3529b22706560834174ddaa7466da8d8d5dabb66906" - }, - { - "keyid": "01f26d38091140b1f42c19f11c9dff445887034699d621446191f56e30223cd1", - "sig": "271785232a6f5225f8209bda280100c205b7f48ce6341bbd433beb3db5e599c8fc353af5a9016156837ba6cbb992d3a3bf9ab73835029103a984a67eead87d0ba9751885a574178f31d63c30fd24fc42280263ff66c24d7330b9f365c37d67b7dfd791d5364037e14bbdbaa6dd6838c7820b2639b7656f369a0b319882de3c572e00ebb492197e38a838464406eeede1bd3fd5755874584ff7ddc35ca948d5b95dc7f65c5fdd51d19db417c01850c211e5a9329136c641163736c7154775c3a698cca8bef6d9416e8ef8341afa67bf3fffb89b8354db73bbcad549635e1730f29a4b0c2ee66edb994fedcbac06a33d43f591656c5522462348011f461d321310" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2020-08-18T18:52:10Z", - "keys": { - "01f26d38091140b1f42c19f11c9dff445887034699d621446191f56e30223cd1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5EGVh9xqVFFHnGGIofks\ncA3vHWFs1QP60QTX+ZJUPiUJdDb8wuJ6mu9d8bKojE3SEVHCLpJeV4+muMnLtZWq\nAipiuFUU9QDpOYaqQ5SD5n/9sZfiWDzjVsqZA4WMj0OCd/Bkn+umz3ljHFe0EJUE\nCxYRvmArC05UyJej7fCaQ/cD7QELrpmBaE2qLcG0Vfirz9NekaXixGiKNiIjHAj6\nYwIfES9SycVo42LEOskGFciqgfZJVtSaTIurW+KnOToStazEWY8okon91s+5ltIN\nOS68TtBLtph5PXcLhqSozE8SqMW3gZni6zXHHQtuouFLdGkgw+0V2YLX15Ka78zj\nhQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "59b2e97cf13e89fc501a9f1e7f8012354dc07adaa3d7f49c2a811f42fe8b23ef": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtWRrSKtnvbgwzS7VuBVR\nqiYac4pIREIakkofd+NtMYiMtNlV6Dh1KX327Fa2HxFZKr+krcdi0zTVo1tURNME\n61QEVwMNANpDv1mYuBmdDpm/fXViFi32Yw3OQB3Auw9vFLx3VkVdltrtmGHs1Sg4\ngtdVWsFcGDv1D4N3z3m/fCef39OlhVfOmwe3nJJsvZAlBJINa34PvXnkrZ3r+YCD\nb0RNHyJYdAdt/dcpwq+h83NwfHA4bDegjoA7k3B00YPqaQECD5U+thqqF+uaMoVZ\nnCcdtMDQQ0EoqKG+N+cp8+ivdESqtUVuUUaD3gBVtDolByuNW/7/uBG4fRE1Jph9\nHwIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "6ff3c2520046e9a069fbaf8c814fe3eb968c1d23c51ef31543301624b0752f8f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA552O9PX6L8snG/nZdZAe\nuFgIUk8uJihwCJi8Wk2n2kb4+80mMfOItJHcngpcyuPyoUKUAEj5XkK5b+nbGA67\nXa9BcCEGzw1dS0RSkJsL2iStgeprJxmnb0tOYkgjFB3p0agvyVvOCfNWkg4BxnX9\nJqiGRVJkTugkzExZRqop7miJsj1m6YEpbSmfRdWjTz1AuSsVCsXjkS9b1BIgQBZs\nj8x1o98pozmSBsmnc9TsruSUNQX67ZCNFNAhPGKksqQA9L7WAYSN5CP39T7yJE1U\nCByB/qFwGuxrqofmzpsbDg70aGP/UK+0uaqI5Pfwq+rtxCyNr/gOO6UsXATcDxGD\nZQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "95dab4636fa7c23be5d92722c4441935631dd0ba9ac67073c9ad7f3611af26ad": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwN5AWXl26xlAy+Mii9tA\nwXobOP+zUsoqwNKZu355MCzpMRzHqhWe07iDPyeC+ewbSmeWvpIEOwCWh2DyHsFy\nV7FsDHJiiuFHZcAbxTu1zVBf2FwNcQNfNXUr3ShmcyFZrKq6ZaaslD0mhSqdFwVe\nnEke0ufF9yroV4U3IC00KaMOxDT0EH3q1S8SbNtNh4VIQaSwn5CaNpIXek080oQR\nkXLxJivHJfHIq0iFmXdjNr6TXYNygCBGf2nE0R3X+bVt7xF8/dbanfWn+Z04+ZKs\naTaMuOEGLgfchv33neLcCBKp+fKojEcEpVE6g18KPt2So+s3hSHODzP3V3oUYo8E\nlQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "c3b05c33d8f8e821bf69edd76701bbeb1170817f279c3d9b6bb67e40ba9150dd": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwv8CwlU44Y6ERLZI4OYb\nOKL7YgdJzwgDHBBqVw0IOwEvPrK52YJgIUlgkX/POqb3qQnOkwQza5ZZgn2akn3g\nI6Zs9ZCV0t7ZNLX955Uzoul0WfA+EFUA1VI5ujMBH8E9YOKiokCa6rFxgY+9RTrH\nPuIZTySLOTN8je9E9DsdKOkXQXtUvoZlOqM8AbKcywR1CVSKAqmXNkf55txhdXg7\nNoDoK4T1w7Qxfed9Wgruch/12b5cvY6VsQKGOPZ+HbQBN5+wXopezyPBUj1k7qjn\nF+i9FBjKHM62G4mQ3s1iAs7qg6xCjQP4pW3Q6gN5i0iStgmHy1FoynouVtQAc++N\n/QIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - }, - "ce0d13b08c43a0f8cd4e8036775384244034ef301fe3b88f65766aecf4b76028": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvkrFf48hTimH2vfqgD5d\ntB5tRFQnZaat5wSmczTgz01wzl/T0/nL6rxnSw4yACnyUcJyxTP8bzLm3aJz63el\nIm91ef65/OVPBbXowoDB/u70lhn8mvT5LTWs9yBKOPQG92cHt2UwcGgPhWwA0wVn\nu1TFtca5hONGNNkpd/bNnbCCfw1awvYXF+FD7WCnzhvq/mZwgklN5ZHNZJp0KBuD\nXi3walJ/0nffvjVSCcTAYMHPLd8SKF+N9yjSDerJ+opk6/8+TnihgXdcCyvh9O+/\nNhVF1BWh+Hv++Ery63tl7N793MSUbJqXsX3Mmf1v7h+8uDRHWwVtN5VHy9XNmysm\nIwIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsa-pkcs1v15-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "01f26d38091140b1f42c19f11c9dff445887034699d621446191f56e30223cd1", - "6ff3c2520046e9a069fbaf8c814fe3eb968c1d23c51ef31543301624b0752f8f", - "ce0d13b08c43a0f8cd4e8036775384244034ef301fe3b88f65766aecf4b76028" - ], - "threshold": 2 - }, - "snapshot": { - "keyids": [ - "59b2e97cf13e89fc501a9f1e7f8012354dc07adaa3d7f49c2a811f42fe8b23ef" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "95dab4636fa7c23be5d92722c4441935631dd0ba9ac67073c9ad7f3611af26ad" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "c3b05c33d8f8e821bf69edd76701bbeb1170817f279c3d9b6bb67e40ba9150dd" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/snapshot.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/snapshot.json deleted file mode 100644 index 2d1ae569a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/snapshot.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "signatures": [ - { - "keyid": "59b2e97cf13e89fc501a9f1e7f8012354dc07adaa3d7f49c2a811f42fe8b23ef", - "sig": "7c68a37407572c444b9adb9f961d12d429695906c131f4a363527289b6943ed3fb7bd8db8e5a0374ebf7042f8cb31dff533543174be05e51ba70fc35e4700c00dc2e6bbb96e3d6e3831fda50b5b020ce2f6ffdc3b10bd77212b54930ea94e89bbd496c3e8bec9a29337be97f9429732d266db60307e308e92852f4a491b6ec8db305348c6d0da30b5c0789d601be2501e93e982ff4496e40579be4fd73d2e6b45d234dc8ef746a3769447c0a24e7c756f64fca5a10fd3d9d7d7b4f00bf4684e949f94b2e26bcd79b18b6313d9a885e363b35d60869bd683df2311541d5a214ebd490f3e389b32154a99af6bc1f61a0efc686e442c206d32640aa335af640fe4a" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2019-08-26T15:25:48Z", - "meta": { - "root.json": { - "version": 1 - }, - "targets.json": { - "version": 2 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/targets.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/targets.json deleted file mode 100644 index f8f32f26e..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/targets.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "signatures": [ - { - "keyid": "95dab4636fa7c23be5d92722c4441935631dd0ba9ac67073c9ad7f3611af26ad", - "sig": "62e12ec7ece21fd62072aae08d52bd34defd43e2756e6bd1ac29ccd2a5bfe2a3035b7dcf1dc5cb4dd801bbc9007673a3c384023b6f5eed93e0b9267b1ff724cae68d148d985e0b39203af0241d701e3455b0110fabb558e9887c7964de7a9deebd6acd9cef35cceab46fd8ed61849efce016b69fff967075698aece1f7aeb22322d6e052ebdc45a86ee1838a2eec8db3e5f09ee31f8ba534aa3d46b81c7998e806a69e5c67686dbb45c8b04431ffb969e94be0f19c54fc0425bf4f0eeefafee363e751b81edd1087250618b1ff84b10e085a3d7e9796bbed0e97c3342791e0b2b1a3274809b2e2dbf1be5db9e387e03e456e1ea241e2ff16057abb3e8004a6c7" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2019-11-17T15:25:48Z", - "spec_version": "1.0", - "targets": { - "branch": { - "hashes": { - "sha256": "943317cf1551484e5e44c9c32a030635977c85c6a2a04ff1aed0f66f99f25fdd", - "sha512": "1b5ad51243cd140fee1d8b32eca468672145f3021315b90ac4e431a2a64bf44d4f296fd078a6681fb9318c851f65bf703457bd66299f1bbbcbc321e74591302c" - }, - "length": 36 - }, - "dummy/target_dummy_repo": { - "hashes": { - "sha256": "d277d5d60d93bb7659302ddf1c2a742220117575075dd19fcdb1a6aa9a9a0c91", - "sha512": "27dc6d858b8dd1ccd54a773194ebebac2ce298972f48d852ba1093899b057d6d700fb484ce83670e318ddc8ad9d4f96cc3e7ea58d0501f25dd6caaf17830aaa6" - }, - "length": 60 - }, - "repositories.json": { - "hashes": { - "sha256": "ad9439bbc093303dccbf3fd2ff8595c775ecbe8cf39e4db283d17ec1cfbe6ad1", - "sha512": "35c8f4cd1ad7650ab62485dbb1d1255ee015f8d495f24e3ea871158538f0386a6fec5a433f5a5e4ed8e794af74ca9824b7e0402a8497740380ad94fa9a6b4a97" - }, - "length": 212 - } - }, - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/timestamp.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/timestamp.json deleted file mode 100644 index a12ec4cc2..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/metadata/timestamp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "signatures": [ - { - "keyid": "c3b05c33d8f8e821bf69edd76701bbeb1170817f279c3d9b6bb67e40ba9150dd", - "sig": "b362711ac3d72cefa6e1fc8c46c8235db757f1783394863de022c4117befb30db90cf479cefa2278f700c29e8947eb7461a24b82c925bc2e45a0aca330d479c893a58fa30f1215c1b4adabff010ec6c65a55593ab8fb451532c96bedf940f80598268d2b3484fcf316427036ab4e2082cc7918e07cfabb326f24ab21ac05a35ed0824d73a60669bdfbc5be9316b0d2f8fdbb9c160a524fa00a787a11afa53423c2588e2069506dac6b84af813fe3b9fab25a6d887c1ae32ded5b3ae6f5524af47ad95769629685bd5d08aa744b89124a285ae872971f0133f39e971525db11affab2e84c2ad286accc9c7b293d4a1e7cbcbd0e7201518cacdc024d581fc475d2" - } - ], - "signed": { - "_type": "timestamp", - "expires": "2019-08-20T15:25:48Z", - "meta": { - "snapshot.json": { - "hashes": { - "sha256": "20e34e7ded3d197dd0d11eff46de3e29dbb5b654c9ab76162c15f9af8ecd0bca" - }, - "length": 854, - "version": 2 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/branch b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/branch deleted file mode 100644 index c633684a6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/branch +++ /dev/null @@ -1 +0,0 @@ -14e81cd1-0050-43aa-9e2c-e34fffa6f517 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/dummy/target_dummy_repo b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/dummy/target_dummy_repo deleted file mode 100644 index 4c45a3206..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/dummy/target_dummy_repo +++ /dev/null @@ -1,3 +0,0 @@ -{ - "commit": "97ecf2f97bf8c563e1ab80b8e7ea4d67612431ca" -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/repositories.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/repositories.json deleted file mode 100644 index 45a8125ed..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/taf/targets/repositories.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "repositories": { - "dummy/target_dummy_repo": { - "custom": { - "type": "dummy" - }, - "urls": [ - "../../target_dummy_repo", - "..\\..\\target_dummy_repo" - ] - } - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/COMMIT_EDITMSG deleted file mode 100644 index a77fa514d..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Initial diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/HEAD b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/config b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/config deleted file mode 100644 index 6c9406b7d..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/config +++ /dev/null @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/description b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/post-update.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-commit.sample deleted file mode 100644 index 6a7564163..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/update.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/index b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/index deleted file mode 100644 index 6b0fd8e4a..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/info/exclude b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/logs/HEAD b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/logs/HEAD deleted file mode 100644 index e008ddef9..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/logs/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 97ecf2f97bf8c563e1ab80b8e7ea4d67612431ca Daniel Elero 1565952513 +0200 commit (initial): Initial diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/logs/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/logs/refs/heads/master deleted file mode 100644 index e008ddef9..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 97ecf2f97bf8c563e1ab80b8e7ea4d67612431ca Daniel Elero 1565952513 +0200 commit (initial): Initial diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/1e/0343c5ce0f6104923f043245f47f1ceb9ee768 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/1e/0343c5ce0f6104923f043245f47f1ceb9ee768 deleted file mode 100644 index 52e43958a..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/1e/0343c5ce0f6104923f043245f47f1ceb9ee768 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/97/ecf2f97bf8c563e1ab80b8e7ea4d67612431ca b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/97/ecf2f97bf8c563e1ab80b8e7ea4d67612431ca deleted file mode 100644 index 6111e8aa9..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/97/ecf2f97bf8c563e1ab80b8e7ea4d67612431ca and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/a9/80e407c8dc72f1401f2a8fb8b093ba8c9d6040 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/a9/80e407c8dc72f1401f2a8fb8b093ba8c9d6040 deleted file mode 100644 index c5806abd4..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/objects/a9/80e407c8dc72f1401f2a8fb8b093ba8c9d6040 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/refs/heads/master deleted file mode 100644 index 37d1f22a4..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -97ecf2f97bf8c563e1ab80b8e7ea4d67612431ca diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/test.txt b/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/test.txt deleted file mode 100644 index a980e407c..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pkcs1v15/target_dummy_repo/test.txt +++ /dev/null @@ -1,3 +0,0 @@ -Test test -test -test diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/.gitattributes b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/.gitattributes deleted file mode 100644 index fcadb2cf9..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text eol=lf diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/COMMIT_EDITMSG deleted file mode 100644 index fbb9853a8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Add target_dummy_repo second commit diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/HEAD b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/config b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/config deleted file mode 100644 index 6c9406b7d..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/config +++ /dev/null @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/description b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/post-update.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-commit.sample deleted file mode 100644 index 6a7564163..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/update.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/index b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/index deleted file mode 100644 index 234c8e5a4..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/info/exclude b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/logs/HEAD b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/logs/HEAD deleted file mode 100644 index 1f3e915b8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/logs/HEAD +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 1d15d78b5a5c5d442f2eb866f5fb3d9d3f1e4c01 Daniel Elero 1559232757 +0200 commit (initial): Initial commit; Empty targets -1d15d78b5a5c5d442f2eb866f5fb3d9d3f1e4c01 a7205d080f9d23c429fa1a06a4d453cd9090b5a9 Daniel Elero 1559232867 +0200 commit: Add target_dummy_repo first commit -a7205d080f9d23c429fa1a06a4d453cd9090b5a9 1bf75a61c6bb7bba163d6ec6644a09ec0532176d Daniel Elero 1559232991 +0200 commit: Add target_dummy_repo second commit diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/logs/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/logs/refs/heads/master deleted file mode 100644 index 1f3e915b8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/logs/refs/heads/master +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 1d15d78b5a5c5d442f2eb866f5fb3d9d3f1e4c01 Daniel Elero 1559232757 +0200 commit (initial): Initial commit; Empty targets -1d15d78b5a5c5d442f2eb866f5fb3d9d3f1e4c01 a7205d080f9d23c429fa1a06a4d453cd9090b5a9 Daniel Elero 1559232867 +0200 commit: Add target_dummy_repo first commit -a7205d080f9d23c429fa1a06a4d453cd9090b5a9 1bf75a61c6bb7bba163d6ec6644a09ec0532176d Daniel Elero 1559232991 +0200 commit: Add target_dummy_repo second commit diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/14/5c6be99c3827f76c5fef0a3b4290d1ace037ff b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/14/5c6be99c3827f76c5fef0a3b4290d1ace037ff deleted file mode 100644 index 5cf9f5e78..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/14/5c6be99c3827f76c5fef0a3b4290d1ace037ff and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/18/32dbf439d55a3d1b66efddfb9bb5e42d6f9a5c b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/18/32dbf439d55a3d1b66efddfb9bb5e42d6f9a5c deleted file mode 100644 index 88c7747c7..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/18/32dbf439d55a3d1b66efddfb9bb5e42d6f9a5c and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1a/1c9a8d6986d5c12d3878db2954e7e96b2731dd b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1a/1c9a8d6986d5c12d3878db2954e7e96b2731dd deleted file mode 100644 index 021a9e52c..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1a/1c9a8d6986d5c12d3878db2954e7e96b2731dd and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1b/f75a61c6bb7bba163d6ec6644a09ec0532176d b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1b/f75a61c6bb7bba163d6ec6644a09ec0532176d deleted file mode 100644 index 96fe40c19..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1b/f75a61c6bb7bba163d6ec6644a09ec0532176d and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1d/15d78b5a5c5d442f2eb866f5fb3d9d3f1e4c01 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1d/15d78b5a5c5d442f2eb866f5fb3d9d3f1e4c01 deleted file mode 100644 index 264a09284..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/1d/15d78b5a5c5d442f2eb866f5fb3d9d3f1e4c01 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/20/d13434d39d269f349225a74d1e3024c9d7afc5 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/20/d13434d39d269f349225a74d1e3024c9d7afc5 deleted file mode 100644 index 5abf3e126..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/20/d13434d39d269f349225a74d1e3024c9d7afc5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/22/6ca816b39945f2a6655fde2a204e94d5d9d7fd b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/22/6ca816b39945f2a6655fde2a204e94d5d9d7fd deleted file mode 100644 index 04b88a018..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/22/6ca816b39945f2a6655fde2a204e94d5d9d7fd and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/45/a8125eddad56648ca141e39af819798a024678 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/45/a8125eddad56648ca141e39af819798a024678 deleted file mode 100644 index 1b12271cb..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/45/a8125eddad56648ca141e39af819798a024678 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/4b/a292422d6c7ec6a131b5f5a1f0ea06d9f2f89f b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/4b/a292422d6c7ec6a131b5f5a1f0ea06d9f2f89f deleted file mode 100644 index 05527a96b..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/4b/a292422d6c7ec6a131b5f5a1f0ea06d9f2f89f and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/79/ddb52da618193caba8398b95c8716336fed3bf b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/79/ddb52da618193caba8398b95c8716336fed3bf deleted file mode 100644 index 11a4d8f32..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/79/ddb52da618193caba8398b95c8716336fed3bf and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/82/e23d74b60ecc30d44a9daeaa1d8fbdc085f1b9 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/82/e23d74b60ecc30d44a9daeaa1d8fbdc085f1b9 deleted file mode 100644 index dddfc806f..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/82/e23d74b60ecc30d44a9daeaa1d8fbdc085f1b9 +++ /dev/null @@ -1 +0,0 @@ -xKÊÉOR0µ`¨æRPPJÎÏÍÍ,Q²RPJ4K4M2LI4752“ ,ÍSSÌ“ ’““’-’Í ’R“M•¸joϬ \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/8c/2ab69b920fc55e0ee2cb8be5ed301357891270 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/8c/2ab69b920fc55e0ee2cb8be5ed301357891270 deleted file mode 100644 index f8218bec3..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/8c/2ab69b920fc55e0ee2cb8be5ed301357891270 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/93/870fdc2da4b2477fafe25b4d134d98a825c50b b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/93/870fdc2da4b2477fafe25b4d134d98a825c50b deleted file mode 100644 index 227db66a6..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/93/870fdc2da4b2477fafe25b4d134d98a825c50b and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/98/d1316a4b38a0dd3c6717c2f0c502953c845241 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/98/d1316a4b38a0dd3c6717c2f0c502953c845241 deleted file mode 100644 index e1cbba3e6..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/98/d1316a4b38a0dd3c6717c2f0c502953c845241 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/9e/a4ef9467d9a4df528fbdbea1ff9de930341fd1 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/9e/a4ef9467d9a4df528fbdbea1ff9de930341fd1 deleted file mode 100644 index c6df09b89..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/9e/a4ef9467d9a4df528fbdbea1ff9de930341fd1 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/a7/205d080f9d23c429fa1a06a4d453cd9090b5a9 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/a7/205d080f9d23c429fa1a06a4d453cd9090b5a9 deleted file mode 100644 index 1cbc2445b..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/a7/205d080f9d23c429fa1a06a4d453cd9090b5a9 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/ae/1f9d26062deb5a2d6705e86177d4f8ce7b5ed7 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/ae/1f9d26062deb5a2d6705e86177d4f8ce7b5ed7 deleted file mode 100644 index cb78279de..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/ae/1f9d26062deb5a2d6705e86177d4f8ce7b5ed7 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/b8/08bdbe1d2c2e6e3ca87c07d2a5c8307e1236bb b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/b8/08bdbe1d2c2e6e3ca87c07d2a5c8307e1236bb deleted file mode 100644 index 6f8e4c4f7..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/b8/08bdbe1d2c2e6e3ca87c07d2a5c8307e1236bb and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/be/e8c158247f2a2c1997e942bfa43c89d39cfce8 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/be/e8c158247f2a2c1997e942bfa43c89d39cfce8 deleted file mode 100644 index 256eb5cef..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/be/e8c158247f2a2c1997e942bfa43c89d39cfce8 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/bf/598302a34385340091164bc268edacfe9c46ce b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/bf/598302a34385340091164bc268edacfe9c46ce deleted file mode 100644 index f3d1d017a..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/bf/598302a34385340091164bc268edacfe9c46ce and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c4/1644e32c178e3ec2bd580a7fe96344a0e99361 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c4/1644e32c178e3ec2bd580a7fe96344a0e99361 deleted file mode 100644 index 1a60a436e..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c4/1644e32c178e3ec2bd580a7fe96344a0e99361 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c6/33684a64836f5eea10d5dcbaf8955d7856ce22 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c6/33684a64836f5eea10d5dcbaf8955d7856ce22 deleted file mode 100644 index 127466e64..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c6/33684a64836f5eea10d5dcbaf8955d7856ce22 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c9/be60d5ea58505c155febd907eaf989004448ed b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c9/be60d5ea58505c155febd907eaf989004448ed deleted file mode 100644 index 5b8393c71..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/c9/be60d5ea58505c155febd907eaf989004448ed and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/de/74ff474d554dac612607a72994ff713071723b b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/de/74ff474d554dac612607a72994ff713071723b deleted file mode 100644 index a590ccb65..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/de/74ff474d554dac612607a72994ff713071723b and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/de/cfbcdc81968441fb44d88bd07abcb2e5a79eb6 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/de/cfbcdc81968441fb44d88bd07abcb2e5a79eb6 deleted file mode 100644 index 0123c9b8e..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/de/cfbcdc81968441fb44d88bd07abcb2e5a79eb6 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/e2/7a8c91851cd3ffb9954990bba545c1a4521859 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/e2/7a8c91851cd3ffb9954990bba545c1a4521859 deleted file mode 100644 index 706f27a0a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/e2/7a8c91851cd3ffb9954990bba545c1a4521859 +++ /dev/null @@ -1 +0,0 @@ -xKÊÉOR0µ`¨æRPPJÎÏÍÍ,Q²RP25MM5O61HNM16J5K4LòŒÍ“Œ RÍM“L “Í’ŒS•¸jlH† \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/ef/6dd47ab7bf5f5ca1d276918d0f4d10c02d6d9b b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/ef/6dd47ab7bf5f5ca1d276918d0f4d10c02d6d9b deleted file mode 100644 index 10e7e9617..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/ef/6dd47ab7bf5f5ca1d276918d0f4d10c02d6d9b and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/fc/adb2cf97913f58a2523f535336e725c6b59d1f b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/fc/adb2cf97913f58a2523f535336e725c6b59d1f deleted file mode 100644 index 48890ab7f..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/objects/fc/adb2cf97913f58a2523f535336e725c6b59d1f and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/refs/heads/master deleted file mode 100644 index 0e3bda362..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -1bf75a61c6bb7bba163d6ec6644a09ec0532176d diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/1.root.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/1.root.json deleted file mode 100644 index bf598302a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/1.root.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "signatures": [ - { - "keyid": "40ecbcb2cd365c3245202ddc4e0c73087f1c0edf9f2de59d3915c07b65b67668", - "sig": "bb4db9ab64eea450fa0b062258ed61ade9102260b1cc5079e6e8472723f8f7816c1a415a6cead1e4f80c707a9c3c2908a1b0f68d8018b23b16acbadc52bbf75e1753fd568f00c0911751e89fe4fcc4a7aa0aac8f60bca6a2ae522624392b3c0d82d0593760194a2736bec1c1d4305245014564898be4a1de9dc951e5b8c5c6eed5b840775d442a4c4b8112ab566b3d38b59d3e5d7a18824861da06567f9f3c5ade5f7a25eba6e6118f3a24f83cd0803c219bf4db112fb337e9952abf54a48c4a50d0aeaa966b3fd9414fc3d8287ed9033cd65f4c78ebe0b16b881f387ac184d7e40b5e610e757827a6951b62b72617a3ed5462b9b82a596b11b16aa0d0b673d3" - }, - { - "keyid": "ab15675f9b3006aab621ac23e197709e8c289f79633e5dd798b5e5e2b3b19f50", - "sig": "a154d6ede90799084ec3ddd21a0bda357e263fcaf1b92a03df19db886f424713ae67581bf20d3856bb0321cacfe6f5c9f45162d5baaa466d467f3de2d68ce2dc3c1c8bfa3e785d6824f3a4a84943a9d6aca5c51c808ec3c0cb3690b11528cafd4762f3f2622abf819e2c4963d2337cfdbc2aeb44b9f9febaadb33361133bfd6687f855e466037a1afb61ee3379674e3a7dbe13559b5b4bd15cd6adb62fe8727a38842ed719eb154031fefda10e4663d42e70915482d0c4d7280d467e74cf239773093d6b356e1243aa3dc37b36ec36b0205eae1baaa0c584de7ba7cfc1697357f4396a62c3bb1933e887435e37c38c80b7e88b2881f9b11a8245befa25289e73" - }, - { - "keyid": "863325ec38f08293ffca7ba3671b3d45d6eab194351664ed5da0d92ace99af91", - "sig": "935b005cd81aca8e33441fd3e0f596e5bad77472e4f12f7451b6f63cdff70007f69be635eccd82cfc5dab1bfe1fe0b6af8f5453873ec42dbda03b71224a1c18a0f611e789068e8c4b0dcb9beda0db9dd9d7d1003a7bd222872ce72447fcc59b537131910ee7060ab5ce5e36bd07fc2384942c8aeb378bd6138ede0cf77e428dcad744a5a95e29482f2aaa12416489d1f1d707cca199db78392f1cbd27e60b127e55d3ca8ae24f79048b9c228cbd1e1b518238c0f5b305c49667dc2afd4c88a6e1be1bece1dcc1676c62c9b06efaaf2f63632195d69b66e657d50e393cdc36b7b9653822fa91ffca7653870205d9c31b561941cefc241b07d3a5a1031fee5389d" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2020-05-29T21:59:34Z", - "keys": { - "40ecbcb2cd365c3245202ddc4e0c73087f1c0edf9f2de59d3915c07b65b67668": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA552O9PX6L8snG/nZdZAe\nuFgIUk8uJihwCJi8Wk2n2kb4+80mMfOItJHcngpcyuPyoUKUAEj5XkK5b+nbGA67\nXa9BcCEGzw1dS0RSkJsL2iStgeprJxmnb0tOYkgjFB3p0agvyVvOCfNWkg4BxnX9\nJqiGRVJkTugkzExZRqop7miJsj1m6YEpbSmfRdWjTz1AuSsVCsXjkS9b1BIgQBZs\nj8x1o98pozmSBsmnc9TsruSUNQX67ZCNFNAhPGKksqQA9L7WAYSN5CP39T7yJE1U\nCByB/qFwGuxrqofmzpsbDg70aGP/UK+0uaqI5Pfwq+rtxCyNr/gOO6UsXATcDxGD\nZQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "589a4f5fdf7a289071726f4981da0ca0743faceacea60bd1608d3c61f376f4ec": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtWRrSKtnvbgwzS7VuBVR\nqiYac4pIREIakkofd+NtMYiMtNlV6Dh1KX327Fa2HxFZKr+krcdi0zTVo1tURNME\n61QEVwMNANpDv1mYuBmdDpm/fXViFi32Yw3OQB3Auw9vFLx3VkVdltrtmGHs1Sg4\ngtdVWsFcGDv1D4N3z3m/fCef39OlhVfOmwe3nJJsvZAlBJINa34PvXnkrZ3r+YCD\nb0RNHyJYdAdt/dcpwq+h83NwfHA4bDegjoA7k3B00YPqaQECD5U+thqqF+uaMoVZ\nnCcdtMDQQ0EoqKG+N+cp8+ivdESqtUVuUUaD3gBVtDolByuNW/7/uBG4fRE1Jph9\nHwIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "863325ec38f08293ffca7ba3671b3d45d6eab194351664ed5da0d92ace99af91": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5EGVh9xqVFFHnGGIofks\ncA3vHWFs1QP60QTX+ZJUPiUJdDb8wuJ6mu9d8bKojE3SEVHCLpJeV4+muMnLtZWq\nAipiuFUU9QDpOYaqQ5SD5n/9sZfiWDzjVsqZA4WMj0OCd/Bkn+umz3ljHFe0EJUE\nCxYRvmArC05UyJej7fCaQ/cD7QELrpmBaE2qLcG0Vfirz9NekaXixGiKNiIjHAj6\nYwIfES9SycVo42LEOskGFciqgfZJVtSaTIurW+KnOToStazEWY8okon91s+5ltIN\nOS68TtBLtph5PXcLhqSozE8SqMW3gZni6zXHHQtuouFLdGkgw+0V2YLX15Ka78zj\nhQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "ab15675f9b3006aab621ac23e197709e8c289f79633e5dd798b5e5e2b3b19f50": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvkrFf48hTimH2vfqgD5d\ntB5tRFQnZaat5wSmczTgz01wzl/T0/nL6rxnSw4yACnyUcJyxTP8bzLm3aJz63el\nIm91ef65/OVPBbXowoDB/u70lhn8mvT5LTWs9yBKOPQG92cHt2UwcGgPhWwA0wVn\nu1TFtca5hONGNNkpd/bNnbCCfw1awvYXF+FD7WCnzhvq/mZwgklN5ZHNZJp0KBuD\nXi3walJ/0nffvjVSCcTAYMHPLd8SKF+N9yjSDerJ+opk6/8+TnihgXdcCyvh9O+/\nNhVF1BWh+Hv++Ery63tl7N793MSUbJqXsX3Mmf1v7h+8uDRHWwVtN5VHy9XNmysm\nIwIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "cf70c2c4ac749948ca495f9275ceb8525cfb7c463118b54ca5be844ca5cfc0d6": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwv8CwlU44Y6ERLZI4OYb\nOKL7YgdJzwgDHBBqVw0IOwEvPrK52YJgIUlgkX/POqb3qQnOkwQza5ZZgn2akn3g\nI6Zs9ZCV0t7ZNLX955Uzoul0WfA+EFUA1VI5ujMBH8E9YOKiokCa6rFxgY+9RTrH\nPuIZTySLOTN8je9E9DsdKOkXQXtUvoZlOqM8AbKcywR1CVSKAqmXNkf55txhdXg7\nNoDoK4T1w7Qxfed9Wgruch/12b5cvY6VsQKGOPZ+HbQBN5+wXopezyPBUj1k7qjn\nF+i9FBjKHM62G4mQ3s1iAs7qg6xCjQP4pW3Q6gN5i0iStgmHy1FoynouVtQAc++N\n/QIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "d36f105af5bdb063d1005ee254e7e236b8dc116097a6dd78a22111b1d429533f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwN5AWXl26xlAy+Mii9tA\nwXobOP+zUsoqwNKZu355MCzpMRzHqhWe07iDPyeC+ewbSmeWvpIEOwCWh2DyHsFy\nV7FsDHJiiuFHZcAbxTu1zVBf2FwNcQNfNXUr3ShmcyFZrKq6ZaaslD0mhSqdFwVe\nnEke0ufF9yroV4U3IC00KaMOxDT0EH3q1S8SbNtNh4VIQaSwn5CaNpIXek080oQR\nkXLxJivHJfHIq0iFmXdjNr6TXYNygCBGf2nE0R3X+bVt7xF8/dbanfWn+Z04+ZKs\naTaMuOEGLgfchv33neLcCBKp+fKojEcEpVE6g18KPt2So+s3hSHODzP3V3oUYo8E\nlQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "863325ec38f08293ffca7ba3671b3d45d6eab194351664ed5da0d92ace99af91", - "40ecbcb2cd365c3245202ddc4e0c73087f1c0edf9f2de59d3915c07b65b67668", - "ab15675f9b3006aab621ac23e197709e8c289f79633e5dd798b5e5e2b3b19f50" - ], - "threshold": 2 - }, - "snapshot": { - "keyids": [ - "589a4f5fdf7a289071726f4981da0ca0743faceacea60bd1608d3c61f376f4ec" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "d36f105af5bdb063d1005ee254e7e236b8dc116097a6dd78a22111b1d429533f" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "cf70c2c4ac749948ca495f9275ceb8525cfb7c463118b54ca5be844ca5cfc0d6" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/root.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/root.json deleted file mode 100644 index bf598302a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/root.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "signatures": [ - { - "keyid": "40ecbcb2cd365c3245202ddc4e0c73087f1c0edf9f2de59d3915c07b65b67668", - "sig": "bb4db9ab64eea450fa0b062258ed61ade9102260b1cc5079e6e8472723f8f7816c1a415a6cead1e4f80c707a9c3c2908a1b0f68d8018b23b16acbadc52bbf75e1753fd568f00c0911751e89fe4fcc4a7aa0aac8f60bca6a2ae522624392b3c0d82d0593760194a2736bec1c1d4305245014564898be4a1de9dc951e5b8c5c6eed5b840775d442a4c4b8112ab566b3d38b59d3e5d7a18824861da06567f9f3c5ade5f7a25eba6e6118f3a24f83cd0803c219bf4db112fb337e9952abf54a48c4a50d0aeaa966b3fd9414fc3d8287ed9033cd65f4c78ebe0b16b881f387ac184d7e40b5e610e757827a6951b62b72617a3ed5462b9b82a596b11b16aa0d0b673d3" - }, - { - "keyid": "ab15675f9b3006aab621ac23e197709e8c289f79633e5dd798b5e5e2b3b19f50", - "sig": "a154d6ede90799084ec3ddd21a0bda357e263fcaf1b92a03df19db886f424713ae67581bf20d3856bb0321cacfe6f5c9f45162d5baaa466d467f3de2d68ce2dc3c1c8bfa3e785d6824f3a4a84943a9d6aca5c51c808ec3c0cb3690b11528cafd4762f3f2622abf819e2c4963d2337cfdbc2aeb44b9f9febaadb33361133bfd6687f855e466037a1afb61ee3379674e3a7dbe13559b5b4bd15cd6adb62fe8727a38842ed719eb154031fefda10e4663d42e70915482d0c4d7280d467e74cf239773093d6b356e1243aa3dc37b36ec36b0205eae1baaa0c584de7ba7cfc1697357f4396a62c3bb1933e887435e37c38c80b7e88b2881f9b11a8245befa25289e73" - }, - { - "keyid": "863325ec38f08293ffca7ba3671b3d45d6eab194351664ed5da0d92ace99af91", - "sig": "935b005cd81aca8e33441fd3e0f596e5bad77472e4f12f7451b6f63cdff70007f69be635eccd82cfc5dab1bfe1fe0b6af8f5453873ec42dbda03b71224a1c18a0f611e789068e8c4b0dcb9beda0db9dd9d7d1003a7bd222872ce72447fcc59b537131910ee7060ab5ce5e36bd07fc2384942c8aeb378bd6138ede0cf77e428dcad744a5a95e29482f2aaa12416489d1f1d707cca199db78392f1cbd27e60b127e55d3ca8ae24f79048b9c228cbd1e1b518238c0f5b305c49667dc2afd4c88a6e1be1bece1dcc1676c62c9b06efaaf2f63632195d69b66e657d50e393cdc36b7b9653822fa91ffca7653870205d9c31b561941cefc241b07d3a5a1031fee5389d" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2020-05-29T21:59:34Z", - "keys": { - "40ecbcb2cd365c3245202ddc4e0c73087f1c0edf9f2de59d3915c07b65b67668": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA552O9PX6L8snG/nZdZAe\nuFgIUk8uJihwCJi8Wk2n2kb4+80mMfOItJHcngpcyuPyoUKUAEj5XkK5b+nbGA67\nXa9BcCEGzw1dS0RSkJsL2iStgeprJxmnb0tOYkgjFB3p0agvyVvOCfNWkg4BxnX9\nJqiGRVJkTugkzExZRqop7miJsj1m6YEpbSmfRdWjTz1AuSsVCsXjkS9b1BIgQBZs\nj8x1o98pozmSBsmnc9TsruSUNQX67ZCNFNAhPGKksqQA9L7WAYSN5CP39T7yJE1U\nCByB/qFwGuxrqofmzpsbDg70aGP/UK+0uaqI5Pfwq+rtxCyNr/gOO6UsXATcDxGD\nZQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "589a4f5fdf7a289071726f4981da0ca0743faceacea60bd1608d3c61f376f4ec": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtWRrSKtnvbgwzS7VuBVR\nqiYac4pIREIakkofd+NtMYiMtNlV6Dh1KX327Fa2HxFZKr+krcdi0zTVo1tURNME\n61QEVwMNANpDv1mYuBmdDpm/fXViFi32Yw3OQB3Auw9vFLx3VkVdltrtmGHs1Sg4\ngtdVWsFcGDv1D4N3z3m/fCef39OlhVfOmwe3nJJsvZAlBJINa34PvXnkrZ3r+YCD\nb0RNHyJYdAdt/dcpwq+h83NwfHA4bDegjoA7k3B00YPqaQECD5U+thqqF+uaMoVZ\nnCcdtMDQQ0EoqKG+N+cp8+ivdESqtUVuUUaD3gBVtDolByuNW/7/uBG4fRE1Jph9\nHwIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "863325ec38f08293ffca7ba3671b3d45d6eab194351664ed5da0d92ace99af91": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5EGVh9xqVFFHnGGIofks\ncA3vHWFs1QP60QTX+ZJUPiUJdDb8wuJ6mu9d8bKojE3SEVHCLpJeV4+muMnLtZWq\nAipiuFUU9QDpOYaqQ5SD5n/9sZfiWDzjVsqZA4WMj0OCd/Bkn+umz3ljHFe0EJUE\nCxYRvmArC05UyJej7fCaQ/cD7QELrpmBaE2qLcG0Vfirz9NekaXixGiKNiIjHAj6\nYwIfES9SycVo42LEOskGFciqgfZJVtSaTIurW+KnOToStazEWY8okon91s+5ltIN\nOS68TtBLtph5PXcLhqSozE8SqMW3gZni6zXHHQtuouFLdGkgw+0V2YLX15Ka78zj\nhQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "ab15675f9b3006aab621ac23e197709e8c289f79633e5dd798b5e5e2b3b19f50": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvkrFf48hTimH2vfqgD5d\ntB5tRFQnZaat5wSmczTgz01wzl/T0/nL6rxnSw4yACnyUcJyxTP8bzLm3aJz63el\nIm91ef65/OVPBbXowoDB/u70lhn8mvT5LTWs9yBKOPQG92cHt2UwcGgPhWwA0wVn\nu1TFtca5hONGNNkpd/bNnbCCfw1awvYXF+FD7WCnzhvq/mZwgklN5ZHNZJp0KBuD\nXi3walJ/0nffvjVSCcTAYMHPLd8SKF+N9yjSDerJ+opk6/8+TnihgXdcCyvh9O+/\nNhVF1BWh+Hv++Ery63tl7N793MSUbJqXsX3Mmf1v7h+8uDRHWwVtN5VHy9XNmysm\nIwIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "cf70c2c4ac749948ca495f9275ceb8525cfb7c463118b54ca5be844ca5cfc0d6": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwv8CwlU44Y6ERLZI4OYb\nOKL7YgdJzwgDHBBqVw0IOwEvPrK52YJgIUlgkX/POqb3qQnOkwQza5ZZgn2akn3g\nI6Zs9ZCV0t7ZNLX955Uzoul0WfA+EFUA1VI5ujMBH8E9YOKiokCa6rFxgY+9RTrH\nPuIZTySLOTN8je9E9DsdKOkXQXtUvoZlOqM8AbKcywR1CVSKAqmXNkf55txhdXg7\nNoDoK4T1w7Qxfed9Wgruch/12b5cvY6VsQKGOPZ+HbQBN5+wXopezyPBUj1k7qjn\nF+i9FBjKHM62G4mQ3s1iAs7qg6xCjQP4pW3Q6gN5i0iStgmHy1FoynouVtQAc++N\n/QIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - }, - "d36f105af5bdb063d1005ee254e7e236b8dc116097a6dd78a22111b1d429533f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "rsa", - "keyval": { - "public": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwN5AWXl26xlAy+Mii9tA\nwXobOP+zUsoqwNKZu355MCzpMRzHqhWe07iDPyeC+ewbSmeWvpIEOwCWh2DyHsFy\nV7FsDHJiiuFHZcAbxTu1zVBf2FwNcQNfNXUr3ShmcyFZrKq6ZaaslD0mhSqdFwVe\nnEke0ufF9yroV4U3IC00KaMOxDT0EH3q1S8SbNtNh4VIQaSwn5CaNpIXek080oQR\nkXLxJivHJfHIq0iFmXdjNr6TXYNygCBGf2nE0R3X+bVt7xF8/dbanfWn+Z04+ZKs\naTaMuOEGLgfchv33neLcCBKp+fKojEcEpVE6g18KPt2So+s3hSHODzP3V3oUYo8E\nlQIDAQAB\n-----END PUBLIC KEY-----" - }, - "scheme": "rsassa-pss-sha256" - } - }, - "roles": { - "root": { - "keyids": [ - "863325ec38f08293ffca7ba3671b3d45d6eab194351664ed5da0d92ace99af91", - "40ecbcb2cd365c3245202ddc4e0c73087f1c0edf9f2de59d3915c07b65b67668", - "ab15675f9b3006aab621ac23e197709e8c289f79633e5dd798b5e5e2b3b19f50" - ], - "threshold": 2 - }, - "snapshot": { - "keyids": [ - "589a4f5fdf7a289071726f4981da0ca0743faceacea60bd1608d3c61f376f4ec" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "d36f105af5bdb063d1005ee254e7e236b8dc116097a6dd78a22111b1d429533f" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "cf70c2c4ac749948ca495f9275ceb8525cfb7c463118b54ca5be844ca5cfc0d6" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 1 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/snapshot.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/snapshot.json deleted file mode 100644 index ae1f9d260..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/snapshot.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "signatures": [ - { - "keyid": "589a4f5fdf7a289071726f4981da0ca0743faceacea60bd1608d3c61f376f4ec", - "sig": "730886f91b16b002a8a8cea5e85cd75e5ff5c5a3f59083f6237caaf8762a5e47cb207e4116355d8982dc1c424ce93ccf6ec062cf3e19b504c4ef21f2aff051386a8f2c06bc537f33bb463150e3143b187f161dc474677f070700214c5e222865383723c3dedf42b8e1b79204492075e2d5b123e5a5e19d0efea78844f5a1ea848196d60c593a954061ce5f158a44a44c1dc79aebbb7afc041d63532fcf90a6f1eeca109202a79ed4f305090e1603d7ab76f4a654d5641a13d0ec3c973a628b2bad0f5fd1f700223e6be1e6790d5bee90a1630ef9daf58adccfcec90c3eb26910727bd8da87e3ee629ac1091f33cd19256384cbb327877f35277ebd8431810842" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2019-06-06T16:11:14Z", - "meta": { - "root.json": { - "version": 1 - }, - "targets.json": { - "version": 3 - } - }, - "spec_version": "1.0", - "version": 3 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/targets.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/targets.json deleted file mode 100644 index 20d13434d..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/targets.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "signatures": [ - { - "keyid": "d36f105af5bdb063d1005ee254e7e236b8dc116097a6dd78a22111b1d429533f", - "sig": "09c46030effaf197264fec521528956f928e8e59ad134a010925b1bc53f2ed0187f71130f9917545c6484a1865ead5f18212c026f170c0e54400b9440c89af9b894f8f6708eeb446678ff6a4228857360ce618b63cc59d13212101a075e3fee880c5bc8dbf6dddbbdc52866b81e99a1def28ec27228e8b5e675643f31997528cfaf593bb51e37adf63f56f349579fb48eac2268f6215954cd8c576fa7cb176e844148492615db2dd87a1195ce6eb95cf0bee8209a14e5062140c69e2110f15947c91ba69c150510b9b772fb6af26865c57fed1a0a6263b992587c5f496cb575e62f3f3a0b9b861ac19ef16f235eb9ec747c1400387682974262239753b371547" - } - ], - "signed": { - "_type": "targets", - "delegations": { - "keys": {}, - "roles": [] - }, - "expires": "2019-08-29T23:38:24Z", - "spec_version": "1.0", - "targets": { - "branch": { - "hashes": { - "sha256": "943317cf1551484e5e44c9c32a030635977c85c6a2a04ff1aed0f66f99f25fdd", - "sha512": "1b5ad51243cd140fee1d8b32eca468672145f3021315b90ac4e431a2a64bf44d4f296fd078a6681fb9318c851f65bf703457bd66299f1bbbcbc321e74591302c" - }, - "length": 36 - }, - "dummy/target_dummy_repo": { - "hashes": { - "sha256": "6742aac70c1c50e3143aaf4609d6e16d8b8a0ba405fe8dde281de3330eea4cfd", - "sha512": "1ef9643a899417b524840dad09da24a8ea3c0ad83006c12a26c2254b5f0d4b9d5f6bfb8ea111f34f862576e43aeb69cd2ceb2be5e91e7651cddbf1d28d1ab52c" - }, - "length": 58 - }, - "repositories.json": { - "hashes": { - "sha256": "ad9439bbc093303dccbf3fd2ff8595c775ecbe8cf39e4db283d17ec1cfbe6ad1", - "sha512": "35c8f4cd1ad7650ab62485dbb1d1255ee015f8d495f24e3ea871158538f0386a6fec5a433f5a5e4ed8e794af74ca9824b7e0402a8497740380ad94fa9a6b4a97" - }, - "length": 212 - } - }, - "version": 3 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/timestamp.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/timestamp.json deleted file mode 100644 index 79ddb52da..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/metadata/timestamp.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "signatures": [ - { - "keyid": "cf70c2c4ac749948ca495f9275ceb8525cfb7c463118b54ca5be844ca5cfc0d6", - "sig": "5fca52fd1753912935c4ec07725b848bc75a24c5e7e2ced0774382cb716bb85b8ec4f1425b534e35e38bbccf23d8eea6e5d4666a7d72e0665d154f9ee603880b0d97670fb6c2b317ba50d535c499734ce54f3a3040f30d749de656aea9929d661da8003275864123a0164ad4d607049423977da9d5001c5a68b801604866193bb65b4270feea602cca3637aeb6d56b23247369208e083af4f7317bb7f0378e4e216bb5773cfffe3d766bb60027944447a7b8b9ed77ef08764cf2b1669cf226ce86a81849918624e00b1741c06c2330dcf91e82145de79c0218a5249ed62a582b2f14f4593ca8d64b2bc3f007ec8170e6f3767f75e88be7ed5899db58f1263a8a" - } - ], - "signed": { - "_type": "timestamp", - "expires": "2019-05-31T16:11:14Z", - "meta": { - "snapshot.json": { - "hashes": { - "sha256": "e02a47e91633293d68a5555b18e0baa3e5a66a1747c96a5428a50533b08fd88f" - }, - "length": 854, - "version": 3 - } - }, - "spec_version": "1.0", - "version": 3 - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/branch b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/branch deleted file mode 100644 index c633684a6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/branch +++ /dev/null @@ -1 +0,0 @@ -14e81cd1-0050-43aa-9e2c-e34fffa6f517 \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/dummy/target_dummy_repo b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/dummy/target_dummy_repo deleted file mode 100644 index 82e23d74b..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/dummy/target_dummy_repo +++ /dev/null @@ -1,3 +0,0 @@ -{ - "commit": "a6a5b1da755a6ab097ed7c00ccbc8c3a3612bec5" -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/repositories.json b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/repositories.json deleted file mode 100644 index 45a8125ed..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/taf/targets/repositories.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "repositories": { - "dummy/target_dummy_repo": { - "custom": { - "type": "dummy" - }, - "urls": [ - "../../target_dummy_repo", - "..\\..\\target_dummy_repo" - ] - } - } -} \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/COMMIT_EDITMSG deleted file mode 100644 index 10aede5d3..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Add test2 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/HEAD b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/config b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/config deleted file mode 100644 index 6c9406b7d..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/config +++ /dev/null @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/description b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index e673bb398..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/post-update.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-commit.sample deleted file mode 100644 index 6a7564163..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/update.sample b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/update.sample deleted file mode 100644 index 80ba94135..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/index b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/index deleted file mode 100644 index e950647b7..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/info/exclude b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/logs/HEAD b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/logs/HEAD deleted file mode 100644 index 34798ddc8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/logs/HEAD +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 55ee7c40ced32e6a1dee7237b20ea74ab51c6b3e Daniel Elero 1559143959 +0200 commit (initial): Initial commit -55ee7c40ced32e6a1dee7237b20ea74ab51c6b3e a6a5b1da755a6ab097ed7c00ccbc8c3a3612bec5 Daniel Elero 1559143997 +0200 commit: Add test2 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/logs/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/logs/refs/heads/master deleted file mode 100644 index 34798ddc8..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/logs/refs/heads/master +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 55ee7c40ced32e6a1dee7237b20ea74ab51c6b3e Daniel Elero 1559143959 +0200 commit (initial): Initial commit -55ee7c40ced32e6a1dee7237b20ea74ab51c6b3e a6a5b1da755a6ab097ed7c00ccbc8c3a3612bec5 Daniel Elero 1559143997 +0200 commit: Add test2 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/1f/47af1ac51bf2390e177d6e6bd714addf149b3e b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/1f/47af1ac51bf2390e177d6e6bd714addf149b3e deleted file mode 100644 index 21985fb4e..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/1f/47af1ac51bf2390e177d6e6bd714addf149b3e and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/36/436eb4d9e6be5ca8204436e07072fb1a091a01 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/36/436eb4d9e6be5ca8204436e07072fb1a091a01 deleted file mode 100644 index 1650257d1..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/36/436eb4d9e6be5ca8204436e07072fb1a091a01 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/55/ee7c40ced32e6a1dee7237b20ea74ab51c6b3e b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/55/ee7c40ced32e6a1dee7237b20ea74ab51c6b3e deleted file mode 100644 index d694e71ab..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/55/ee7c40ced32e6a1dee7237b20ea74ab51c6b3e and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/99/38e26356fe5d40f990e1681c3afd7e7f8ea9d0 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/99/38e26356fe5d40f990e1681c3afd7e7f8ea9d0 deleted file mode 100644 index 9522b5cee..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/99/38e26356fe5d40f990e1681c3afd7e7f8ea9d0 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/a6/a5b1da755a6ab097ed7c00ccbc8c3a3612bec5 b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/a6/a5b1da755a6ab097ed7c00ccbc8c3a3612bec5 deleted file mode 100644 index 29e1e3ea6..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/a6/a5b1da755a6ab097ed7c00ccbc8c3a3612bec5 and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/f3/2fb63a14948ee07e93609642b353ba9e9db9ac b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/f3/2fb63a14948ee07e93609642b353ba9e9db9ac deleted file mode 100644 index aed44e154..000000000 Binary files a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/objects/f3/2fb63a14948ee07e93609642b353ba9e9db9ac and /dev/null differ diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/refs/heads/master b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/refs/heads/master deleted file mode 100644 index 545ae4ae0..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -a6a5b1da755a6ab097ed7c00ccbc8c3a3612bec5 diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/test.xml b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/test.xml deleted file mode 100644 index 36436eb4d..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/test.xml +++ /dev/null @@ -1,2 +0,0 @@ - -Test diff --git a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/test2.xml b/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/test2.xml deleted file mode 100644 index 9938e2635..000000000 --- a/taf/tests/data/repos/test-repository-tool/test-happy-path-pss/target_dummy_repo/test2.xml +++ /dev/null @@ -1,2 +0,0 @@ - -Test2 diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/COMMIT_EDITMSG deleted file mode 100644 index 524acfffa..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Test file diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/HEAD b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/HEAD deleted file mode 100644 index b870d8262..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/main diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/config b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/config deleted file mode 100644 index d545cdabd..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/config +++ /dev/null @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - symlinks = false - ignorecase = true diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/description b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index 14ed0aa42..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,173 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 2) and last update token -# formatted as a string and outputs to stdout a new update token and -# all files that have been modified since the update token. Paths must -# be relative to the root of the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $last_update_token) = @ARGV; - -# Uncomment for debugging -# print STDERR "$0 $version $last_update_token\n"; - -# Check the hook interface version -if ($version ne 2) { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree = get_working_dir(); - -my $retry = 1; - -my $json_pkg; -eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; -} or do { - require JSON::PP; - $json_pkg = "JSON::PP"; -}; - -launch_watchman(); - -sub launch_watchman { - my $o = watchman_query(); - if (is_work_tree_watched($o)) { - output_result($o->{clock}, @{$o->{files}}); - } -} - -sub output_result { - my ($clockid, @files) = @_; - - # Uncomment for debugging watchman output - # open (my $fh, ">", ".git/watchman-output.out"); - # binmode $fh, ":utf8"; - # print $fh "$clockid\n@files\n"; - # close $fh; - - binmode STDOUT, ":utf8"; - print $clockid; - print "\0"; - local $, = "\0"; - print @files; -} - -sub watchman_clock { - my $response = qx/watchman clock "$git_work_tree"/; - die "Failed to get clock id on '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - return $json_pkg->new->utf8->decode($response); -} - -sub watchman_query { - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $last_update_token but not from the .git folder. - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - if (substr($last_update_token, 0, 1) eq "c") { - $last_update_token = "\"$last_update_token\""; - } - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $last_update_token, - "fields": ["name"], - "expression": ["not", ["dirname", ".git"]] - }] - END - - # Uncomment for debugging the watchman query - # open (my $fh, ">", ".git/watchman-query.json"); - # print $fh $query; - # close $fh; - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - # Uncomment for debugging the watch response - # open ($fh, ">", ".git/watchman-response.json"); - # print $fh $response; - # close $fh; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - return $json_pkg->new->utf8->decode($response); -} - -sub is_work_tree_watched { - my ($output) = @_; - my $error = $output->{error}; - if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { - $retry--; - my $response = qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - $output = $json_pkg->new->utf8->decode($response); - $error = $output->{error}; - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - # Uncomment for debugging watchman output - # open (my $fh, ">", ".git/watchman-output.out"); - # close $fh; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - my $o = watchman_clock(); - $error = $output->{error}; - - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - output_result($o->{clock}, ("/")); - $last_update_token = $o->{clock}; - - eval { launch_watchman() }; - return 0; - } - - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - return 1; -} - -sub get_working_dir { - my $working_dir; - if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $working_dir = Win32::GetCwd(); - $working_dir =~ tr/\\/\//; - } else { - require Cwd; - $working_dir = Cwd::cwd(); - } - - return $working_dir; -} diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/post-update.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-commit.sample deleted file mode 100644 index e144712c8..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --type=bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-merge-commit.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-merge-commit.sample deleted file mode 100644 index 399eab192..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-merge-commit.sample +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git merge" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message to -# stderr if it wants to stop the merge commit. -# -# To enable this hook, rename this file to "pre-merge-commit". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" -: diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-push.sample deleted file mode 100644 index 4ce688d32..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/push-to-checkout.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/push-to-checkout.sample deleted file mode 100644 index af5a0c001..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/hooks/push-to-checkout.sample +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# An example hook script to update a checked-out tree on a git push. -# -# This hook is invoked by git-receive-pack(1) when it reacts to git -# push and updates reference(s) in its repository, and when the push -# tries to update the branch that is currently checked out and the -# receive.denyCurrentBranch configuration variable is set to -# updateInstead. -# -# By default, such a push is refused if the working tree and the index -# of the remote repository has any difference from the currently -# checked out commit; when both the working tree and the index match -# the current commit, they are updated to match the newly pushed tip -# of the branch. This hook is to be used to override the default -# behaviour; however the code below reimplements the default behaviour -# as a starting point for convenient modification. -# -# The hook receives the commit with which the tip of the current -# branch is going to be updated: -commit=$1 - -# It can exit with a non-zero status to refuse the push (when it does -# so, it must not modify the index or the working tree). -die () { - echo >&2 "$*" - exit 1 -} - -# Or it can make any necessary changes to the working tree and to the -# index to bring them to the desired state when the tip of the current -# branch is updated to the new commit, and exit with a zero status. -# -# For example, the hook can simply run git read-tree -u -m HEAD "$1" -# in order to emulate git fetch that is run in the reverse direction -# with git push, as the two-tree form of git read-tree -u -m is -# essentially the same as git switch or git checkout that switches -# branches while keeping the local changes in the working tree that do -# not interfere with the difference between the branches. - -# The below is a more-or-less exact translation to shell of the C code -# for the default behaviour for git's push-to-checkout hook defined in -# the push_to_deploy() function in builtin/receive-pack.c. -# -# Note that the hook will be executed from the repository directory, -# not from the working tree, so if you want to perform operations on -# the working tree, you will have to adapt your code accordingly, e.g. -# by adding "cd .." or using relative paths. - -if ! git update-index -q --ignore-submodules --refresh -then - die "Up-to-date check failed" -fi - -if ! git diff-files --quiet --ignore-submodules -- -then - die "Working directory has unstaged changes" -fi - -# This is a rough translation of: -# -# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX -if git cat-file -e HEAD 2>/dev/null -then - head=HEAD -else - head=$(git hash-object -t tree --stdin &2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --type=bool hooks.allowunannotated) -allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) -denycreatebranch=$(git config --type=bool hooks.denycreatebranch) -allowdeletetag=$(git config --type=bool hooks.allowdeletetag) -allowmodifytag=$(git config --type=bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero=$(git hash-object --stdin &2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/index b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/index deleted file mode 100644 index 1952aff6e..000000000 Binary files a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/info/exclude b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/logs/HEAD b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/logs/HEAD deleted file mode 100644 index d22ad6eb6..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/logs/HEAD +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 2e8ca1ac40d39db7f36994be195580c8ee479444 Renata 1692799522 +0200 commit (initial): Test file -2e8ca1ac40d39db7f36994be195580c8ee479444 2e8ca1ac40d39db7f36994be195580c8ee479444 Renata 1692799546 +0200 checkout: moving from master to main diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/logs/refs/heads/main b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/logs/refs/heads/main deleted file mode 100644 index c2d8f9e6a..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/logs/refs/heads/main +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 2e8ca1ac40d39db7f36994be195580c8ee479444 Renata 1692799546 +0200 branch: Created from HEAD diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/13/86f5e9b03766a75fc2cc15163e140cb46be3ec b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/13/86f5e9b03766a75fc2cc15163e140cb46be3ec deleted file mode 100644 index 742c70603..000000000 Binary files a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/13/86f5e9b03766a75fc2cc15163e140cb46be3ec and /dev/null differ diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/28/1f7ade9a4a3b7c4b0aae533bff7a6e31d3c08f b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/28/1f7ade9a4a3b7c4b0aae533bff7a6e31d3c08f deleted file mode 100644 index 4330d1958..000000000 Binary files a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/28/1f7ade9a4a3b7c4b0aae533bff7a6e31d3c08f and /dev/null differ diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/2e/8ca1ac40d39db7f36994be195580c8ee479444 b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/2e/8ca1ac40d39db7f36994be195580c8ee479444 deleted file mode 100644 index 32a1e4ebc..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/objects/2e/8ca1ac40d39db7f36994be195580c8ee479444 +++ /dev/null @@ -1,2 +0,0 @@ -xÍM -Â0@a×9ÅìÉ_›Dzñ“t¢4‘8Õë[<‚Û/¶uÍ ÊÙw"ГJòhÑmˆ4ÒÞG2j1QNIàÆÖáJáÜß;êçö¤ZðSr8µ~¿€½vÞZÃQj)Eü™þ±âF/†” ‰/b9ü \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/packed-refs b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/packed-refs deleted file mode 100644 index 250f18738..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/packed-refs +++ /dev/null @@ -1 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/refs/heads/main b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/refs/heads/main deleted file mode 100644 index 0eca0f9e4..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/git/refs/heads/main +++ /dev/null @@ -1 +0,0 @@ -2e8ca1ac40d39db7f36994be195580c8ee479444 diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/test.txt b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/test.txt deleted file mode 100644 index 1386f5e9b..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-main-branch/test.txt +++ /dev/null @@ -1 +0,0 @@ -Just some random file \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/COMMIT_EDITMSG b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/COMMIT_EDITMSG deleted file mode 100644 index 524acfffa..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Test file diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/HEAD b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/config b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/config deleted file mode 100644 index d545cdabd..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/config +++ /dev/null @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = false - bare = false - logallrefupdates = true - symlinks = false - ignorecase = true diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/description b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/description deleted file mode 100644 index 498b267a8..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/applypatch-msg.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/applypatch-msg.sample deleted file mode 100644 index a5d7b84a6..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/commit-msg.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/fsmonitor-watchman.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/fsmonitor-watchman.sample deleted file mode 100644 index 14ed0aa42..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/fsmonitor-watchman.sample +++ /dev/null @@ -1,173 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 2) and last update token -# formatted as a string and outputs to stdout a new update token and -# all files that have been modified since the update token. Paths must -# be relative to the root of the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $last_update_token) = @ARGV; - -# Uncomment for debugging -# print STDERR "$0 $version $last_update_token\n"; - -# Check the hook interface version -if ($version ne 2) { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree = get_working_dir(); - -my $retry = 1; - -my $json_pkg; -eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; -} or do { - require JSON::PP; - $json_pkg = "JSON::PP"; -}; - -launch_watchman(); - -sub launch_watchman { - my $o = watchman_query(); - if (is_work_tree_watched($o)) { - output_result($o->{clock}, @{$o->{files}}); - } -} - -sub output_result { - my ($clockid, @files) = @_; - - # Uncomment for debugging watchman output - # open (my $fh, ">", ".git/watchman-output.out"); - # binmode $fh, ":utf8"; - # print $fh "$clockid\n@files\n"; - # close $fh; - - binmode STDOUT, ":utf8"; - print $clockid; - print "\0"; - local $, = "\0"; - print @files; -} - -sub watchman_clock { - my $response = qx/watchman clock "$git_work_tree"/; - die "Failed to get clock id on '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - return $json_pkg->new->utf8->decode($response); -} - -sub watchman_query { - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $last_update_token but not from the .git folder. - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - if (substr($last_update_token, 0, 1) eq "c") { - $last_update_token = "\"$last_update_token\""; - } - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $last_update_token, - "fields": ["name"], - "expression": ["not", ["dirname", ".git"]] - }] - END - - # Uncomment for debugging the watchman query - # open (my $fh, ">", ".git/watchman-query.json"); - # print $fh $query; - # close $fh; - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - # Uncomment for debugging the watch response - # open ($fh, ">", ".git/watchman-response.json"); - # print $fh $response; - # close $fh; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - return $json_pkg->new->utf8->decode($response); -} - -sub is_work_tree_watched { - my ($output) = @_; - my $error = $output->{error}; - if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { - $retry--; - my $response = qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - $output = $json_pkg->new->utf8->decode($response); - $error = $output->{error}; - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - # Uncomment for debugging watchman output - # open (my $fh, ">", ".git/watchman-output.out"); - # close $fh; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - my $o = watchman_clock(); - $error = $output->{error}; - - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - output_result($o->{clock}, ("/")); - $last_update_token = $o->{clock}; - - eval { launch_watchman() }; - return 0; - } - - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - return 1; -} - -sub get_working_dir { - my $working_dir; - if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $working_dir = Win32::GetCwd(); - $working_dir =~ tr/\\/\//; - } else { - require Cwd; - $working_dir = Cwd::cwd(); - } - - return $working_dir; -} diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/post-update.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-applypatch.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-applypatch.sample deleted file mode 100644 index 4142082bc..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-commit.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-commit.sample deleted file mode 100644 index e144712c8..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --type=bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-merge-commit.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-merge-commit.sample deleted file mode 100644 index 399eab192..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-merge-commit.sample +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git merge" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message to -# stderr if it wants to stop the merge commit. -# -# To enable this hook, rename this file to "pre-merge-commit". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" -: diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-push.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-push.sample deleted file mode 100644 index 4ce688d32..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-rebase.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-rebase.sample deleted file mode 100644 index 6cbef5c37..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-receive.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-receive.sample deleted file mode 100644 index a1fd29ec1..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/prepare-commit-msg.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index 10fa14c5a..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/push-to-checkout.sample b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/push-to-checkout.sample deleted file mode 100644 index af5a0c001..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/hooks/push-to-checkout.sample +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# An example hook script to update a checked-out tree on a git push. -# -# This hook is invoked by git-receive-pack(1) when it reacts to git -# push and updates reference(s) in its repository, and when the push -# tries to update the branch that is currently checked out and the -# receive.denyCurrentBranch configuration variable is set to -# updateInstead. -# -# By default, such a push is refused if the working tree and the index -# of the remote repository has any difference from the currently -# checked out commit; when both the working tree and the index match -# the current commit, they are updated to match the newly pushed tip -# of the branch. This hook is to be used to override the default -# behaviour; however the code below reimplements the default behaviour -# as a starting point for convenient modification. -# -# The hook receives the commit with which the tip of the current -# branch is going to be updated: -commit=$1 - -# It can exit with a non-zero status to refuse the push (when it does -# so, it must not modify the index or the working tree). -die () { - echo >&2 "$*" - exit 1 -} - -# Or it can make any necessary changes to the working tree and to the -# index to bring them to the desired state when the tip of the current -# branch is updated to the new commit, and exit with a zero status. -# -# For example, the hook can simply run git read-tree -u -m HEAD "$1" -# in order to emulate git fetch that is run in the reverse direction -# with git push, as the two-tree form of git read-tree -u -m is -# essentially the same as git switch or git checkout that switches -# branches while keeping the local changes in the working tree that do -# not interfere with the difference between the branches. - -# The below is a more-or-less exact translation to shell of the C code -# for the default behaviour for git's push-to-checkout hook defined in -# the push_to_deploy() function in builtin/receive-pack.c. -# -# Note that the hook will be executed from the repository directory, -# not from the working tree, so if you want to perform operations on -# the working tree, you will have to adapt your code accordingly, e.g. -# by adding "cd .." or using relative paths. - -if ! git update-index -q --ignore-submodules --refresh -then - die "Up-to-date check failed" -fi - -if ! git diff-files --quiet --ignore-submodules -- -then - die "Working directory has unstaged changes" -fi - -# This is a rough translation of: -# -# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX -if git cat-file -e HEAD 2>/dev/null -then - head=HEAD -else - head=$(git hash-object -t tree --stdin &2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --type=bool hooks.allowunannotated) -allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) -denycreatebranch=$(git config --type=bool hooks.denycreatebranch) -allowdeletetag=$(git config --type=bool hooks.allowdeletetag) -allowmodifytag=$(git config --type=bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero=$(git hash-object --stdin &2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/index b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/index deleted file mode 100644 index 15373e223..000000000 Binary files a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/index and /dev/null differ diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/info/exclude b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/logs/HEAD b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/logs/HEAD deleted file mode 100644 index 1cf58b193..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/logs/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 413ae036dfd0a691258e7d1a779d177cfa184bdc Renata 1692799586 +0200 commit (initial): Test file diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/logs/refs/heads/master b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/logs/refs/heads/master deleted file mode 100644 index 1cf58b193..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 413ae036dfd0a691258e7d1a779d177cfa184bdc Renata 1692799586 +0200 commit (initial): Test file diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/13/86f5e9b03766a75fc2cc15163e140cb46be3ec b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/13/86f5e9b03766a75fc2cc15163e140cb46be3ec deleted file mode 100644 index 742c70603..000000000 Binary files a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/13/86f5e9b03766a75fc2cc15163e140cb46be3ec and /dev/null differ diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/28/1f7ade9a4a3b7c4b0aae533bff7a6e31d3c08f b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/28/1f7ade9a4a3b7c4b0aae533bff7a6e31d3c08f deleted file mode 100644 index 4330d1958..000000000 Binary files a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/28/1f7ade9a4a3b7c4b0aae533bff7a6e31d3c08f and /dev/null differ diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/41/3ae036dfd0a691258e7d1a779d177cfa184bdc b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/41/3ae036dfd0a691258e7d1a779d177cfa184bdc deleted file mode 100644 index cf65e71d8..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/objects/41/3ae036dfd0a691258e7d1a779d177cfa184bdc +++ /dev/null @@ -1,2 +0,0 @@ -xÍI -1@Q×9EíÉÔ@Ä3ˆ¨¤+èN$–z}àöÃãç¾®•Ay»ãA:¨âq¦ˆMòÙ&‰H“1©lÝ‘Q³É2/¾÷jÈÇñÞÐhxîj ~–š}ÜN \Ô>Æ)8ØK-¥È¿#Ó?V\éÉPêBâ f_: \ No newline at end of file diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/refs/heads/master b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/refs/heads/master deleted file mode 100644 index 3dd4d919d..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -413ae036dfd0a691258e7d1a779d177cfa184bdc diff --git a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/test.txt b/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/test.txt deleted file mode 100644 index 1386f5e9b..000000000 --- a/taf/tests/data/repos/test-repository/test-default-branch/test-repository-master-branch/test.txt +++ /dev/null @@ -1 +0,0 @@ -Just some random file \ No newline at end of file diff --git a/taf/tests/data/repository_description_inputs/with_delegations_no_yubikeys.json b/taf/tests/data/repository_description_inputs/with_delegations_no_yubikeys.json index bec3abc5e..a689dfdd8 100644 --- a/taf/tests/data/repository_description_inputs/with_delegations_no_yubikeys.json +++ b/taf/tests/data/repository_description_inputs/with_delegations_no_yubikeys.json @@ -13,7 +13,8 @@ "dir1/*", "dir2/path1" ], - "threshold": 1, + "number": 2, + "threshold": 2, "delegations": { "inner_role": { "paths": ["dir2/path2"] diff --git a/taf/tests/init_data/keys.json b/taf/tests/init_data/keys.json index ca594ecc4..7cb906b58 100644 --- a/taf/tests/init_data/keys.json +++ b/taf/tests/init_data/keys.json @@ -1,7 +1,7 @@ { "roles": { "root": { - "number": 2, + "number": 3, "length": 3072, "threshold": 1 }, diff --git a/taf/tests/init_data/mirrors.json b/taf/tests/init_data/mirrors.json index d713f9084..c4aac84e9 100644 --- a/taf/tests/init_data/mirrors.json +++ b/taf/tests/init_data/mirrors.json @@ -1,6 +1,8 @@ { "mirrors": [ - "git@github.com:oll-test-repos/{org_name}-{repo_name}.git", - "http://github.com/oll-test-repos/{org_name}-{repo_name}" + "https://github.com/{org_name}/{repo_name}.git", + "https://github.com/test_org/{org_name}-{repo_name}.git", + "git@github.com:{org_name}/{repo_name}.git", + "git@github.com:test_org/{org_name}-{repo_name}.git" ] } \ No newline at end of file diff --git a/taf/tests/init_data/repositories.json b/taf/tests/init_data/repositories.json index dcf26a42e..288e3c299 100644 --- a/taf/tests/init_data/repositories.json +++ b/taf/tests/init_data/repositories.json @@ -3,23 +3,18 @@ "{namespace}/target1": { "custom": { "allow-unauthenticated-commits":true, - "serve":"latest", - "location_regex":"~/.*\\.pdf$" + "type": "type1" } }, "{namespace}/target2": { "custom": { - "type":"xml", "allow-unauthenticated-commits":true, - "serve":"latest", - "serve-prefix":"_uncodified_xml" + "type":"type2" } }, "{namespace}/target3": { "custom": { - "type":"html", - "serve":"historical", - "location_regex":"/" + "type":"type3" } } } diff --git a/taf/tests/test_repository_tool/__init__.py b/taf/tests/test_api/conf/__init__.py similarity index 100% rename from taf/tests/test_repository_tool/__init__.py rename to taf/tests/test_api/conf/__init__.py diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/empty_file.txt b/taf/tests/test_api/conf/api/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repositoriesdb/test-delegated-roles-with-mirrors/namespace/TargetRepo3/empty_file.txt rename to taf/tests/test_api/conf/api/__init__.py diff --git a/taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/empty_file.txt b/taf/tests/test_api/conf/cli/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repositoriesdb/test-delegated-roles/namespace/TargetRepo3/empty_file.txt rename to taf/tests/test_api/conf/cli/__init__.py diff --git a/taf/tests/test_api/conf/cli/test_conf_init_cmd.py b/taf/tests/test_api/conf/cli/test_conf_init_cmd.py new file mode 100644 index 000000000..dea1313c8 --- /dev/null +++ b/taf/tests/test_api/conf/cli/test_conf_init_cmd.py @@ -0,0 +1,22 @@ +from pathlib import Path + +from click.testing import CliRunner + +from taf.tools.cli.taf import taf + + +def test_init_conf_cmd_expect_success(keystore): + runner = CliRunner() + with runner.isolated_filesystem(): + cwd = Path.cwd() + runner.invoke( + taf, + [ + "conf", + "init", + "--keystore", + f"{str(keystore)}", + ], + ) + assert (cwd / ".taf" / "config.toml").exists() + assert (cwd / ".taf" / "keystore").exists() diff --git a/taf/tests/test_api/conftest.py b/taf/tests/test_api/conftest.py index ca6ff9619..b3eea6cd0 100644 --- a/taf/tests/test_api/conftest.py +++ b/taf/tests/test_api/conftest.py @@ -1,10 +1,18 @@ -import json - +import shutil +import uuid from pathlib import Path -from taf.tests.conftest import KEYSTORES_PATH, TEST_DATA_PATH +from typing import Dict -from pytest import fixture +import pytest +from _pytest.logging import LogCaptureFixture +from loguru import logger +from taf.api.repository import create_repository +from taf.auth_repo import AuthenticationRepository +from taf.git import GitRepository +from taf.tests.conftest import CLIENT_DIR_PATH, KEYSTORES_PATH, TEST_DATA_PATH +from taf.tests.utils import copy_mirrors_json, copy_repositories_json, read_json +from taf.utils import on_rm_error REPOSITORY_DESCRIPTION_INPUT_DIR = TEST_DATA_PATH / "repository_description_inputs" TEST_INIT_DATA_PATH = Path(__file__).parent.parent / "init_data" @@ -21,70 +29,188 @@ INVALID_PATH_INPUT = REPOSITORY_DESCRIPTION_INPUT_DIR / "invalid_path.json" OLD_YUBIKEY_INPUT = REPOSITORY_DESCRIPTION_INPUT_DIR / "with_old_yubikey.json" -KEYSTORE_PATH = KEYSTORES_PATH / "api_keystore" -REPOSITORIES_JSON_PATH = TEST_INIT_DATA_PATH / "repositories.json" -MIRRORS_JSON_PATH = TEST_INIT_DATA_PATH / "mirrors.json" - +AUTH_REPO_NAME = "auth" +DEPENDENCY_NAME = "dependency/auth" -def _read_json(path): - return json.loads(Path(path).read_text()) +@pytest.fixture(scope="module") +def api_repo_path(repo_dir): + path = repo_dir / "api" / "auth" + yield path + shutil.rmtree(path.parent, onerror=on_rm_error) -@fixture -def api_keystore(): - return str(KEYSTORE_PATH) - -@fixture +@pytest.fixture(scope="session") def no_delegations_json_input(): - return _read_json(NO_DELEGATIONS_INPUT) - - -@fixture -def no_yubikeys_json_input(): - return _read_json(NO_YUBIKEYS_INPUT) - - -@fixture -def with_delegations_no_yubikeys_path(): - return str(WITH_DELEGATIONS_NO_YUBIKEYS_INPUT) + return read_json(NO_DELEGATIONS_INPUT) -@fixture -def no_yubikeys_path(): - return str(NO_YUBIKEYS_INPUT) - - -@fixture +@pytest.fixture(scope="session") def with_delegations_json_input(): - return _read_json(WITH_DELEGATIONS_INPUT) + return read_json(WITH_DELEGATIONS_INPUT) -@fixture +@pytest.fixture(scope="session") def invalid_public_key_json_input(): - return _read_json(INVALID_PUBLIC_KEY_INPUT) + return read_json(INVALID_PUBLIC_KEY_INPUT) -@fixture +@pytest.fixture(scope="session") def invalid_keys_number_json_input(): - return _read_json(INVALID_KEYS_NUMBER_INPUT) + return read_json(INVALID_KEYS_NUMBER_INPUT) -@fixture +@pytest.fixture(scope="session") def invalid_path_input(): - return _read_json(INVALID_PATH_INPUT) + return read_json(INVALID_PATH_INPUT) -@fixture +@pytest.fixture(scope="session") def with_old_yubikey_input(): - return _read_json(OLD_YUBIKEY_INPUT) + return read_json(OLD_YUBIKEY_INPUT) + + +@pytest.fixture +def auth_repo_path(repo_dir): + random_name = str(uuid.uuid4()) + path = repo_dir / "api" / random_name / "auth" + yield path + shutil.rmtree(path.parent, onerror=on_rm_error) + + +@pytest.fixture +def auth_repo(auth_repo_path, keystore_delegations, no_yubikeys_path): + repo_path = str(auth_repo_path) + create_repository( + repo_path, + roles_key_infos=no_yubikeys_path, + keystore=keystore_delegations, + commit=True, + test=True, + ) + auth_repo = AuthenticationRepository(path=repo_path) + yield auth_repo + + +@pytest.fixture +def auth_repo_with_delegations( + auth_repo_path, keystore_delegations, with_delegations_no_yubikeys_path +): + repo_path = str(auth_repo_path) + create_repository( + repo_path, + roles_key_infos=with_delegations_no_yubikeys_path, + keystore=keystore_delegations, + commit=True, + test=True, + ) + auth_repo = AuthenticationRepository(path=repo_path) + yield auth_repo + + +@pytest.fixture(scope="session") +def no_yubikeys_json_input(): + return read_json(NO_YUBIKEYS_INPUT) -@fixture -def repositories_json_template(): - return _read_json(REPOSITORIES_JSON_PATH) +@pytest.fixture(scope="session") +def no_yubikeys_path(): + return str(NO_YUBIKEYS_INPUT) -@fixture -def mirrors_json_path(): - return MIRRORS_JSON_PATH +@pytest.fixture(scope="module") +def library(repo_dir): + random_name = str(uuid.uuid4()) + root_dir = repo_dir / random_name + # create an initialize some target repositories + # their content is not important + auth_path = root_dir / AUTH_REPO_NAME + auth_path.mkdir(exist_ok=True, parents=True) + targets = ("target1", "target2", "target3", "new_target") + for target in targets: + target_repo_path = root_dir / target + target_repo_path.mkdir() + target_repo = GitRepository(path=target_repo_path) + target_repo.init_repo() + target_repo.commit_empty("Initial commit") + yield root_dir + shutil.rmtree(root_dir, onerror=on_rm_error) + + +@pytest.fixture(scope="function") +def auth_repo_when_add_repositories_json( + library: Path, + with_delegations_no_yubikeys_path: str, + keystore_delegations: str, + repositories_json_template: Dict, + mirrors_json_path: Path, +): + repo_path = library / "auth" + namespace = library.name + copy_repositories_json(repositories_json_template, namespace, repo_path) + copy_mirrors_json(mirrors_json_path, repo_path) + create_repository( + str(repo_path), + roles_key_infos=with_delegations_no_yubikeys_path, + keystore=keystore_delegations, + commit=True, + ) + auth_reo = AuthenticationRepository(path=repo_path) + yield auth_reo + shutil.rmtree(repo_path, onerror=on_rm_error) + + +def _init_auth_repo_dir(): + random_name = str(uuid.uuid4()) + root_dir = CLIENT_DIR_PATH / random_name + auth_path = root_dir / AUTH_REPO_NAME + auth_path.mkdir(exist_ok=True, parents=True) + return auth_path + + +@pytest.fixture(scope="module") +def child_repo_path(): + repo_path = _init_auth_repo_dir() + yield repo_path + shutil.rmtree(str(repo_path.parent), onerror=on_rm_error) + + +@pytest.fixture(scope="module") +def parent_repo_path(): + repo_path = _init_auth_repo_dir() + yield repo_path + shutil.rmtree(str(repo_path.parent), onerror=on_rm_error) + + +@pytest.fixture(scope="module") +def roles_keystore(keystore_delegations): + # set up a keystore by copying the api keystore + # new keystore files are expected to be created and store to this directory + # it will be removed once this test's execution is done + # Create the destination folder if it doesn't exist + roles_keystore = KEYSTORES_PATH / "roles_keystore" + if roles_keystore.is_dir(): + shutil.rmtree(str(roles_keystore)) + + # Copy the contents of the source folder to the destination folder + shutil.copytree(keystore_delegations, str(roles_keystore)) + yield str(roles_keystore) + shutil.rmtree(str(roles_keystore)) + + +@pytest.fixture +def caplog(caplog: LogCaptureFixture): + """ + Override pytest capture logging (caplog fixture) to point to loguru logging instead. + This is because we use loguru logging instead of the default logging module. + Source: https://loguru.readthedocs.io/en/stable/resources/migration.html#replacing-caplog-fixture-from-pytest-library + """ + handler_id = logger.add( + caplog.handler, + format="{message}", + level=0, + filter=lambda record: record["level"].no >= caplog.handler.level, + enqueue=False, # Set to 'True' if your test is spawning child processes. + ) + yield caplog + logger.remove(handler_id) diff --git a/taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/empty_file.txt b/taf/tests/test_api/dependencies/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repositoriesdb/test-no-delegations/namespace/TargetRepo3/empty_file.txt rename to taf/tests/test_api/dependencies/__init__.py diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir1/delegated_role1_1.txt b/taf/tests/test_api/dependencies/api/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir1/delegated_role1_1.txt rename to taf/tests/test_api/dependencies/api/__init__.py diff --git a/taf/tests/test_api/test_dependencies.py b/taf/tests/test_api/dependencies/api/test_dependencies.py similarity index 76% rename from taf/tests/test_api/test_dependencies.py rename to taf/tests/test_api/dependencies/api/test_dependencies.py index 8f62b7689..24c6e0adf 100644 --- a/taf/tests/test_api/test_dependencies.py +++ b/taf/tests/test_api/dependencies/api/test_dependencies.py @@ -1,5 +1,3 @@ -import shutil -import uuid import pytest from pathlib import Path from taf.api.dependencies import add_dependency, remove_dependency @@ -7,55 +5,27 @@ from taf.messages import git_commit_message import taf.repositoriesdb as repositoriesdb from taf.auth_repo import AuthenticationRepository -from pytest import fixture from taf.api.repository import create_repository -from taf.tests.conftest import CLIENT_DIR_PATH -from taf.utils import on_rm_error - - -AUTH_REPO_NAME = "auth" -DEPENDENCY_NAME = "dependency/auth" - - -def _init_auth_repo_dir(): - random_name = str(uuid.uuid4()) - root_dir = CLIENT_DIR_PATH / random_name - auth_path = root_dir / AUTH_REPO_NAME - auth_path.mkdir(exist_ok=True, parents=True) - return auth_path - - -@fixture(scope="module") -def child_repo_path(): - repo_path = _init_auth_repo_dir() - yield repo_path - shutil.rmtree(str(repo_path.parent), onerror=on_rm_error) - - -@fixture(scope="module") -def parent_repo_path(): - repo_path = _init_auth_repo_dir() - yield repo_path - shutil.rmtree(str(repo_path.parent), onerror=on_rm_error) +from taf.tests.test_api.conftest import DEPENDENCY_NAME def test_setup_repositories( child_repo_path: Path, parent_repo_path: Path, - no_yubikeys_path: str, - api_keystore: str, + with_delegations_no_yubikeys_path: str, + keystore_delegations: str, ): for path in (child_repo_path, parent_repo_path): create_repository( str(path), - roles_key_infos=no_yubikeys_path, - keystore=api_keystore, + roles_key_infos=with_delegations_no_yubikeys_path, + keystore=keystore_delegations, commit=True, ) def test_add_dependency_when_on_filesystem_invalid_commit( - parent_repo_path, child_repo_path, api_keystore + parent_repo_path, child_repo_path, keystore_delegations ): auth_repo = AuthenticationRepository(path=parent_repo_path) initial_commits_num = len(auth_repo.list_commits()) @@ -65,7 +35,7 @@ def test_add_dependency_when_on_filesystem_invalid_commit( add_dependency( path=str(parent_repo_path), dependency_name=child_repository.name, - keystore=api_keystore, + keystore=keystore_delegations, branch_name="main", out_of_band_commit="66d7f48e972f9fa25196523f469227dfcd85c994", no_prompt=True, @@ -76,7 +46,7 @@ def test_add_dependency_when_on_filesystem_invalid_commit( def test_add_dependency_when_on_filesystem( - parent_repo_path, child_repo_path, api_keystore + parent_repo_path, child_repo_path, keystore_delegations ): auth_repo = AuthenticationRepository(path=parent_repo_path) initial_commits_num = len(auth_repo.list_commits()) @@ -85,7 +55,7 @@ def test_add_dependency_when_on_filesystem( add_dependency( path=str(parent_repo_path), dependency_name=child_repository.name, - keystore=api_keystore, + keystore=keystore_delegations, branch_name=None, out_of_band_commit=None, no_prompt=True, @@ -106,7 +76,7 @@ def test_add_dependency_when_on_filesystem( } -def test_add_dependency_when_not_on_filesystem(parent_repo_path, api_keystore): +def test_add_dependency_when_not_on_filesystem(parent_repo_path, keystore_delegations): auth_repo = AuthenticationRepository(path=parent_repo_path) initial_commits_num = len(auth_repo.list_commits()) branch_name = "main" @@ -114,7 +84,7 @@ def test_add_dependency_when_not_on_filesystem(parent_repo_path, api_keystore): add_dependency( path=str(parent_repo_path), dependency_name=DEPENDENCY_NAME, - keystore=api_keystore, + keystore=keystore_delegations, branch_name=branch_name, out_of_band_commit=out_of_band_commit, no_prompt=True, @@ -135,7 +105,7 @@ def test_add_dependency_when_not_on_filesystem(parent_repo_path, api_keystore): } -def test_remove_dependency(parent_repo_path, child_repo_path, api_keystore): +def test_remove_dependency(parent_repo_path, child_repo_path, keystore_delegations): auth_repo = AuthenticationRepository(path=parent_repo_path) initial_commits_num = len(auth_repo.list_commits()) child_repository = AuthenticationRepository(path=child_repo_path) @@ -143,7 +113,7 @@ def test_remove_dependency(parent_repo_path, child_repo_path, api_keystore): remove_dependency( path=str(parent_repo_path), dependency_name=child_repository.name, - keystore=api_keystore, + keystore=keystore_delegations, push=False, ) commits = auth_repo.list_commits() diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir1/delegated_role1_2.txt b/taf/tests/test_api/dependencies/cli/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir1/delegated_role1_2.txt rename to taf/tests/test_api/dependencies/cli/__init__.py diff --git a/taf/tests/test_api/dependencies/cli/test_dependencies_cmds.py b/taf/tests/test_api/dependencies/cli/test_dependencies_cmds.py new file mode 100644 index 000000000..dcbebf362 --- /dev/null +++ b/taf/tests/test_api/dependencies/cli/test_dependencies_cmds.py @@ -0,0 +1,81 @@ +import json + +from click.testing import CliRunner + +from taf.api.repository import create_repository +from taf.auth_repo import AuthenticationRepository +from taf.tests.test_api.conftest import DEPENDENCY_NAME +from taf.tools.cli.taf import taf + + +def test_dependencies_add_cmd_expect_success( + parent_repo_path, + child_repo_path, + with_delegations_no_yubikeys_path, + keystore_delegations, +): + for path in (child_repo_path, parent_repo_path): + create_repository( + str(path), + roles_key_infos=with_delegations_no_yubikeys_path, + keystore=keystore_delegations, + commit=True, + ) + runner = CliRunner() + + parent_auth_repo = AuthenticationRepository(path=parent_repo_path) + child_auth_repo = AuthenticationRepository(path=child_repo_path) + + assert not (parent_auth_repo.path / "targets" / "dependencies.json").exists() + + runner.invoke( + taf, + [ + "dependencies", + "add", + DEPENDENCY_NAME, + "--path", + f"{str(parent_auth_repo.path)}", + "--dependency-path", + f"{child_auth_repo.path}", + "--keystore", + f"{str(keystore_delegations)}", + ], + input="y\n", # pass in y to resolve Proceed? prompt + ) + assert (parent_auth_repo.path / "targets" / "dependencies.json").exists() + + dependencies_json = json.loads( + (parent_auth_repo.path / "targets" / "dependencies.json").read_text() + ) + dependencies = dependencies_json["dependencies"][DEPENDENCY_NAME] + assert ( + child_auth_repo.head_commit_sha() in dependencies["out-of-band-authentication"] + ) + assert child_auth_repo.default_branch in dependencies["branch"] + + +def test_dependencies_remove_cmd_expect_success( + parent_repo_path, + keystore_delegations, +): + runner = CliRunner() + + parent_auth_repo = AuthenticationRepository(path=parent_repo_path) + + runner.invoke( + taf, + [ + "dependencies", + "remove", + DEPENDENCY_NAME, + "--path", + f"{str(parent_auth_repo.path)}", + "--keystore", + f"{str(keystore_delegations)}", + ], + ) + dependencies_json = json.loads( + (parent_auth_repo.path / "targets" / "dependencies.json").read_text() + ) + assert DEPENDENCY_NAME not in dependencies_json["dependencies"].keys() diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir2/delegated_role2_1.txt b/taf/tests/test_api/metadata/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir2/delegated_role2_1.txt rename to taf/tests/test_api/metadata/__init__.py diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir2/delegated_role2_2.txt b/taf/tests/test_api/metadata/api/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir2/delegated_role2_2.txt rename to taf/tests/test_api/metadata/api/__init__.py diff --git a/taf/tests/test_api/metadata/api/test_metadata.py b/taf/tests/test_api/metadata/api/test_metadata.py new file mode 100644 index 000000000..a530c8d02 --- /dev/null +++ b/taf/tests/test_api/metadata/api/test_metadata.py @@ -0,0 +1,239 @@ +import datetime +import pytest +from taf.messages import git_commit_message +from freezegun import freeze_time +from typing import Dict +from taf.auth_repo import AuthenticationRepository +from taf.api.repository import create_repository +from taf.api.metadata import check_expiration_dates, update_metadata_expiration_date + +from tuf.api.metadata import Root, Snapshot, Timestamp, Targets + + +AUTH_REPO_NAME = "auth" + + +@pytest.fixture(scope="module") +@freeze_time("2021-12-31") +def auth_repo_expired( + api_repo_path, keystore_delegations, with_delegations_no_yubikeys_path +): + repo_path = str(api_repo_path) + create_repository( + repo_path, + roles_key_infos=str(with_delegations_no_yubikeys_path), + keystore=keystore_delegations, + commit=True, + test=True, + ) + auth_repo = AuthenticationRepository(path=repo_path) + return auth_repo + + +@freeze_time("2023-01-01") +def test_check_expiration_date_when_all_expired( + auth_repo_expired: AuthenticationRepository, +): + expired, will_expire = check_expiration_dates( + auth_repo_expired.path, print_output=False + ) + start = datetime.datetime(2021, 12, 31, tzinfo=datetime.timezone.utc) + # expect expire after 1 day + _check_expired_role(Timestamp.type, start, 1, expired) + # expect expired after 7 days + _check_expired_role(Snapshot.type, start, 7, expired) + # expect expire after 3 months + for target_role in (Targets.type, "delegated_role", "inner_role"): + _check_expired_role(target_role, start, 90, expired) + # expect expire after one year + _check_expired_role(Root.type, start, 365, expired) + assert not len(will_expire) + + +@freeze_time("2023-01-01") +def test_update_root_metadata( + auth_repo_expired: AuthenticationRepository, keystore_delegations: str +): + # update root metadata, expect snapshot and timestamp to be updated too + # targets should not be updated + auth_repo_path = auth_repo_expired.path + auth_repo = AuthenticationRepository(path=auth_repo_path) + initial_commits_num = len(auth_repo.list_commits()) + roles = [Root.type] + INTERVAL = 180 + timestamp_version = auth_repo_expired.timestamp().version + snapshot_version = auth_repo_expired.snapshot().version + update_metadata_expiration_date( + path=auth_repo_path, + roles=roles, + interval=INTERVAL, + keystore=keystore_delegations, + push=False, + ) + commits = auth_repo.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message( + "update-expiration-dates", roles=",".join(roles) + ) + expected_expiration = _get_date(INTERVAL) + actual_expiration = auth_repo.get_expiration_date(Root.type) + assert expected_expiration == actual_expiration + now = datetime.datetime.now(tz=datetime.timezone.utc) + for role in (Targets.type, "delegated_role", "inner_role"): + actual_expiration = auth_repo.get_expiration_date(role) + assert actual_expiration < now + assert auth_repo_expired.timestamp().version == timestamp_version + 1 + assert auth_repo_expired.snapshot().version == snapshot_version + 1 + + +@freeze_time("2023-01-01") +def test_check_expiration_date_when_expired_and_will_expire( + auth_repo_expired: AuthenticationRepository, +): + auth_repo_path = auth_repo_expired.path + expired, will_expire = check_expiration_dates( + auth_repo_path, interval=90, print_output=False + ) + + start = datetime.datetime(2021, 12, 31, tzinfo=datetime.timezone.utc) + # target roles have not been updated yet + for target_role in (Targets.type, "delegated_role", "inner_role"): + _check_expired_role(target_role, start, 90, expired) + + # other roles are not due to expire in the specified interval + assert not len(will_expire) + + # now set a larger interval, all roles are due to expire before the interval's end + _, will_expire = check_expiration_dates( + auth_repo_path, interval=366, print_output=False + ) + assert Root.type in will_expire + + +@freeze_time("2023-01-01") +def test_update_snapshot_metadata( + auth_repo_expired: AuthenticationRepository, keystore_delegations: str +): + # update root metadata, expect snapshot and timestamp to be updated too + # targets should not be updated + auth_repo_path = auth_repo_expired.path + auth_repo = AuthenticationRepository(path=auth_repo_path) + initial_commits_num = len(auth_repo.list_commits()) + roles = [Snapshot.type] + INTERVAL = 7 + timestamp_version = auth_repo_expired.timestamp().version + snapshot_version = auth_repo_expired.snapshot().version + update_metadata_expiration_date( + path=auth_repo_path, + roles=roles, + interval=INTERVAL, + keystore=keystore_delegations, + push=False, + ) + commits = auth_repo.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message( + "update-expiration-dates", roles=",".join(roles) + ) + assert auth_repo_expired.timestamp().version == timestamp_version + 1 + assert auth_repo_expired.snapshot().version == snapshot_version + 1 + + +@freeze_time("2023-01-01") +def test_update_timestamp_metadata( + auth_repo_expired: AuthenticationRepository, keystore_delegations: str +): + # update root metadata, expect snapshot and timestamp to be updated too + # targets should not be updated + auth_repo_path = auth_repo_expired.path + auth_repo = AuthenticationRepository(path=auth_repo_path) + initial_commits_num = len(auth_repo.list_commits()) + roles = [Timestamp.type] + INTERVAL = 1 + timestamp_version = auth_repo_expired.timestamp().version + snapshot_version = auth_repo_expired.snapshot().version + update_metadata_expiration_date( + path=auth_repo_path, + roles=roles, + interval=INTERVAL, + keystore=keystore_delegations, + push=False, + ) + commits = auth_repo.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message( + "update-expiration-dates", roles=",".join(roles) + ) + assert auth_repo_expired.timestamp().version == timestamp_version + 1 + assert auth_repo_expired.snapshot().version == snapshot_version + + +@freeze_time("2023-01-01") +def test_update_multiple_roles_metadata( + auth_repo_expired: AuthenticationRepository, keystore_delegations: str +): + # update root metadata, expect snapshot and timestamp to be updated too + # targets should not be updated + auth_repo_path = auth_repo_expired.path + auth_repo = AuthenticationRepository(path=auth_repo_path) + initial_commits_num = len(auth_repo.list_commits()) + roles = [Targets.type, "delegated_role", "inner_role"] + INTERVAL = 365 + timestamp_version = auth_repo_expired.timestamp().version + snapshot_version = auth_repo_expired.snapshot().version + update_metadata_expiration_date( + path=auth_repo_path, + roles=roles, + interval=INTERVAL, + keystore=keystore_delegations, + push=False, + ) + commits = auth_repo.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message( + "update-expiration-dates", roles=",".join(roles) + ) + for role in roles: + expected_expiration = _get_date(INTERVAL) + actual_expiration = auth_repo.get_expiration_date(role) + assert expected_expiration == actual_expiration + assert auth_repo_expired.timestamp().version == timestamp_version + 1 + assert auth_repo_expired.snapshot().version == snapshot_version + 1 + + +@freeze_time("2023-01-01") +def test_check_expiration_date_when_no_expired( + auth_repo_expired: AuthenticationRepository, +): + auth_repo_path = auth_repo_expired.path + expired, will_expire = check_expiration_dates( + auth_repo_path, interval=90, print_output=False + ) + assert not len(expired) + assert len(will_expire) == 2 + + +def _check_expired_role( + role_name: str, start_time: datetime.datetime, interval: int, expired_dict: Dict +): + assert role_name in expired_dict + expected_expiration_date = start_time + datetime.timedelta(days=interval) + actual_expiration_time = expired_dict[role_name] + # strip hours and minutes, they are set in case of targets and root + actual_expiration_date = _strip_hours(actual_expiration_time) + assert expected_expiration_date == actual_expiration_date + + +def _get_date(interval): + now = datetime.datetime.now(tz=datetime.timezone.utc) + date = now + datetime.timedelta(interval) + return _strip_hours(date) + + +def _strip_hours(date): + return datetime.datetime( + date.year, + date.month, + date.day, + tzinfo=date.tzinfo, + ) diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir2/inner_delegated_role.txt b/taf/tests/test_api/metadata/cli/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pkcs1v15/taf/targets/dir2/inner_delegated_role.txt rename to taf/tests/test_api/metadata/cli/__init__.py diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir1/delegated_role1_1.txt b/taf/tests/test_api/repo/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir1/delegated_role1_1.txt rename to taf/tests/test_api/repo/__init__.py diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir1/delegated_role1_2.txt b/taf/tests/test_api/repo/api/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir1/delegated_role1_2.txt rename to taf/tests/test_api/repo/api/__init__.py diff --git a/taf/tests/test_api/test_create_repository.py b/taf/tests/test_api/repo/api/test_create_repository.py similarity index 64% rename from taf/tests/test_api/test_create_repository.py rename to taf/tests/test_api/repo/api/test_create_repository.py index fbf011c93..62b4fda8d 100644 --- a/taf/tests/test_api/test_create_repository.py +++ b/taf/tests/test_api/repo/api/test_create_repository.py @@ -1,31 +1,20 @@ -import shutil -import uuid from pathlib import Path -from pytest import fixture + +from taf.constants import METADATA_DIRECTORY_NAME, TARGETS_DIRECTORY_NAME from typing import Dict from taf.api.repository import create_repository from taf.auth_repo import AuthenticationRepository from taf.messages import git_commit_message -from taf.tests.conftest import CLIENT_DIR_PATH from taf.tests.test_api.util import ( check_if_targets_signed, - copy_mirrors_json, - copy_repositories_json, ) +from taf.tests.utils import copy_mirrors_json, copy_repositories_json from taf.updater.updater import validate_repository -from taf.utils import on_rm_error -from tuf.repository_tool import METADATA_DIRECTORY_NAME, TARGETS_DIRECTORY_NAME - -@fixture -def auth_repo_path(): - random_name = str(uuid.uuid4()) - path = CLIENT_DIR_PATH / random_name / "auth" - yield path - shutil.rmtree(path.parent, onerror=on_rm_error) - -def _check_repo_initialization_successful(auth_repo: AuthenticationRepository): +def _check_repo_initialization_successful( + auth_repo: AuthenticationRepository, is_targets_initialized=True +): repo_root_path = auth_repo.path metadata_dir = repo_root_path / METADATA_DIRECTORY_NAME targets_dir = repo_root_path / TARGETS_DIRECTORY_NAME @@ -35,60 +24,70 @@ def _check_repo_initialization_successful(auth_repo: AuthenticationRepository): for role in ("root", "targets", "snapshot", "timestamp"): assert (metadata_dir / f"{role}.json").is_file() is True - assert targets_dir.is_dir() is True commits = auth_repo.list_commits() - assert len(commits) == 1 - assert commits[0].message.strip() == git_commit_message("create-repo") + if is_targets_initialized: + assert targets_dir.is_dir() is True + assert len(commits) == 2 + assert commits[0].message.strip() == git_commit_message("update-targets") + assert commits[1].message.strip() == git_commit_message("create-repo") + else: + assert len(commits) == 1 + assert commits[0].message.strip() == git_commit_message("create-repo") def test_create_repository_when_no_delegations( - auth_repo_path: Path, no_yubikeys_path: str, api_keystore: str + auth_repo_path: Path, + with_delegations_no_yubikeys_path: str, + keystore_delegations: str, ): repo_path = str(auth_repo_path) create_repository( repo_path, - roles_key_infos=no_yubikeys_path, - keystore=api_keystore, + roles_key_infos=with_delegations_no_yubikeys_path, + keystore=keystore_delegations, commit=True, ) - auth_repo = AuthenticationRepository(path=repo_path) - _check_repo_initialization_successful(auth_repo) + _check_repo_initialization_successful(auth_repo, is_targets_initialized=False) assert auth_repo.is_test_repo is False validate_repository(repo_path) def test_create_repository_when_no_delegations_with_test_flag( - auth_repo_path: Path, no_yubikeys_path: str, api_keystore: str + auth_repo_path: Path, + with_delegations_no_yubikeys_path: str, + keystore_delegations: str, ): repo_path = str(auth_repo_path) create_repository( repo_path, - roles_key_infos=no_yubikeys_path, - keystore=api_keystore, + roles_key_infos=with_delegations_no_yubikeys_path, + keystore=keystore_delegations, commit=True, test=True, ) auth_repo = AuthenticationRepository(path=repo_path) - _check_repo_initialization_successful(auth_repo) + _check_repo_initialization_successful(auth_repo, is_targets_initialized=True) assert auth_repo.is_test_repo is True validate_repository(repo_path) def test_create_repository_when_delegations( - auth_repo_path: Path, with_delegations_no_yubikeys_path: str, api_keystore: str + auth_repo_path: Path, + with_delegations_no_yubikeys_path: str, + keystore_delegations: str, ): repo_path = str(auth_repo_path) create_repository( str(auth_repo_path), roles_key_infos=with_delegations_no_yubikeys_path, - keystore=api_keystore, + keystore=keystore_delegations, commit=True, ) auth_repo = AuthenticationRepository(path=auth_repo_path) - _check_repo_initialization_successful(auth_repo) + _check_repo_initialization_successful(auth_repo, is_targets_initialized=False) targets_roles = auth_repo.get_all_targets_roles() for role in ("targets", "delegated_role", "inner_role"): assert role in targets_roles @@ -98,7 +97,7 @@ def test_create_repository_when_delegations( def test_create_repository_when_add_repositories_json( auth_repo_path: Path, with_delegations_no_yubikeys_path: str, - api_keystore: str, + keystore_delegations: str, repositories_json_template: Dict, mirrors_json_path: Path, ): @@ -110,12 +109,12 @@ def test_create_repository_when_add_repositories_json( create_repository( repo_path, roles_key_infos=with_delegations_no_yubikeys_path, - keystore=api_keystore, + keystore=keystore_delegations, commit=True, ) auth_repo = AuthenticationRepository(path=auth_repo_path) - _check_repo_initialization_successful(auth_repo) + _check_repo_initialization_successful(auth_repo, is_targets_initialized=True) targets_roles = auth_repo.get_all_targets_roles() for role in ("targets", "delegated_role", "inner_role"): assert role in targets_roles diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir2/delegated_role2_1.txt b/taf/tests/test_api/repo/cli/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir2/delegated_role2_1.txt rename to taf/tests/test_api/repo/cli/__init__.py diff --git a/taf/tests/test_api/repo/cli/test_repo_create_cmd.py b/taf/tests/test_api/repo/cli/test_repo_create_cmd.py new file mode 100644 index 000000000..c3e680cb0 --- /dev/null +++ b/taf/tests/test_api/repo/cli/test_repo_create_cmd.py @@ -0,0 +1,83 @@ +import os +from pathlib import Path + +from click.testing import CliRunner + +from taf.tools.cli.taf import taf + + +def test_repo_create_cmd_expect_success( + keystore_delegations, with_delegations_no_yubikeys_path, caplog +): + runner = CliRunner() + with runner.isolated_filesystem(): + result = runner.invoke( + taf, + [ + "repo", + "create", + "test/law", + "--keys-description", + f"{str(with_delegations_no_yubikeys_path)}", + "--keystore", + f"{str(keystore_delegations)}", + "--no-commit", + "--test", + ], + ) + # logging statements are captured by caplog + # while print statements are captured by pytest CliRunner result object + output = caplog.text + # TODO: expected to have these asserts + assert "Please commit manually" in result.output + assert "Finished creating a new repository" in output + + cwd = Path.cwd() + assert (cwd / "test/law" / "metadata").exists() + assert (cwd / "test/law" / "targets").exists() + + +def test_repo_create_cmd_when_repo_already_created_expect_error( + keystore_delegations, with_delegations_no_yubikeys_path, caplog +): + runner = CliRunner() + with runner.isolated_filesystem(): + result = runner.invoke( + taf, + [ + "repo", + "create", + "test/law", + "--keys-description", + f"{str(with_delegations_no_yubikeys_path)}", + "--keystore", + f"{str(keystore_delegations)}", + "--no-commit", + "--test", + ], + ) + cwd = Path.cwd() + assert (cwd / "test/law" / "metadata").exists() + assert (cwd / "test/law" / "targets").exists() + + output = caplog.text + assert "Finished creating a new repository" in output + # run the same command again + result = runner.invoke( + taf, + [ + "repo", + "create", + "test/law", + "--keys-description", + f"{str(with_delegations_no_yubikeys_path)}", + "--keystore", + f"{str(keystore_delegations)}", + "--no-commit", + "--test", + ], + ) + assert ( + f'Metadata directory found inside "test{os.sep}law". Recreate metadata files? [y/N]' + in result.output + ) diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir2/delegated_role2_2.txt b/taf/tests/test_api/roles/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir2/delegated_role2_2.txt rename to taf/tests/test_api/roles/__init__.py diff --git a/taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir2/inner_delegated_role.txt b/taf/tests/test_api/roles/api/__init__.py similarity index 100% rename from taf/tests/data/repos/test-repository-tool/test-delegated-roles-pss/taf/targets/dir2/inner_delegated_role.txt rename to taf/tests/test_api/roles/api/__init__.py diff --git a/taf/tests/test_api/roles/api/test_roles.py b/taf/tests/test_api/roles/api/test_roles.py new file mode 100644 index 000000000..13f23b1dc --- /dev/null +++ b/taf/tests/test_api/roles/api/test_roles.py @@ -0,0 +1,282 @@ +from pathlib import Path +from taf.api.roles import ( + add_role, + add_role_paths, + add_multiple_roles, + add_signing_key, + list_keys_of_role, + remove_paths, + revoke_signing_key, +) +from taf.messages import git_commit_message +from taf.auth_repo import AuthenticationRepository +from taf.tests.test_api.util import check_new_role + + +def test_add_role_when_target_is_parent( + auth_repo: AuthenticationRepository, roles_keystore: str +): + initial_commits_num = len(auth_repo.list_commits()) + ROLE_NAME = "new_role" + PATHS = ["some-path1", "some-path2"] + PARENT_NAME = "targets" + add_role( + path=str(auth_repo.path), + auth_repo=auth_repo, + role=ROLE_NAME, + parent_role=PARENT_NAME, + paths=PATHS, + keys_number=2, + threshold=1, + yubikey=False, + keystore=roles_keystore, + push=False, + skip_prompt=True, + ) + commits = auth_repo.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message("add-role", role=ROLE_NAME) + check_new_role(auth_repo, ROLE_NAME, PATHS, roles_keystore, PARENT_NAME) + + +def test_add_role_when_delegated_role_is_parent( + auth_repo_with_delegations: AuthenticationRepository, roles_keystore: str +): + initial_commits_num = len(auth_repo_with_delegations.list_commits()) + ROLE_NAME = "new_inner_role" + PATHS = ["inner-path1", "inner-path2"] + PARENT_NAME = "delegated_role" + add_role( + path=str(auth_repo_with_delegations.path), + auth_repo=auth_repo_with_delegations, + role=ROLE_NAME, + parent_role=PARENT_NAME, + paths=PATHS, + keys_number=2, + threshold=1, + yubikey=False, + keystore=roles_keystore, + push=False, + skip_prompt=True, + ) + commits = auth_repo_with_delegations.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message("add-role", role=ROLE_NAME) + check_new_role( + auth_repo_with_delegations, ROLE_NAME, PATHS, roles_keystore, PARENT_NAME + ) + + +def test_add_multiple_roles( + auth_repo: AuthenticationRepository, + roles_keystore: str, + with_delegations_no_yubikeys_path: str, +): + initial_commits_num = len(auth_repo.list_commits()) + add_multiple_roles( + path=str(auth_repo.path), + keystore=roles_keystore, + roles_key_infos=with_delegations_no_yubikeys_path, + push=False, + ) + # with_delegations_no_yubikeys_path specification contains delegated_role and inner_role + # definitions, so these two roles should get added to the repository + commits = auth_repo.list_commits() + assert len(commits) == initial_commits_num + 1 + new_roles = ["delegated_role", "inner_role"] + assert commits[0].message.strip() == git_commit_message( + "add-roles", roles=", ".join(new_roles) + ) + target_roles = auth_repo.get_all_targets_roles() + for role_name in new_roles: + assert role_name in target_roles + assert auth_repo.find_delegated_roles_parent("delegated_role") == "targets" + assert auth_repo.find_delegated_roles_parent("inner_role") == "delegated_role" + + +def test_add_role_paths( + auth_repo_with_delegations: AuthenticationRepository, roles_keystore: str +): + initial_commits_num = len(auth_repo_with_delegations.list_commits()) + NEW_PATHS = ["some-path3"] + ROLE_NAME = "delegated_role" + add_role_paths( + auth_repo=auth_repo_with_delegations, + paths=NEW_PATHS, + keystore=roles_keystore, + delegated_role=ROLE_NAME, + push=False, + ) + + commits = auth_repo_with_delegations.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message( + "add-role-paths", paths=", ".join(NEW_PATHS), role=ROLE_NAME + ) + roles_paths = auth_repo_with_delegations.get_role_paths(ROLE_NAME) + assert len(roles_paths) == 3 + assert "some-path3" in roles_paths + + +def test_remove_role_paths( + auth_repo_with_delegations: AuthenticationRepository, roles_keystore: str +): + initial_commits_num = len(auth_repo_with_delegations.list_commits()) + REMOVED_PATHS = ["dir2/path1"] + ROLE_NAME = "delegated_role" + remove_paths( + path=str(auth_repo_with_delegations.path), + paths=REMOVED_PATHS, + keystore=roles_keystore, + push=False, + ) + + commits = auth_repo_with_delegations.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message( + "remove-role-paths", paths=", ".join(REMOVED_PATHS), role=ROLE_NAME + ) + roles_paths = auth_repo_with_delegations.get_role_paths(ROLE_NAME) + assert len(roles_paths) == 1 + assert REMOVED_PATHS[0] not in roles_paths + + +# TODO enable when remove role is reimplemented +# def test_remove_role_when_no_targets(auth_repo_with_delegations: AuthenticationRepository, roles_keystore: str): +# initial_commits_num = len(auth_repo_with_delegations.list_commits()) +# ROLE_NAME = "inner_role" +# remove_role( +# path=str(auth_repo_with_delegations.path), +# role=ROLE_NAME, +# keystore=roles_keystore, +# push=False, +# ) +# commits = auth_repo_with_delegations.list_commits() +# assert len(commits) == initial_commits_num + 1 +# assert commits[0].message.strip() == git_commit_message( +# "remove-role", role=ROLE_NAME +# ) + + +# def test_remove_role_when_remove_targets(auth_repo_with_delegations: AuthenticationRepository, roles_keystore: str): +# initial_commits_num = len(auth_repo_with_delegations.list_commits()) +# ROLE_NAME = "delegated_role" +# # add target files which match the delegated role's paths +# # one is a glob dir1/* +# # the second one is dir2/path1 +# FILENAME1 = "test.txt" +# FILENAME2 = "path1" +# # add a new file to the targets directory, check if it was signed +# # make sure the path was delegated to delegated_role +# file_dir1 = auth_repo_with_delegations.path / TARGETS_DIRECTORY_NAME / "dir1" +# file_dir2 = auth_repo_with_delegations.path / TARGETS_DIRECTORY_NAME / "dir2" +# file_dir1.mkdir() +# file_dir2.mkdir() +# file_path1 = file_dir1 / FILENAME1 +# file_path1.write_text("test") +# file_path2 = file_dir2 / FILENAME2 +# file_path2.write_text("test") +# register_target_files(auth_repo_with_delegations.path, roles_keystore, update_snapshot_and_timestamp=True, push=False) +# check_if_targets_signed( +# auth_repo_with_delegations, ROLE_NAME, f"dir1/{FILENAME1}", f"dir2/{FILENAME2}" +# ) +# commits = auth_repo_with_delegations.list_commits() +# assert len(commits) == initial_commits_num + 1 +# remove_role( +# path=str(auth_repo_with_delegations.path), +# role=ROLE_NAME, +# keystore=roles_keystore, +# push=False, +# remove_targets=True, +# ) +# commits = auth_repo_with_delegations.list_commits() +# assert len(commits) == initial_commits_num + 2 +# assert commits[0].message.strip() == git_commit_message( +# "remove-role", role=ROLE_NAME +# ) +# assert not file_path1.is_file() +# assert not file_path2.is_file() + + +# def test_remove_role_when_keep_targets(auth_repo: AuthenticationRepository, roles_keystore: str): +# initial_commits_num = len(auth_repo.list_commits()) +# ROLE_NAME = "new_role" +# # add target file which matches the delegated role's paths +# FILENAME = "some-path2" +# # add a new file to the targets directory, check if it was signed +# # make sure the path was delegated to delegated_role +# file_path = auth_repo.path / TARGETS_DIRECTORY_NAME / FILENAME +# file_path.write_text("test") +# register_target_files(auth_repo.path, roles_keystore, write=True, push=False) +# check_if_targets_signed(auth_repo, ROLE_NAME, FILENAME) +# commits = auth_repo.list_commits() +# assert len(commits) == initial_commits_num + 1 +# remove_role( +# path=str(auth_repo.path), +# role=ROLE_NAME, +# keystore=roles_keystore, +# push=False, +# remove_targets=False, +# ) +# commits = auth_repo.list_commits() +# assert len(commits) == initial_commits_num + 2 +# assert commits[0].message.strip() == git_commit_message( +# "remove-role", role=ROLE_NAME +# ) +# assert file_path.is_file() + + +def test_list_keys(auth_repo: AuthenticationRepository): + root_keys_infos = list_keys_of_role(str(auth_repo.path), "root") + assert len(root_keys_infos) == 3 + targets_keys_infos = list_keys_of_role(str(auth_repo.path), "targets") + assert len(targets_keys_infos) == 2 + snapshot_keys_infos = list_keys_of_role(str(auth_repo.path), "snapshot") + assert len(snapshot_keys_infos) == 1 + timestamp_keys_infos = list_keys_of_role(str(auth_repo.path), "timestamp") + assert len(timestamp_keys_infos) == 1 + + +def test_add_signing_key(auth_repo: AuthenticationRepository, roles_keystore: str): + auth_repo = AuthenticationRepository(path=auth_repo.path) + initial_commits_num = len(auth_repo.list_commits()) + # for testing purposes, add targets signing key to timestamp and snapshot roles + pub_key_path = Path(roles_keystore, "targets1.pub") + COMMIT_MSG = "Add new timestamp and snapshot signing key" + add_signing_key( + path=str(auth_repo.path), + pub_key_path=str(pub_key_path), + roles=["timestamp", "snapshot"], + keystore=roles_keystore, + push=False, + commit_msg=COMMIT_MSG, + ) + commits = auth_repo.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == COMMIT_MSG + timestamp_keys_infos = list_keys_of_role(str(auth_repo.path), "timestamp") + assert len(timestamp_keys_infos) == 2 + snapshot_keys_infos = list_keys_of_role(str(auth_repo.path), "snapshot") + assert len(snapshot_keys_infos) == 2 + + +def test_revoke_signing_key(auth_repo: AuthenticationRepository, roles_keystore: str): + auth_repo = AuthenticationRepository(path=auth_repo.path) + targest_keyids = auth_repo.get_keyids_of_role("targets") + key_to_remove = targest_keyids[-1] + initial_commits_num = len(auth_repo.list_commits()) + targets_keys_infos = list_keys_of_role(str(auth_repo.path), "targets") + assert len(targets_keys_infos) == 2 + COMMIT_MSG = "Revoke a targets key" + revoke_signing_key( + path=str(auth_repo.path), + key_id=key_to_remove, + keystore=roles_keystore, + push=False, + commit_msg=COMMIT_MSG, + ) + commits = auth_repo.list_commits() + assert len(commits) == initial_commits_num + 1 + targets_keys_infos = list_keys_of_role(str(auth_repo.path), "targets") + assert len(targets_keys_infos) == 1 + assert commits[0].message.strip() == COMMIT_MSG diff --git a/taf/tests/test_api/roles/cli/__init__.py b/taf/tests/test_api/roles/cli/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/taf/tests/test_api/roles/cli/test_roles_cmds.py b/taf/tests/test_api/roles/cli/test_roles_cmds.py new file mode 100644 index 000000000..3d5804f00 --- /dev/null +++ b/taf/tests/test_api/roles/cli/test_roles_cmds.py @@ -0,0 +1,198 @@ +import json + +from pathlib import Path + +from click.testing import CliRunner + +from taf.api.roles import list_keys_of_role +from taf.tests.test_api.util import check_new_role +from taf.tools.cli.taf import taf + + +def test_roles_add_cmd_expect_success(auth_repo_with_delegations, roles_keystore): + runner = CliRunner() + + with runner.isolated_filesystem(): + # cli expects a config file, so we manually create config pass it to the cli + cwd = Path.cwd() + config = { + "parent_role": "targets", + "delegated_path": [ + "/delegated_path_inside_targets1", + "/delegated_path_inside_targets2", + ], + "keys_number": 2, + "threshold": 1, + "yubikey": False, + "scheme": "rsa-pkcs1v15-sha256", + } + config_file_path = cwd / "config.json" + with open(config_file_path, "w") as f: + json.dump(config, f) + runner.invoke( + taf, + [ + "roles", + "add", + "new_role", + "--path", + f"{str(auth_repo_with_delegations.path)}", + "--config-file", + f"{str(config_file_path)}", + "--keystore", + f"{str(roles_keystore)}", + ], + ) + check_new_role( + auth_repo_with_delegations, + "new_role", + ["/delegated_path_inside_targets1", "/delegated_path_inside_targets2"], + str(roles_keystore), + "targets", + ) + + +def test_roles_add_multiple_cmd_expect_success( + auth_repo, with_delegations_no_yubikeys_path, roles_keystore +): + runner = CliRunner() + + with runner.isolated_filesystem(): + runner.invoke( + taf, + [ + "roles", + "add-multiple", + f"{str(with_delegations_no_yubikeys_path)}", + "--path", + f"{str(auth_repo.path)}", + "--keystore", + f"{str(roles_keystore)}", + ], + ) + new_roles = ["delegated_role", "inner_role"] + target_roles = auth_repo.get_all_targets_roles() + for role_name in new_roles: + assert role_name in target_roles + assert auth_repo.find_delegated_roles_parent("delegated_role") == "targets" + assert auth_repo.find_delegated_roles_parent("inner_role") == "delegated_role" + + +def test_roles_add_role_paths_cmd_expect_success( + auth_repo_with_delegations, roles_keystore +): + runner = CliRunner() + + with runner.isolated_filesystem(): + new_paths = ["some-path3"] + role_name = "delegated_role" + runner.invoke( + taf, + [ + "roles", + "add-role-paths", + f"{role_name}", + "--path", + f"{str(auth_repo_with_delegations.path)}", + "--delegated-path", + f"{new_paths[0]}", + "--keystore", + f"{str(roles_keystore)}", + ], + ) + roles_paths = auth_repo_with_delegations.get_role_paths(role_name) + assert len(roles_paths) == 3 + assert "some-path3" in roles_paths + + +def test_roles_add_signing_key_cmd_expect_success(auth_repo, roles_keystore): + runner = CliRunner() + + with runner.isolated_filesystem(): + pub_key_path = Path(roles_keystore, "targets1.pub") + runner.invoke( + taf, + [ + "roles", + "add-signing-key", + "--path", + f"{str(auth_repo.path)}", + "--role", + "snapshot", + "--role", + "timestamp", + "--pub-key-path", + f"{pub_key_path}", + "--keystore", + f"{str(roles_keystore)}", + "--no-commit", + ], + ) + timestamp_keys_infos = list_keys_of_role(str(auth_repo.path), "timestamp") + assert len(timestamp_keys_infos) == 2 + snapshot_keys_infos = list_keys_of_role(str(auth_repo.path), "snapshot") + assert len(snapshot_keys_infos) == 2 + + +def test_revoke_key_cmd_expect_success(auth_repo, roles_keystore): + runner = CliRunner() + + targets_keys_infos = list_keys_of_role(str(auth_repo.path), "targets") + assert len(targets_keys_infos) == 2 + + with runner.isolated_filesystem(): + targest_keyids = auth_repo.get_keyids_of_role("targets") + key_to_remove = targest_keyids[-1] + runner.invoke( + taf, + [ + "roles", + "revoke-key", + f"{key_to_remove}", + "--path", + f"{str(auth_repo.path)}", + "--keystore", + f"{str(roles_keystore)}", + "--no-commit", + ], + ) + targets_keys_infos = list_keys_of_role(str(auth_repo.path), "targets") + assert len(targets_keys_infos) == 1 + # reset to head so that next test can run as expected + auth_repo.reset_to_head() + + +def test_rotate_key_cmd_expect_success(auth_repo, roles_keystore): + runner = CliRunner() + + with runner.isolated_filesystem(): + targest_keyids = auth_repo.get_keyids_of_role("targets") + key_to_rotate = targest_keyids[-1] + pub_key_path = Path(roles_keystore, "delegated_role1.pub") + + assert len(targest_keyids) == 2 + + runner.invoke( + taf, + [ + "roles", + "rotate-key", + f"{key_to_rotate}", + "--path", + f"{str(auth_repo.path)}", + "--pub-key-path", + f"{pub_key_path}", + "--keystore", + f"{str(roles_keystore)}", + "--revoke-commit-msg", + "Remove targets key", + "--add-commit-msg", + "Add signing key", + ], + ) + new_targets_keyids = auth_repo.get_keyids_of_role("targets") + + assert len(new_targets_keyids) == 2 + # TODO: this assert does not pass. I assumed that the rotated key would not be in targets keyids, + # but I might have misunderstood what I needed to assert + assert key_to_rotate not in new_targets_keyids diff --git a/taf/tests/test_api/targets/__init__.py b/taf/tests/test_api/targets/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/taf/tests/test_api/targets/api/__init__.py b/taf/tests/test_api/targets/api/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/taf/tests/test_api/targets/api/test_targets.py b/taf/tests/test_api/targets/api/test_targets.py new file mode 100644 index 000000000..37201825a --- /dev/null +++ b/taf/tests/test_api/targets/api/test_targets.py @@ -0,0 +1,257 @@ +from pathlib import Path + +from taf.constants import TARGETS_DIRECTORY_NAME +from taf.messages import git_commit_message +import taf.repositoriesdb as repositoriesdb +from taf.auth_repo import AuthenticationRepository + +from taf.api.targets import ( + add_target_repo, + register_target_files, + update_target_repos_from_repositories_json, +) +from taf.tests.test_api.util import ( + check_if_targets_signed, + check_target_file, +) + + +AUTH_REPO_NAME = "auth" + + +def test_register_targets_when_file_added( + auth_repo_when_add_repositories_json: AuthenticationRepository, + library: Path, + keystore_delegations: str, +): + repo_path = library / "auth" + initial_commits_num = len(auth_repo_when_add_repositories_json.list_commits()) + FILENAME = "test.txt" + # add a new file to the targets directory, check if it was signed + file_path = repo_path / TARGETS_DIRECTORY_NAME / FILENAME + file_path.write_text("test") + register_target_files( + repo_path, keystore_delegations, update_snapshot_and_timestamp=True, push=False + ) + check_if_targets_signed(auth_repo_when_add_repositories_json, "targets", FILENAME) + commits = auth_repo_when_add_repositories_json.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message("update-targets") + + +def test_register_targets_when_file_removed( + auth_repo_when_add_repositories_json: AuthenticationRepository, + library: Path, + keystore_delegations: str, +): + repo_path = library / "auth" + initial_commits_num = len(auth_repo_when_add_repositories_json.list_commits()) + FILENAME = "test.txt" + # add a new file to the targets directory, check if it was signed + file_path = repo_path / TARGETS_DIRECTORY_NAME / FILENAME + file_path.write_text("test") + register_target_files( + repo_path, keystore_delegations, update_snapshot_and_timestamp=True, push=False + ) + file_path.unlink() + register_target_files( + repo_path, keystore_delegations, update_snapshot_and_timestamp=True, push=False + ) + signed_target_files = auth_repo_when_add_repositories_json.get_signed_target_files() + assert FILENAME not in signed_target_files + commits = auth_repo_when_add_repositories_json.list_commits() + assert len(commits) == initial_commits_num + 2 + assert commits[0].message.strip() == git_commit_message("update-targets") + + +def test_update_target_repos_from_repositories_json( + auth_repo_when_add_repositories_json: AuthenticationRepository, + library: Path, + keystore_delegations: str, +): + repo_path = library / "auth" + initial_commits_num = len(auth_repo_when_add_repositories_json.list_commits()) + namespace = library.name + update_target_repos_from_repositories_json( + str(repo_path), + str(library.parent), + keystore_delegations, + push=False, + ) + # this should create target files and save commit and branch to them, then sign + for name in ("target1", "target2", "target3"): + target_repo_name = f"{namespace}/{name}" + target_repo_path = library.parent / target_repo_name + assert check_target_file( + target_repo_path, target_repo_name, auth_repo_when_add_repositories_json + ) + commits = auth_repo_when_add_repositories_json.list_commits() + assert len(commits) == initial_commits_num + 1 + assert commits[0].message.strip() == git_commit_message("update-targets") + + +def test_add_target_repository_when_not_on_filesystem( + auth_repo_when_add_repositories_json: AuthenticationRepository, + library: Path, + keystore_delegations: str, +): + repo_path = str(library / "auth") + initial_commits_num = len(auth_repo_when_add_repositories_json.list_commits()) + namespace = library.name + target_repo_name = f"{namespace}/target4" + add_target_repo( + str(repo_path), + None, + target_repo_name, + "delegated_role", + None, + keystore_delegations, + push=False, + should_create_new_role=True, + ) + # verify repositories.json was updated and that changes were committed + # then validate the repository + repositories_json = repositoriesdb.load_repositories_json( + auth_repo_when_add_repositories_json + ) + assert repositories_json is not None + repositories = repositories_json["repositories"] + assert target_repo_name in repositories + commits = auth_repo_when_add_repositories_json.list_commits() + assert len(commits) == initial_commits_num + 2 + assert commits[0].message.strip() == git_commit_message( + "add-target", target_name=target_repo_name + ) + delegated_paths = auth_repo_when_add_repositories_json.get_paths_of_role( + "delegated_role" + ) + assert target_repo_name in delegated_paths + + +def test_add_target_repository_when_on_filesystem( + auth_repo_when_add_repositories_json: AuthenticationRepository, + library: Path, + keystore_delegations: str, +): + repo_path = str(library / "auth") + initial_commits_num = len(auth_repo_when_add_repositories_json.list_commits()) + namespace = library.name + target_repo_name = f"{namespace}/new_target" + add_target_repo( + repo_path, + None, + target_repo_name, + "delegated_role", + None, + keystore_delegations, + push=False, + should_create_new_role=True, + ) + # verify repositories.json was updated and that changes were committed + # then validate the repository + repositories_json = repositoriesdb.load_repositories_json( + auth_repo_when_add_repositories_json + ) + assert repositories_json is not None + repositories = repositories_json["repositories"] + assert target_repo_name in repositories + commits = auth_repo_when_add_repositories_json.list_commits() + assert len(commits) == initial_commits_num + 2 + assert commits[0].message.strip() == git_commit_message( + "add-target", target_name=target_repo_name + ) + delegated_paths = auth_repo_when_add_repositories_json.get_paths_of_role( + "delegated_role" + ) + assert target_repo_name in delegated_paths + + +# def test_remove_target_repository_when_not_on_filesystem( +# auth_repo_when_add_repositories_json: AuthenticationRepository, +# library: Path, +# keystore_delegations: str, +# ): +# repo_path = str(library / "auth") +# initial_commits_num = len(auth_repo_when_add_repositories_json.list_commits()) +# namespace = library.name +# target_repo_name = f"{namespace}/target4" +# repositories_json = repositoriesdb.load_repositories_json( +# auth_repo_when_add_repositories_json +# ) +# assert repositories_json is not None +# repositories = repositories_json["repositories"] +# assert target_repo_name in repositories +# remove_target_repo( +# str(repo_path), +# target_repo_name, +# keystore_delegations, +# push=False, +# ) +# # verify repositories.json was updated and that changes were committed +# # then validate the repository +# # target repo should not be in the newest repositories.json +# repositories_json = repositoriesdb.load_repositories_json( +# auth_repo_when_add_repositories_json +# ) +# assert repositories_json is not None +# repositories = repositories_json["repositories"] +# assert target_repo_name not in repositories +# commits = auth_repo_when_add_repositories_json.list_commits() +# # this function is expected to commit twice +# assert len(commits) == initial_commits_num + 2 +# assert commits[1].message.strip() == git_commit_message( +# "remove-target", target_name=target_repo_name +# ) +# assert commits[0].message.strip() == git_commit_message( +# "remove-from-delegated-paths", target_name=target_repo_name +# ) +# delegated_paths = auth_repo_when_add_repositories_json.get_paths_of_role( +# "delegated_role" +# ) +# assert target_repo_name not in delegated_paths + + +# def test_remove_target_repository_when_on_filesystem( +# auth_repo_when_add_repositories_json: AuthenticationRepository, +# library: Path, +# keystore_delegations: str, +# ): +# repo_path = str(library / "auth") +# initial_commits_num = len(auth_repo_when_add_repositories_json.list_commits()) +# namespace = library.name +# target_repo_name = f"{namespace}/new_target" +# repositories_json = repositoriesdb.load_repositories_json( +# auth_repo_when_add_repositories_json +# ) +# assert repositories_json is not None +# repositories = repositories_json["repositories"] +# assert target_repo_name in repositories +# remove_target_repo( +# str(repo_path), +# target_repo_name, +# keystore_delegations, +# push=False, +# ) +# # verify that repositories.json was updated and that changes were committed +# # then validate the repository +# # target repo should not be in the newest repositories.json +# repositories_json = repositoriesdb.load_repositories_json( +# auth_repo_when_add_repositories_json +# ) +# assert repositories_json is not None +# repositories = repositories_json["repositories"] +# assert target_repo_name not in repositories +# commits = auth_repo_when_add_repositories_json.list_commits() +# # this function is expected to commit twice +# assert len(commits) == initial_commits_num + 2 +# assert commits[1].message.strip() == git_commit_message( +# "remove-target", target_name=target_repo_name +# ) +# assert commits[0].message.strip() == git_commit_message( +# "remove-from-delegated-paths", target_name=target_repo_name +# ) +# delegated_paths = auth_repo_when_add_repositories_json.get_paths_of_role( +# "delegated_role" +# ) +# assert target_repo_name not in delegated_paths +# assert not Path(repo_path, TARGETS_DIRECTORY_NAME, target_repo_name).is_file() diff --git a/taf/tests/test_api/targets/cli/__init__.py b/taf/tests/test_api/targets/cli/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/taf/tests/test_api/targets/cli/test_targets_cmds.py b/taf/tests/test_api/targets/cli/test_targets_cmds.py new file mode 100644 index 000000000..9345a8872 --- /dev/null +++ b/taf/tests/test_api/targets/cli/test_targets_cmds.py @@ -0,0 +1,126 @@ +import json +from pathlib import Path + +from click.testing import CliRunner + +from taf.constants import TARGETS_DIRECTORY_NAME +from taf.tests.test_api.util import check_if_targets_signed +from taf.tools.cli.taf import taf + + +def test_targets_sign_when_target_file_is_added_expect_success( + auth_repo_when_add_repositories_json, + library, + keystore_delegations, +): + runner = CliRunner() + + repo_path = library / "auth" + FILENAME = "test.txt" + file_path = repo_path / TARGETS_DIRECTORY_NAME / FILENAME + file_path.write_text("test") + + runner.invoke( + taf, + [ + "targets", + "sign", + "--path", + f"{str(auth_repo_when_add_repositories_json.path)}", + "--keystore", + f"{str(keystore_delegations)}", + ], + ) + + check_if_targets_signed(auth_repo_when_add_repositories_json, "targets", FILENAME) + + +def test_targets_sign_when_target_file_is_removed_expect_success( + auth_repo_when_add_repositories_json, + library, + keystore_delegations, +): + runner = CliRunner() + + repo_path = library / "auth" + FILENAME = "test.txt" + file_path = repo_path / TARGETS_DIRECTORY_NAME / FILENAME + file_path.write_text("test") + + runner.invoke( + taf, + [ + "targets", + "sign", + "--path", + f"{str(auth_repo_when_add_repositories_json.path)}", + "--keystore", + f"{str(keystore_delegations)}", + ], + ) + check_if_targets_signed(auth_repo_when_add_repositories_json, "targets", FILENAME) + + file_path.unlink() + + runner.invoke( + taf, + [ + "targets", + "sign", + "--path", + f"{str(auth_repo_when_add_repositories_json.path)}", + "--keystore", + f"{str(keystore_delegations)}", + ], + ) + + signed_target_files = auth_repo_when_add_repositories_json.get_signed_target_files() + assert FILENAME not in signed_target_files + + +def test_targets_add_repo_cmd_expect_success( + auth_repo_when_add_repositories_json, library, keystore_delegations +): + runner = CliRunner() + + namespace = library.name + target_repo_name = f"{namespace}/target4" + + with runner.isolated_filesystem(): + # cli expects a config file, so we manually create config pass it to the cli + cwd = Path.cwd() + config = { + "allow-unauthenticated-commits": True, + "type": "html", + "serve": "latest", + "location_regex": "/", + "routes": [".*"], + } + config_file_path = cwd / "config.json" + with open(config_file_path, "w") as f: + json.dump(config, f) + runner.invoke( + taf, + [ + "targets", + "add-repo", + f"{target_repo_name}", + "--role", + "delegated_role", + "--path", + f"{str(auth_repo_when_add_repositories_json.path)}", + "--custom-file", + f"{str(config_file_path)}", + "--keystore", + f"{str(keystore_delegations)}", + ], + ) + delegated_paths = auth_repo_when_add_repositories_json.get_paths_of_role( + "delegated_role" + ) + assert target_repo_name in delegated_paths + + +def test_targets_remove_repo_cmd_expect_success(): + # TODO: seems like it is not fully supported yet + pass diff --git a/taf/tests/test_api/test_metadata.py b/taf/tests/test_api/test_metadata.py deleted file mode 100644 index ab580384e..000000000 --- a/taf/tests/test_api/test_metadata.py +++ /dev/null @@ -1,170 +0,0 @@ -import datetime -import shutil -import uuid -from freezegun import freeze_time -from pathlib import Path -from typing import Dict -from taf.messages import git_commit_message -from taf.auth_repo import AuthenticationRepository -from pytest import fixture -from taf.api.repository import create_repository -from taf.tests.conftest import CLIENT_DIR_PATH -from taf.utils import on_rm_error -from taf.api.metadata import check_expiration_dates, update_metadata_expiration_date - - -AUTH_REPO_NAME = "auth" - - -@fixture(scope="module") -def auth_repo_path(): - random_name = str(uuid.uuid4()) - root_dir = CLIENT_DIR_PATH / random_name - auth_path = root_dir / AUTH_REPO_NAME - auth_path.mkdir(exist_ok=True, parents=True) - yield auth_path - shutil.rmtree(root_dir, onerror=on_rm_error) - - -@freeze_time("2021-12-31") -def test_setup_auth_repo_expired( - auth_repo_path: Path, - with_delegations_no_yubikeys_path: str, - api_keystore: str, -): - - create_repository( - str(auth_repo_path), - roles_key_infos=with_delegations_no_yubikeys_path, - keystore=api_keystore, - commit=True, - ) - - -@freeze_time("2023-01-01") -def test_check_expiration_date_when_all_expired(auth_repo_path: Path): - expired, will_expire = check_expiration_dates(auth_repo_path, print_output=False) - start = datetime.datetime(2021, 12, 31) - # expect expire after 1 day - _check_expired_role("timestamp", start, 1, expired) - # expect expired after 7 days - _check_expired_role("snapshot", start, 7, expired) - # expect expire after 3 months - for target_role in ("targets", "delegated_role", "inner_role"): - _check_expired_role(target_role, start, 91, expired) - # expect expire after one year - _check_expired_role("root", start, 365, expired) - assert not len(will_expire) - - -@freeze_time("2023-01-01") -def test_update_root_metadata(auth_repo_path: Path, api_keystore: str): - # update root metadata, expect snapshot and timestamp to be updated too - # targets should not be updated - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - roles = ["root"] - INTERVAL = 180 - update_metadata_expiration_date( - path=auth_repo_path, - roles=roles, - interval=INTERVAL, - keystore=api_keystore, - push=False, - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message( - "update-expiration-dates", roles=",".join(roles) - ) - for role in ("root", "snapshot", "timestamp"): - expected_expiration = _get_date(INTERVAL) - actual_expiration = auth_repo.get_expiration_date(role) - assert expected_expiration == actual_expiration - now = datetime.datetime.now() - for role in ("targets", "delegated_role", "inner_role"): - actual_expiration = auth_repo.get_expiration_date(role) - assert actual_expiration < now - - -@freeze_time("2023-01-01") -def test_check_expiration_date_when_expired_and_will_expire(auth_repo_path: Path): - expired, will_expire = check_expiration_dates( - auth_repo_path, interval=90, print_output=False - ) - - start = datetime.datetime(2021, 12, 31) - # target roles have not been updated yet - for target_role in ("targets", "delegated_role", "inner_role"): - _check_expired_role(target_role, start, 91, expired) - - # other roles are not due to expire in the specified interval - assert not len(will_expire) - - # now set a larger interval, all roles are due to expire before the interval's end - _, will_expire = check_expiration_dates( - auth_repo_path, interval=365, print_output=False - ) - assert len(will_expire) == 3 - for role in ("root", "snapshot", "timestamp"): - assert role in will_expire - - -@freeze_time("2023-01-01") -def test_update_multiple_roles_metadata(auth_repo_path: Path, api_keystore: str): - # update root metadata, expect snapshot and timestamp to be updated too - # targets should not be updated - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - roles = ["targets", "delegated_role", "inner_role"] - INTERVAL = 365 - update_metadata_expiration_date( - path=auth_repo_path, - roles=roles, - interval=INTERVAL, - keystore=api_keystore, - push=False, - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message( - "update-expiration-dates", roles=",".join(roles) - ) - for role in roles + ["snapshot", "timestamp"]: - expected_expiration = _get_date(INTERVAL) - actual_expiration = auth_repo.get_expiration_date(role) - assert expected_expiration == actual_expiration - - -@freeze_time("2023-01-01") -def test_check_expiration_date_when_no_expired(auth_repo_path: Path): - expired, will_expire = check_expiration_dates( - auth_repo_path, interval=90, print_output=False - ) - assert not len(expired) - assert not len(will_expire) - - -def _check_expired_role( - role_name: str, start_time: datetime.datetime, interval: int, expired_dict: Dict -): - assert role_name in expired_dict - expected_expiration_date = start_time + datetime.timedelta(days=interval) - actual_expiration_time = expired_dict[role_name] - # strip hours and minutes, they are set in case of targets and root - actual_expiration_date = _strip_hours(actual_expiration_time) - assert expected_expiration_date == actual_expiration_date - - -def _get_date(interval): - now = datetime.datetime.now() - date = now + datetime.timedelta(interval) - return _strip_hours(date) - - -def _strip_hours(date): - return datetime.datetime( - date.year, - date.month, - date.day, - ) diff --git a/taf/tests/test_api/test_roles.py b/taf/tests/test_api/test_roles.py deleted file mode 100644 index e8d3c4d77..000000000 --- a/taf/tests/test_api/test_roles.py +++ /dev/null @@ -1,328 +0,0 @@ -import shutil -import uuid -from pathlib import Path -from typing import List -from taf.api.roles import ( - add_role, - add_role_paths, - add_multiple_roles, - add_signing_key, - list_keys_of_role, - remove_paths, - remove_role, -) -from taf.api.targets import register_target_files -from taf.messages import git_commit_message -from taf.auth_repo import AuthenticationRepository -from pytest import fixture -from taf.api.repository import create_repository -from taf.tests.conftest import CLIENT_DIR_PATH, KEYSTORES_PATH -from taf.tests.test_api.conftest import KEYSTORE_PATH -from taf.tests.test_api.util import check_if_targets_signed -from taf.utils import on_rm_error -from tuf.repository_tool import TARGETS_DIRECTORY_NAME - - -AUTH_REPO_NAME = "auth" - - -@fixture(scope="module") -def auth_repo_path(): - random_name = str(uuid.uuid4()) - root_dir = CLIENT_DIR_PATH / random_name - auth_path = root_dir / AUTH_REPO_NAME - auth_path.mkdir(exist_ok=True, parents=True) - yield auth_path - shutil.rmtree(root_dir, onerror=on_rm_error) - - -@fixture(scope="module") -def roles_keystore(): - # set up a keystore by copying the api keystore - # new keystore files are expected to be created and store to this directory - # it will be removed once this test's execution is done - # Create the destination folder if it doesn't exist - roles_keystore = KEYSTORES_PATH / "roles_keystore" - if roles_keystore.is_dir(): - shutil.rmtree(str(roles_keystore)) - - # Copy the contents of the source folder to the destination folder - shutil.copytree(KEYSTORE_PATH, str(roles_keystore)) - yield str(roles_keystore) - shutil.rmtree(str(roles_keystore)) - - -def test_setup_auth_repo( - auth_repo_path: Path, - no_yubikeys_path: str, - roles_keystore: str, -): - create_repository( - str(auth_repo_path), - roles_key_infos=no_yubikeys_path, - keystore=roles_keystore, - commit=True, - ) - - -def test_add_role_when_target_is_parent(auth_repo_path: Path, roles_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - ROLE_NAME = "new_role" - PATHS = ["some-path1", "some-path2"] - PARENT_NAME = "targets" - add_role( - path=str(auth_repo_path), - auth_repo=auth_repo, - role=ROLE_NAME, - parent_role=PARENT_NAME, - paths=PATHS, - keys_number=2, - threshold=1, - yubikey=False, - keystore=roles_keystore, - push=False, - skip_prompt=True, - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message("add-role", role=ROLE_NAME) - _check_new_role(auth_repo, ROLE_NAME, PATHS, roles_keystore, PARENT_NAME) - - -def test_add_role_when_delegated_role_is_parent( - auth_repo_path: Path, roles_keystore: str -): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - ROLE_NAME = "new_inner_role" - PATHS = ["inner-path1", "inner-path2"] - PARENT_NAME = "new_role" - add_role( - path=str(auth_repo_path), - auth_repo=auth_repo, - role=ROLE_NAME, - parent_role=PARENT_NAME, - paths=PATHS, - keys_number=2, - threshold=1, - yubikey=False, - keystore=roles_keystore, - push=False, - skip_prompt=True, - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message("add-role", role=ROLE_NAME) - _check_new_role(auth_repo, ROLE_NAME, PATHS, roles_keystore, PARENT_NAME) - - -def test_add_multiple_roles( - auth_repo_path: Path, roles_keystore: str, with_delegations_no_yubikeys_path: str -): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - add_multiple_roles( - path=str(auth_repo_path), - keystore=roles_keystore, - roles_key_infos=with_delegations_no_yubikeys_path, - push=False, - ) - # with_delegations_no_yubikeys_path specification contains delegated_role and inner_role - # definitions, so these two roles should get added to the repository - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - new_roles = ["delegated_role", "inner_role"] - assert commits[0].message.strip() == git_commit_message( - "add-roles", roles=", ".join(new_roles) - ) - target_roles = auth_repo.get_all_targets_roles() - for role_name in new_roles: - assert role_name in target_roles - assert auth_repo.find_delegated_roles_parent("delegated_role") == "targets" - assert auth_repo.find_delegated_roles_parent("inner_role") == "delegated_role" - - -def test_add_role_paths(auth_repo_path: Path, roles_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - NEW_PATHS = ["some-path3"] - ROLE_NAME = "new_role" - add_role_paths( - auth_repo=auth_repo, - paths=NEW_PATHS, - keystore=roles_keystore, - delegated_role="new_role", - push=False, - ) - - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message( - "add-role-paths", paths=", ".join(NEW_PATHS), role=ROLE_NAME - ) - roles_paths = auth_repo.get_role_paths(ROLE_NAME) - assert len(roles_paths) == 3 - assert "some-path3" in roles_paths - - -def test_remove_role_paths(auth_repo_path: Path, roles_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - REMOVED_PATHS = ["some-path1"] - ROLE_NAME = "new_role" - remove_paths( - path=str(auth_repo_path), - paths=REMOVED_PATHS, - keystore=roles_keystore, - push=False, - ) - - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message( - "remove-role-paths", paths=", ".join(REMOVED_PATHS), role=ROLE_NAME - ) - roles_paths = auth_repo.get_role_paths(ROLE_NAME) - assert len(roles_paths) == 2 - assert "some-path1" not in roles_paths - - -def test_remove_role_when_no_targets(auth_repo_path: Path, roles_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - ROLE_NAME = "inner_role" - remove_role( - path=str(auth_repo_path), - role=ROLE_NAME, - keystore=roles_keystore, - push=False, - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message( - "remove-role", role=ROLE_NAME - ) - - -def test_remove_role_when_remove_targets(auth_repo_path: Path, roles_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - ROLE_NAME = "delegated_role" - # add target files which match the delegated role's paths - # one is a glob dir1/* - # the second one is dir2/path1 - FILENAME1 = "test.txt" - FILENAME2 = "path1" - # add a new file to the targets directory, check if it was signed - # make sure the path was delegated to delegated_role - file_dir1 = auth_repo_path / TARGETS_DIRECTORY_NAME / "dir1" - file_dir2 = auth_repo_path / TARGETS_DIRECTORY_NAME / "dir2" - file_dir1.mkdir() - file_dir2.mkdir() - file_path1 = file_dir1 / FILENAME1 - file_path1.write_text("test") - file_path2 = file_dir2 / FILENAME2 - file_path2.write_text("test") - register_target_files(auth_repo_path, roles_keystore, write=True, push=False) - check_if_targets_signed( - auth_repo, ROLE_NAME, f"dir1/{FILENAME1}", f"dir2/{FILENAME2}" - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - remove_role( - path=str(auth_repo_path), - role=ROLE_NAME, - keystore=roles_keystore, - push=False, - remove_targets=True, - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 2 - assert commits[0].message.strip() == git_commit_message( - "remove-role", role=ROLE_NAME - ) - assert not file_path1.is_file() - assert not file_path2.is_file() - - -def test_remove_role_when_keep_targets(auth_repo_path: Path, roles_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - ROLE_NAME = "new_role" - # add target file which matches the delegated role's paths - FILENAME = "some-path2" - # add a new file to the targets directory, check if it was signed - # make sure the path was delegated to delegated_role - file_path = auth_repo_path / TARGETS_DIRECTORY_NAME / FILENAME - file_path.write_text("test") - register_target_files(auth_repo_path, roles_keystore, write=True, push=False) - check_if_targets_signed(auth_repo, ROLE_NAME, FILENAME) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - remove_role( - path=str(auth_repo_path), - role=ROLE_NAME, - keystore=roles_keystore, - push=False, - remove_targets=False, - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 2 - assert commits[0].message.strip() == git_commit_message( - "remove-role", role=ROLE_NAME - ) - assert file_path.is_file() - - -def test_list_keys(auth_repo_path: Path): - root_keys_infos = list_keys_of_role(str(auth_repo_path), "root") - assert len(root_keys_infos) == 3 - targets_keys_infos = list_keys_of_role(str(auth_repo_path), "targets") - assert len(targets_keys_infos) == 2 - snapshot_keys_infos = list_keys_of_role(str(auth_repo_path), "snapshot") - assert len(snapshot_keys_infos) == 1 - timestamp_keys_infos = list_keys_of_role(str(auth_repo_path), "timestamp") - assert len(timestamp_keys_infos) == 1 - - -def test_add_signing_key(auth_repo_path: Path, roles_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - initial_commits_num = len(auth_repo.list_commits()) - # for testing purposes, add targets signing key to timestamp and snapshot roles - pub_key_path = Path(roles_keystore, "targets1.pub") - COMMIT_MSG = "Add new timestamp and snapshot signing key" - add_signing_key( - path=str(auth_repo_path), - pub_key_path=str(pub_key_path), - roles=["timestamp", "snapshot"], - keystore=roles_keystore, - push=False, - commit_msg=COMMIT_MSG, - ) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == COMMIT_MSG - timestamp_keys_infos = list_keys_of_role(str(auth_repo_path), "timestamp") - assert len(timestamp_keys_infos) == 2 - snapshot_keys_infos = list_keys_of_role(str(auth_repo_path), "snapshot") - assert len(snapshot_keys_infos) == 2 - - -def _check_new_role( - auth_repo: AuthenticationRepository, - role_name: str, - paths: List[str], - keystore_path: str, - parent_name: str, -): - # check if keys were created - assert Path(keystore_path, f"{role_name}1").is_file() - assert Path(keystore_path, f"{role_name}2").is_file() - assert Path(keystore_path, f"{role_name}1.pub").is_file() - assert Path(keystore_path, f"{role_name}2.pub").is_file() - target_roles = auth_repo.get_all_targets_roles() - assert role_name in target_roles - assert auth_repo.find_delegated_roles_parent(role_name) == parent_name - roles_paths = auth_repo.get_role_paths(role_name) - assert roles_paths == paths diff --git a/taf/tests/test_api/test_targets.py b/taf/tests/test_api/test_targets.py deleted file mode 100644 index a3fd14832..000000000 --- a/taf/tests/test_api/test_targets.py +++ /dev/null @@ -1,259 +0,0 @@ -from pathlib import Path -import shutil -from typing import Dict -import uuid -from taf.messages import git_commit_message -import taf.repositoriesdb as repositoriesdb -from taf.auth_repo import AuthenticationRepository -from taf.git import GitRepository -from pytest import fixture -from taf.api.repository import create_repository -from taf.api.targets import ( - add_target_repo, - register_target_files, - remove_target_repo, - update_target_repos_from_repositories_json, -) -from taf.tests.conftest import CLIENT_DIR_PATH -from taf.tests.test_api.util import ( - check_if_targets_signed, - copy_mirrors_json, - copy_repositories_json, - check_target_file, -) -from taf.utils import on_rm_error -from tuf.repository_tool import TARGETS_DIRECTORY_NAME - - -AUTH_REPO_NAME = "auth" - - -@fixture(scope="module") -def library(): - random_name = str(uuid.uuid4()) - root_dir = CLIENT_DIR_PATH / random_name - # create an initialize some target repositories - # their content is not important - auth_path = root_dir / AUTH_REPO_NAME - auth_path.mkdir(exist_ok=True, parents=True) - targets = ("target1", "target2", "target3", "new_target") - for target in targets: - target_repo_path = root_dir / target - target_repo_path.mkdir() - target_repo = GitRepository(path=target_repo_path) - target_repo.init_repo() - target_repo.commit_empty("Initial commit") - yield root_dir - shutil.rmtree(root_dir, onerror=on_rm_error) - - -def test_setup_auth_repo_when_add_repositories_json( - library: Path, - with_delegations_no_yubikeys_path: str, - api_keystore: str, - repositories_json_template: Dict, - mirrors_json_path: Path, -): - repo_path = library / "auth" - namespace = library.name - copy_repositories_json(repositories_json_template, namespace, repo_path) - copy_mirrors_json(mirrors_json_path, repo_path) - - create_repository( - str(repo_path), - roles_key_infos=with_delegations_no_yubikeys_path, - keystore=api_keystore, - commit=True, - ) - - -def test_register_targets_when_file_added(library: Path, api_keystore: str): - repo_path = library / "auth" - auth_repo = AuthenticationRepository(path=repo_path) - initial_commits_num = len(auth_repo.list_commits()) - FILENAME = "test.txt" - # add a new file to the targets directory, check if it was signed - file_path = repo_path / TARGETS_DIRECTORY_NAME / FILENAME - file_path.write_text("test") - register_target_files(repo_path, api_keystore, write=True, push=False) - check_if_targets_signed(auth_repo, "targets", FILENAME) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message("update-targets") - - -def test_register_targets_when_file_removed(library: Path, api_keystore: str): - repo_path = library / "auth" - auth_repo = AuthenticationRepository(path=repo_path) - initial_commits_num = len(auth_repo.list_commits()) - FILENAME = "test.txt" - # add a new file to the targets directory, check if it was signed - file_path = repo_path / TARGETS_DIRECTORY_NAME / FILENAME - file_path.unlink() - register_target_files(repo_path, api_keystore, write=True, push=False) - signed_target_files = auth_repo.get_signed_target_files() - assert FILENAME not in signed_target_files - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message("update-targets") - - -def test_update_target_repos_from_repositories_json(library: Path, api_keystore: str): - repo_path = library / "auth" - auth_repo = AuthenticationRepository(path=repo_path) - initial_commits_num = len(auth_repo.list_commits()) - namespace = library.name - update_target_repos_from_repositories_json( - str(repo_path), - str(library.parent), - api_keystore, - push=False, - ) - # this should create target files and save commit and branch to them, then sign - for name in ("target1", "target2", "target3"): - target_repo_name = f"{namespace}/{name}" - target_repo_path = library.parent / target_repo_name - assert check_target_file(target_repo_path, target_repo_name, auth_repo) - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message("update-targets") - - -def test_add_target_repository_when_not_on_filesystem(library: Path, api_keystore: str): - repo_path = str(library / "auth") - auth_repo = AuthenticationRepository(path=repo_path) - initial_commits_num = len(auth_repo.list_commits()) - namespace = library.name - target_repo_name = f"{namespace}/target4" - add_target_repo( - str(repo_path), - None, - target_repo_name, - "delegated_role", - None, - api_keystore, - push=False, - ) - # verify repositories.json was updated and that changes were committed - # then validate the repository - repositories_json = repositoriesdb.load_repositories_json(auth_repo) - assert repositories_json is not None - repositories = repositories_json["repositories"] - assert target_repo_name in repositories - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message( - "add-target", target_name=target_repo_name - ) - delegated_paths = auth_repo.get_delegated_role_property("paths", "delegated_role") - assert target_repo_name in delegated_paths - - -def test_add_target_repository_when_on_filesystem(library: Path, api_keystore: str): - repo_path = str(library / "auth") - auth_repo = AuthenticationRepository(path=repo_path) - initial_commits_num = len(auth_repo.list_commits()) - namespace = library.name - target_repo_name = f"{namespace}/new_target" - add_target_repo( - repo_path, - None, - target_repo_name, - "delegated_role", - None, - api_keystore, - push=False, - ) - # verify repositories.json was updated and that changes were committed - # then validate the repository - repositories_json = repositoriesdb.load_repositories_json(auth_repo) - assert repositories_json is not None - repositories = repositories_json["repositories"] - assert target_repo_name in repositories - commits = auth_repo.list_commits() - assert len(commits) == initial_commits_num + 1 - assert commits[0].message.strip() == git_commit_message( - "add-target", target_name=target_repo_name - ) - signed_target_files = auth_repo.get_signed_target_files() - assert target_repo_name in signed_target_files - delegated_paths = auth_repo.get_delegated_role_property("paths", "delegated_role") - assert target_repo_name in delegated_paths - target_repo_path = library.parent / target_repo_name - assert check_target_file(target_repo_path, target_repo_name, auth_repo) - - -def test_remove_target_repository_when_not_on_filesystem( - library: Path, api_keystore: str -): - repo_path = str(library / "auth") - auth_repo = AuthenticationRepository(path=repo_path) - initial_commits_num = len(auth_repo.list_commits()) - namespace = library.name - target_repo_name = f"{namespace}/target4" - repositories_json = repositoriesdb.load_repositories_json(auth_repo) - assert repositories_json is not None - repositories = repositories_json["repositories"] - assert target_repo_name in repositories - remove_target_repo( - str(repo_path), - target_repo_name, - api_keystore, - push=False, - ) - # verify repositories.json was updated and that changes were committed - # then validate the repository - # target repo should not be in the newest repositories.json - repositories_json = repositoriesdb.load_repositories_json(auth_repo) - assert repositories_json is not None - repositories = repositories_json["repositories"] - assert target_repo_name not in repositories - commits = auth_repo.list_commits() - # this function is expected to commit twice - assert len(commits) == initial_commits_num + 2 - assert commits[1].message.strip() == git_commit_message( - "remove-target", target_name=target_repo_name - ) - assert commits[0].message.strip() == git_commit_message( - "remove-from-delegated-paths", target_name=target_repo_name - ) - delegated_paths = auth_repo.get_delegated_role_property("paths", "delegated_role") - assert target_repo_name not in delegated_paths - - -def test_remove_target_repository_when_on_filesystem(library: Path, api_keystore: str): - repo_path = str(library / "auth") - auth_repo = AuthenticationRepository(path=repo_path) - initial_commits_num = len(auth_repo.list_commits()) - namespace = library.name - target_repo_name = f"{namespace}/new_target" - repositories_json = repositoriesdb.load_repositories_json(auth_repo) - assert repositories_json is not None - repositories = repositories_json["repositories"] - assert Path(repo_path, TARGETS_DIRECTORY_NAME, target_repo_name).is_file() - assert target_repo_name in repositories - remove_target_repo( - str(repo_path), - target_repo_name, - api_keystore, - push=False, - ) - # verify that repositories.json was updated and that changes were committed - # then validate the repository - # target repo should not be in the newest repositories.json - repositories_json = repositoriesdb.load_repositories_json(auth_repo) - assert repositories_json is not None - repositories = repositories_json["repositories"] - assert target_repo_name not in repositories - commits = auth_repo.list_commits() - # this function is expected to commit twice - assert len(commits) == initial_commits_num + 2 - assert commits[1].message.strip() == git_commit_message( - "remove-target", target_name=target_repo_name - ) - assert commits[0].message.strip() == git_commit_message( - "remove-from-delegated-paths", target_name=target_repo_name - ) - delegated_paths = auth_repo.get_delegated_role_property("paths", "delegated_role") - assert target_repo_name not in delegated_paths - assert not Path(repo_path, TARGETS_DIRECTORY_NAME, target_repo_name).is_file() diff --git a/taf/tests/test_api/test_utils.py b/taf/tests/test_api/test_utils.py deleted file mode 100644 index 1fa674217..000000000 --- a/taf/tests/test_api/test_utils.py +++ /dev/null @@ -1,95 +0,0 @@ -import datetime -from pathlib import Path -import shutil -import uuid -from freezegun import freeze_time -from taf.api.repository import create_repository -from taf.api.utils._metadata import ( - update_snapshot_and_timestamp, - update_target_metadata, -) -from taf.auth_repo import AuthenticationRepository -from pytest import fixture -from taf.tests.conftest import CLIENT_DIR_PATH -from taf.tests.test_api.util import check_if_targets_removed, check_if_targets_signed -from taf.utils import on_rm_error -from tuf.repository_tool import TARGETS_DIRECTORY_NAME - - -AUTH_REPO_NAME = "auth" - -TARGET_FILE1 = "test1.txt" -TARGET_FILE2 = "test2.txt" -TARGET_FILE3 = "test3.txt" - - -@fixture(scope="module") -def auth_repo_path(): - random_name = str(uuid.uuid4()) - root_dir = CLIENT_DIR_PATH / random_name - auth_path = root_dir / AUTH_REPO_NAME - auth_path.mkdir(exist_ok=True, parents=True) - yield auth_path - shutil.rmtree(root_dir, onerror=on_rm_error) - - -def test_create_repository_with_targets( - auth_repo_path: Path, no_yubikeys_path: str, api_keystore: str -): - repo_path = str(auth_repo_path) - # add a new file to the targets directory, check if it was signed - targets_dir = auth_repo_path / TARGETS_DIRECTORY_NAME - targets_dir.mkdir() - file_path = targets_dir / TARGET_FILE1 - file_path.write_text("test1") - file_path = targets_dir / TARGET_FILE2 - file_path.write_text("test2") - create_repository( - repo_path, - roles_key_infos=no_yubikeys_path, - keystore=api_keystore, - commit=True, - ) - - -@freeze_time("2023-01-01") -def test_update_snapshot_and_timestamp(auth_repo_path: Path, api_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - # signs snapshot and timestamp, uses default expiration intervals - update_snapshot_and_timestamp( - auth_repo, - keystore=api_keystore, - ) - now = datetime.datetime.now() - for role, interval in [("timestamp", 1), ("snapshot", 7)]: - actual_expiration = auth_repo.get_expiration_date(role) - assert now + datetime.timedelta(interval) == actual_expiration - - -def test_update_target_metadata(auth_repo_path: Path, api_keystore: str): - auth_repo = AuthenticationRepository(path=auth_repo_path) - # remove one file, add one file, modify one file - # add a new file to the targets directory, check if it was signed - target_path1 = auth_repo_path / TARGETS_DIRECTORY_NAME / TARGET_FILE1 - target_path1.write_text("updated") - target_path2 = auth_repo_path / TARGETS_DIRECTORY_NAME / TARGET_FILE2 - target_path2.unlink() - target_path3 = auth_repo_path / TARGETS_DIRECTORY_NAME / TARGET_FILE3 - target_path3.write_text("test3") - - added_targets_data, removed_targets_data = auth_repo.get_all_target_files_state() - assert TARGET_FILE1 in added_targets_data - assert TARGET_FILE2 in removed_targets_data - assert TARGET_FILE3 in added_targets_data - assert TARGET_FILE1 not in removed_targets_data - assert TARGET_FILE2 not in added_targets_data - assert TARGET_FILE3 not in removed_targets_data - update_target_metadata( - auth_repo, - added_targets_data=added_targets_data, - removed_targets_data=removed_targets_data, - keystore=api_keystore, - write=True, - ) - check_if_targets_signed(auth_repo, "targets", TARGET_FILE1, TARGET_FILE3) - check_if_targets_removed(auth_repo, TARGET_FILE2) diff --git a/taf/tests/test_api/util.py b/taf/tests/test_api/util.py index fa0876a70..43cc164f7 100644 --- a/taf/tests/test_api/util.py +++ b/taf/tests/test_api/util.py @@ -1,32 +1,8 @@ -import json from pathlib import Path -import shutil -from typing import Dict, Optional +from typing import Optional from taf.auth_repo import AuthenticationRepository from taf.git import GitRepository -from tuf.repository_tool import TARGETS_DIRECTORY_NAME - - -def copy_repositories_json( - repositories_json_template: Dict, namespace: str, auth_repo_path: Path -): - output = auth_repo_path / TARGETS_DIRECTORY_NAME - - repositories = { - "repositories": { - repo_name.format(namespace=namespace): repo_data - for repo_name, repo_data in repositories_json_template[ - "repositories" - ].items() - } - } - output.mkdir(parents=True, exist_ok=True) - Path(output / "repositories.json").write_text(json.dumps(repositories)) - - -def copy_mirrors_json(mirrors_json_path: Path, auth_repo_path: Path): - output = auth_repo_path / TARGETS_DIRECTORY_NAME - shutil.copy(str(mirrors_json_path), output) +from typing import List def check_target_file( @@ -70,3 +46,22 @@ def check_if_targets_removed( for target_file in targets_filenames: assert target_file not in target_files assert target_file not in signed_target_files + + +def check_new_role( + auth_repo: AuthenticationRepository, + role_name: str, + paths: List[str], + keystore_path: str, + parent_name: str, +): + # check if keys were created + assert Path(keystore_path, f"{role_name}1").is_file() + assert Path(keystore_path, f"{role_name}2").is_file() + assert Path(keystore_path, f"{role_name}1.pub").is_file() + assert Path(keystore_path, f"{role_name}2.pub").is_file() + target_roles = auth_repo.get_all_targets_roles() + assert role_name in target_roles + assert auth_repo.find_delegated_roles_parent(role_name) == parent_name + roles_paths = auth_repo.get_role_paths(role_name) + assert roles_paths == paths diff --git a/taf/tests/test_git/conftest.py b/taf/tests/test_git/conftest.py index 4839855d4..96cc09e1b 100644 --- a/taf/tests/test_git/conftest.py +++ b/taf/tests/test_git/conftest.py @@ -1,6 +1,6 @@ from pathlib import Path import shutil -from pytest import fixture +import pytest from taf.git import GitRepository from taf.exceptions import NothingToCommitError from taf.utils import on_rm_error @@ -13,7 +13,7 @@ ORIGIN_REPO_NAME = "origin_repo" -@fixture +@pytest.fixture def repository(): path = TEST_DIR / REPO_NAME path.mkdir(exist_ok=True, parents=True) @@ -34,7 +34,7 @@ def repository(): shutil.rmtree(path, onerror=on_rm_error) -@fixture +@pytest.fixture def origin_repo(repository): path = TEST_DIR / ORIGIN_REPO_NAME repo = GitRepository(path=path) @@ -44,7 +44,7 @@ def origin_repo(repository): shutil.rmtree(path, onerror=on_rm_error) -@fixture +@pytest.fixture def clone_repository(): path = TEST_DIR / CLONE_REPO_NAME path.mkdir(exist_ok=True, parents=True) @@ -54,7 +54,7 @@ def clone_repository(): shutil.rmtree(path, onerror=on_rm_error) -@fixture +@pytest.fixture def empty_repository(): path = TEST_DIR / CLONE_REPO_NAME path.mkdir(exist_ok=True, parents=True) diff --git a/taf/tests/test_repositoriesdb/conftest.py b/taf/tests/test_repositoriesdb/conftest.py index 19d3331d2..762e5c4ff 100644 --- a/taf/tests/test_repositoriesdb/conftest.py +++ b/taf/tests/test_repositoriesdb/conftest.py @@ -1,15 +1,71 @@ +from pathlib import Path +import shutil + +from taf.api.metadata import update_metadata_expiration_date +import pytest +from typing import Dict +from taf import repositoriesdb +from taf.api.repository import create_repository +from taf.api.targets import update_target_repos_from_repositories_json +from taf.auth_repo import AuthenticationRepository +from taf.git import GitRepository +from taf.tests.utils import copy_mirrors_json, copy_repositories_json +from taf.utils import on_rm_error from contextlib import contextmanager -from taf.tests.conftest import origin_repos_group -import taf.repositoriesdb as repositoriesdb -from pytest import fixture +AUTH_REPO_NAME = "auth" + + +@pytest.fixture(scope="session") +def root_dir(repo_dir): + root_dir = repo_dir / "test_repositoriesdb" + yield root_dir + shutil.rmtree(root_dir, onerror=on_rm_error) + + +@pytest.fixture(scope="session") +def target_repos(root_dir): + repos = [] + for target in ("target1", "target2", "target3"): + target_repo_path = root_dir / target + target_repo_path.mkdir(parents=True) + target_repo = GitRepository(path=target_repo_path) + target_repo.init_repo() + target_repo.commit_empty("Initial commit") + repos.append(target_repo) + return repos + +@pytest.fixture(scope="session") +def auth_repo_with_targets( + root_dir: Path, + with_delegations_no_yubikeys_path: str, + keystore_delegations: str, + repositories_json_template: Dict, + mirrors_json_path: Path, +): + auth_path = root_dir / AUTH_REPO_NAME + auth_path.mkdir(exist_ok=True, parents=True) + namespace = root_dir.name + copy_repositories_json(repositories_json_template, namespace, auth_path) + copy_mirrors_json(mirrors_json_path, auth_path) + create_repository( + str(auth_path), + roles_key_infos=with_delegations_no_yubikeys_path, + keystore=keystore_delegations, + commit=True, + ) + update_target_repos_from_repositories_json( + str(auth_path), str(root_dir.parent), keystore_delegations, commit=True + ) + update_metadata_expiration_date( + path=auth_path, + roles=["targets"], + keystore=keystore_delegations, + ) -@fixture(scope="session", autouse=True) -def repositoriesdb_test_repositories(): - test_dir = "test-repositoriesdb" - with origin_repos_group(test_dir) as origins: - yield origins + auth_reo = AuthenticationRepository(path=auth_path) + yield auth_reo @contextmanager diff --git a/taf/tests/test_repositoriesdb/test_repositoriesdb.py b/taf/tests/test_repositoriesdb/test_repositoriesdb.py index 32efa6214..ec8a47476 100644 --- a/taf/tests/test_repositoriesdb/test_repositoriesdb.py +++ b/taf/tests/test_repositoriesdb/test_repositoriesdb.py @@ -1,6 +1,4 @@ -import pytest import taf.repositoriesdb as repositoriesdb -from taf.auth_repo import AuthenticationRepository import taf.settings as settings from taf.tests.test_repositoriesdb.conftest import load_repositories @@ -15,129 +13,110 @@ def teardown_module(module): settings.update_from_filesystem = False -@pytest.mark.parametrize( - "test_name", - [ - "test-no-delegations", - "test-delegated-roles", - ], -) -def test_load_repositories(test_name, repositoriesdb_test_repositories): - repositories = repositoriesdb_test_repositories[test_name] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - with load_repositories(auth_repo): - _check_repositories_dict(repositories, auth_repo, auth_repo.head_commit_sha()) +def test_load_repositories_when_no_delegations(target_repos, auth_repo_with_targets): + with load_repositories(auth_repo_with_targets): + _check_repositories_dict( + target_repos, + auth_repo_with_targets, + auth_repo_with_targets.head_commit_sha(), + ) -@pytest.mark.parametrize("test_name", ["test-no-delegations", "test-delegated-roles"]) -def test_load_repositories_only_load_targets( - test_name, repositoriesdb_test_repositories -): - repositories = repositoriesdb_test_repositories[test_name] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - with load_repositories(auth_repo, only_load_targets=True): +def test_load_repositories_only_load_targets(target_repos, auth_repo_with_targets): + with load_repositories(auth_repo_with_targets): _check_repositories_dict( - repositories, auth_repo, auth_repo.head_commit_sha(), only_load_targets=True + target_repos, + auth_repo_with_targets, + auth_repo_with_targets.head_commit_sha(), + only_load_targets=True, ) -def test_load_repositories_of_roles(repositoriesdb_test_repositories): - repositories = repositoriesdb_test_repositories["test-delegated-roles"] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - roles = ["delegated_role1"] - with load_repositories(auth_repo, roles=roles): +def test_load_repositories_of_roles(target_repos, auth_repo_with_targets): + roles = ["delegated_role"] + with load_repositories(auth_repo_with_targets, roles=roles): _check_repositories_dict( - repositories, auth_repo, auth_repo.head_commit_sha(), roles=roles + target_repos, + auth_repo_with_targets, + auth_repo_with_targets.head_commit_sha(), + roles=roles, ) -@pytest.mark.parametrize("test_name", ["test-no-delegations", "test-delegated-roles"]) -def test_load_repositories_all_commits(test_name, repositoriesdb_test_repositories): - repositories = repositoriesdb_test_repositories[test_name] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - commits = auth_repo.all_commits_on_branch()[1:] # remove the first commit - with load_repositories(auth_repo, commits=commits): - _check_repositories_dict(repositories, auth_repo, *commits) +def test_load_repositories_all_commits(target_repos, auth_repo_with_targets): + commits = auth_repo_with_targets.all_commits_on_branch()[ + 2: + ] # remove the first commit + with load_repositories(auth_repo_with_targets, commits=commits): + _check_repositories_dict(target_repos, auth_repo_with_targets, *commits) -def test_get_deduplicated_repositories(repositoriesdb_test_repositories): - repositories = repositoriesdb_test_repositories["test-delegated-roles"] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - commits = auth_repo.all_commits_on_branch()[1:] # remove the first commit - with load_repositories(auth_repo, commits=commits): - repos = repositoriesdb.get_deduplicated_repositories(auth_repo, commits) +def test_get_deduplicated_repositories(target_repos, auth_repo_with_targets): + commits = auth_repo_with_targets.all_commits_on_branch()[ + 1: + ] # remove the first commit + with load_repositories(auth_repo_with_targets, commits=commits): + repos = repositoriesdb.get_deduplicated_repositories( + auth_repo_with_targets, commits + ) assert len(repos) == 3 - for repo_name in repositories: - if repo_name != AUTH_REPO_NAME: - assert repo_name in repos - - -def test_get_repository(repositoriesdb_test_repositories): - repositories = repositoriesdb_test_repositories["test-delegated-roles"] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - commits = auth_repo.all_commits_on_branch()[1:] # remove the first commit - path = "namespace/TargetRepo1" - with load_repositories(auth_repo, commits=commits): - repo = repositoriesdb.get_repository(auth_repo, path, commits[-1]) - assert repo.name == path - repo = repositoriesdb.get_repository(auth_repo, path, commits[-2]) - assert repo.name == path - - -def test_get_repository_by_custom_data(repositoriesdb_test_repositories): - repositories = repositoriesdb_test_repositories["test-delegated-roles"] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - with load_repositories(auth_repo): - for repo_type, repo_name in [ - ("type1", "namespace/TargetRepo1"), - ("type2", "namespace/TargetRepo2"), - ("type3", "namespace/TargetRepo3"), - ]: + for target_repo in target_repos: + assert target_repo.name in repos + + +def test_get_repository(target_repos, auth_repo_with_targets): + commits = auth_repo_with_targets.all_commits_on_branch()[1:] + with load_repositories(auth_repo_with_targets, commits=commits): + for target_repo in target_repos: + repo = repositoriesdb.get_repository( + auth_repo_with_targets, target_repo.name, commits[-1] + ) + assert repo.name == target_repo.name + + +def test_get_repository_by_custom_data(target_repos, auth_repo_with_targets): + with load_repositories(auth_repo_with_targets): + repo_types = ("type1", "type2", "type3") + for repo_type, repo in zip(repo_types, target_repos): type_repos = repositoriesdb.get_repositories_by_custom_data( - auth_repo, type=repo_type + auth_repo_with_targets, type=repo_type ) assert len(type_repos) == 1 - assert type_repos[0].name == repo_name - - -def test_get_repositories_paths_by_custom_data(repositoriesdb_test_repositories): - repositories = repositoriesdb_test_repositories["test-delegated-roles"] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - with load_repositories(auth_repo): - for repo_type, repo_name in [ - ("type1", "namespace/TargetRepo1"), - ("type2", "namespace/TargetRepo2"), - ("type3", "namespace/TargetRepo3"), - ]: - paths = repositoriesdb.get_repositories_paths_by_custom_data( - auth_repo, type=repo_type - ) - assert paths == [repo_name] + assert type_repos[0].name == repo.name + + +def test_get_repositories_paths_by_custom_data(target_repos, auth_repo_with_targets): + repo_types = ("type1", "type2", "type3") + for repo_type, repo in zip(repo_types, target_repos): + paths = repositoriesdb.get_repositories_paths_by_custom_data( + auth_repo_with_targets, type=repo_type + ) + assert paths == [repo.name] def _check_repositories_dict( - repositories, auth_repo, *commits, roles=None, only_load_targets=False + target_repos, auth_repo, *commits, roles=None, only_load_targets=False ): assert auth_repo.path in repositoriesdb._repositories_dict auth_repos_dict = repositoriesdb._repositories_dict[auth_repo.path] if roles is not None and len(roles): only_load_targets = True if only_load_targets: - target_files_of_roles = auth_repo.get_singed_target_files_of_roles(roles) + target_files_of_roles = auth_repo.get_signed_target_files_of_roles(roles) for commit in commits: repositories_json = auth_repo.get_json( commit, repositoriesdb.REPOSITORIES_JSON_PATH ) repositories_data = repositories_json["repositories"] assert commit in auth_repos_dict - for repo_name in repositories: - if repo_name != AUTH_REPO_NAME: - if not only_load_targets or ( - only_load_targets and repo_name in target_files_of_roles - ): - assert repo_name in auth_repos_dict[commit] - # check custom data - custom_data = repositories_data[repo_name].get("custom", {}) - assert auth_repos_dict[commit][repo_name].custom == custom_data - else: - assert repo_name not in auth_repos_dict[commit] + for target_repo in target_repos: + repo_name = target_repo.name + if not only_load_targets or ( + only_load_targets and repo_name in target_files_of_roles + ): + assert repo_name in auth_repos_dict[commit] + # check custom data + custom_data = repositories_data[repo_name].get("custom", {}) + assert auth_repos_dict[commit][repo_name].custom == custom_data + else: + assert repo_name not in auth_repos_dict[commit] diff --git a/taf/tests/test_repositoriesdb/test_repositoriesdb_mirrors.py b/taf/tests/test_repositoriesdb/test_repositoriesdb_mirrors.py index 21e5e2509..a27752d5b 100644 --- a/taf/tests/test_repositoriesdb/test_repositoriesdb_mirrors.py +++ b/taf/tests/test_repositoriesdb/test_repositoriesdb_mirrors.py @@ -1,30 +1,35 @@ +import pytest import taf.repositoriesdb as repositoriesdb -from taf.auth_repo import AuthenticationRepository from taf.tests.test_repositoriesdb.conftest import load_repositories AUTH_REPO_NAME = "organization/auth_repo" -REPOS_URLS = { - f"namespace/{repo_name}": [ - f"https://github.com/namespace/{repo_name}.git", - f"https://github.com/test/namespace-{repo_name}.git", - f"https://gitlab.com/namespace2/{repo_name}.git", - f"https://gitlab.com/namespace/namespace--{repo_name}.git", - f"git@github.com:namespace/{repo_name}.git", + +@pytest.fixture(scope="session") +def repo_urls(target_repos): + namaespaces_and_names = [ + (target_repo.name.split("/")[0], target_repo.name.split("/")[1]) + for target_repo in target_repos ] - for repo_name in ["TargetRepo1", "TargetRepo2", "TargetRepo3"] -} + return { + f"{namespace}/{repo_name}": [ + f"https://github.com/{namespace}/{repo_name}.git", + f"https://github.com/test_org/{namespace}-{repo_name}.git", + f"git@github.com:{namespace}/{repo_name}.git", + f"git@github.com:test_org/{namespace}-{repo_name}.git", + ] + for namespace, repo_name in namaespaces_and_names + } -def test_load_repositories_with_mirrors(repositoriesdb_test_repositories): - repositories = repositoriesdb_test_repositories["test-delegated-roles-with-mirrors"] - auth_repo = AuthenticationRepository(path=repositories[AUTH_REPO_NAME]) - commit = auth_repo.head_commit_sha() - with load_repositories(auth_repo): - for repo_path in repositories: - loaded_repos_dict = repositoriesdb._repositories_dict[auth_repo.path][ - commit - ] - if repo_path != AUTH_REPO_NAME: - repo = loaded_repos_dict[repo_path] - assert repo.urls == REPOS_URLS[repo_path] +def test_load_repositories_with_mirrors( + target_repos, auth_repo_with_targets, repo_urls +): + commit = auth_repo_with_targets.head_commit_sha() + with load_repositories(auth_repo_with_targets): + for target_repo in target_repos: + loaded_repos_dict = repositoriesdb._repositories_dict[ + auth_repo_with_targets.path + ][commit] + repo = loaded_repos_dict[target_repo.name] + assert repo.urls == repo_urls[target_repo.name] diff --git a/taf/tests/test_repository/conftest.py b/taf/tests/test_repository/conftest.py deleted file mode 100644 index 1b14ac258..000000000 --- a/taf/tests/test_repository/conftest.py +++ /dev/null @@ -1,10 +0,0 @@ -from taf.tests.conftest import origin_repos_group - -from pytest import fixture - - -@fixture(scope="session", autouse=True) -def repository_test_repositories(): - test_dir = "test-repository" - with origin_repos_group(test_dir) as origins: - yield origins diff --git a/taf/tests/test_repository/test_repository.py b/taf/tests/test_repository/test_repository.py index ce8422820..667abc953 100644 --- a/taf/tests/test_repository/test_repository.py +++ b/taf/tests/test_repository/test_repository.py @@ -1,5 +1,5 @@ import pytest -import tempfile +from pygit2 import init_repository from pathlib import Path from taf.exceptions import InvalidRepositoryError @@ -97,6 +97,7 @@ def _check_values(repo, json_data): assert getattr(repo, attr_name) == attr_value repo = GitRepository.from_json_dict(data) + _check_values(repo, data) auth_data = data.copy() @@ -208,24 +209,22 @@ def test_autodetect_default_branch_expect_none(): assert repo.default_branch is None -def test_autodetect_default_branch_with_git_init_bare_expect_autodetected(): - with tempfile.TemporaryDirectory() as temp_dir: - repo = GitRepository(path=Path(temp_dir)) - repo._git("init --bare") - default_branch = repo._determine_default_branch() - assert default_branch is not None - # depends on git defaultBranch config on users' machine - assert default_branch in ("main", "master") - - -@pytest.mark.parametrize( - "test_name, branch", - [ - ("test-repository-main-branch", "main"), - ("test-repository-master-branch", "master"), - ], -) -def test_load_repositories(test_name, branch, repository_test_repositories): - repository_path = repository_test_repositories["test-default-branch"][test_name] - repo = GitRepository(path=repository_path) - assert repo.default_branch == branch +def test_autodetect_default_branch_with_git_init_bare_expect_autodetected(repo_path): + repo = GitRepository(path=repo_path) + repo._git("init --bare") + default_branch = repo._determine_default_branch() + assert default_branch is not None + # depends on git defaultBranch config on users' machine + assert default_branch in ("main", "master") + + +def test_default_branch_when_master(repo_path): + init_repository(repo_path, initial_head="main") + repo = GitRepository(path=repo_path) + assert repo.default_branch == "main" + + +def test_default_branch_when_main(repo_path): + init_repository(repo_path, initial_head="master") + repo = GitRepository(path=repo_path) + assert repo.default_branch == "master" diff --git a/taf/tests/test_repository_tool/conftest.py b/taf/tests/test_repository_tool/conftest.py deleted file mode 100644 index 39a66d9a3..000000000 --- a/taf/tests/test_repository_tool/conftest.py +++ /dev/null @@ -1,146 +0,0 @@ -import taf.repository_tool as repository_tool -from pytest import fixture -from securesystemslib.interface import ( - import_rsa_privatekey_from_file, - import_rsa_publickey_from_file, -) -from taf.repository_tool import Repository -from taf.tools.yubikey.yubikey_utils import ( - Root1YubiKey, - Root2YubiKey, - Root3YubiKey, - TargetYubiKey, -) -from taf.tests.conftest import TEST_DATA_PATH, origin_repos_group - -KEYSTORES_PATH = TEST_DATA_PATH / "keystores" -KEYSTORE_PATH = KEYSTORES_PATH / "keystore" -WRONG_KEYSTORE_PATH = KEYSTORES_PATH / "wrong_keystore" -DELEGATED_ROLES_KEYSTORE_PATH = KEYSTORES_PATH / "delegated_roles_keystore" -HANDLERS_DATA_INPUT_DIR = TEST_DATA_PATH / "handler_inputs" - - -def _load_key(keystore_path, key_name, scheme): - """Load private and public keys of the given name""" - key = import_rsa_publickey_from_file( - str(keystore_path / f"{key_name}.pub"), scheme=scheme - ) - priv_key = import_rsa_privatekey_from_file( - str(keystore_path / key_name), scheme=scheme - ) - key["keyval"]["private"] = priv_key["keyval"]["private"] - return key - - -@fixture(scope="session", autouse=True) -def repositories(request, pytestconfig): - """TAF repositories for testing.""" - repository_tool.DISABLE_KEYS_CACHING = True - - scheme = request.param - pytestconfig.option.signature_scheme = scheme - if scheme not in ["rsassa-pss-sha256", "rsa-pkcs1v15-sha256"]: - raise ValueError(f"Invalid test config. Invalid scheme: {scheme}") - - scheme_suffix = scheme.split("-")[1] - test_dir = "test-repository-tool" - with origin_repos_group(test_dir, scheme_suffix) as origins: - yield { - repo_name.rsplit("-", 1)[0]: Repository( - repos_origin_paths["taf"], name=repo_name - ) - for repo_name, repos_origin_paths in origins.items() - } - - -@fixture -def delegated_roles_keystore(): - """Path of the keystore with keys of delegated roles""" - return str(DELEGATED_ROLES_KEYSTORE_PATH) - - -@fixture -def targets_yk(pytestconfig): - """Targets YubiKey.""" - return TargetYubiKey(KEYSTORE_PATH, pytestconfig.option.signature_scheme) - - -@fixture -def root1_yk(pytestconfig): - """Root1 YubiKey.""" - return Root1YubiKey(KEYSTORE_PATH, pytestconfig.option.signature_scheme) - - -@fixture -def root2_yk(pytestconfig): - """Root2 YubiKey.""" - return Root2YubiKey(KEYSTORE_PATH, pytestconfig.option.signature_scheme) - - -@fixture -def root3_yk(pytestconfig): - """Root3 YubiKey.""" - return Root3YubiKey(KEYSTORE_PATH, pytestconfig.option.signature_scheme) - - -@fixture -def snapshot_key(pytestconfig): - """Snapshot key.""" - return _load_key(KEYSTORE_PATH, "snapshot", pytestconfig.option.signature_scheme) - - -@fixture -def timestamp_key(pytestconfig): - """Timestamp key.""" - return _load_key(KEYSTORE_PATH, "timestamp", pytestconfig.option.signature_scheme) - - -@fixture -def targets_key(pytestconfig): - """Targets key.""" - return _load_key(KEYSTORE_PATH, "targets", pytestconfig.option.signature_scheme) - - -@fixture -def delegated_role11_key(pytestconfig): - return _load_key( - DELEGATED_ROLES_KEYSTORE_PATH, - "delegated_role11", - pytestconfig.option.signature_scheme, - ) - - -@fixture -def delegated_role12_key(pytestconfig): - return _load_key( - DELEGATED_ROLES_KEYSTORE_PATH, - "delegated_role12", - pytestconfig.option.signature_scheme, - ) - - -@fixture -def delegated_role13_key(pytestconfig): - return _load_key( - DELEGATED_ROLES_KEYSTORE_PATH, - "delegated_role13", - pytestconfig.option.signature_scheme, - ) - - -@fixture -def delegated_role2_key(pytestconfig): - return _load_key( - DELEGATED_ROLES_KEYSTORE_PATH, - "delegated_role2", - pytestconfig.option.signature_scheme, - ) - - -@fixture -def inner_delegated_role_key(pytestconfig): - return _load_key( - DELEGATED_ROLES_KEYSTORE_PATH, - "inner_delegated_role", - pytestconfig.option.signature_scheme, - ) diff --git a/taf/tests/test_repository_tool/test_delegated_roles.py b/taf/tests/test_repository_tool/test_delegated_roles.py deleted file mode 100644 index 73e25fe6d..000000000 --- a/taf/tests/test_repository_tool/test_delegated_roles.py +++ /dev/null @@ -1,105 +0,0 @@ -def test_get_all_targets_roles(repositories): - taf_delegated_roles = repositories["test-delegated-roles"] - assert taf_delegated_roles.get_all_targets_roles() == [ - "targets", - "delegated_role1", - "delegated_role2", - "inner_delegated_role", - ] - - -def test_find_roles_parent(repositories): - taf_delegated_roles = repositories["test-delegated-roles"] - assert ( - taf_delegated_roles.find_delegated_roles_parent("delegated_role1") == "targets" - ) - assert ( - taf_delegated_roles.find_delegated_roles_parent("delegated_role2") == "targets" - ) - assert ( - taf_delegated_roles.find_delegated_roles_parent("inner_delegated_role") - == "delegated_role2" - ) - - -def test_map_signing_roles(repositories): - taf_delegated_roles = repositories["test-delegated-roles"] - expected_targets_roles = { - "dir1/delegated_role1_1.txt": "delegated_role1", - "dir1/delegated_role1_2.txt": "delegated_role1", - "dir2/delegated_role2_1.txt": "delegated_role2", - "dir2/delegated_role2_1.txt": "delegated_role2", - "dir2/inner_delegated_role.txt": "inner_delegated_role", - } - actual_targets_roles = taf_delegated_roles.map_signing_roles( - expected_targets_roles.keys() - ) - for file_name, expected_role in expected_targets_roles.items(): - assert file_name in actual_targets_roles - assert actual_targets_roles[file_name] == expected_role - - -def test_find_keys_roles( - repositories, - delegated_role11_key, - delegated_role12_key, - delegated_role13_key, - delegated_role2_key, - inner_delegated_role_key, -): - taf_delegated_roles = repositories["test-delegated-roles"] - assert not len(taf_delegated_roles.find_keys_roles([delegated_role11_key])) - assert taf_delegated_roles.find_keys_roles( - [delegated_role11_key, delegated_role12_key] - ) == ["delegated_role1"] - assert taf_delegated_roles.find_keys_roles( - [delegated_role11_key, delegated_role12_key, delegated_role13_key] - ) == ["delegated_role1"] - assert taf_delegated_roles.find_keys_roles([delegated_role2_key]) == [ - "delegated_role2" - ] - assert taf_delegated_roles.find_keys_roles([inner_delegated_role_key]) == [ - "inner_delegated_role" - ] - - -def test_sort_roles_targets_for_filenames(repositories): - taf_delegated_roles = repositories["test-delegated-roles"] - targets_files_by_roles = taf_delegated_roles.sort_roles_targets_for_filenames() - assert "delegated_role1" in targets_files_by_roles - for target_file in targets_files_by_roles["delegated_role1"]: - assert target_file in [ - "dir1/delegated_role1_1.txt", - "dir1/delegated_role1_2.txt", - ] - - assert "delegated_role2" in targets_files_by_roles - for target_file in targets_files_by_roles["delegated_role2"]: - assert target_file in [ - "dir2/delegated_role2_1.txt", - "dir2/delegated_role2_2.txt", - ] - assert "inner_delegated_role" in targets_files_by_roles - assert targets_files_by_roles["inner_delegated_role"] == [ - "dir2/inner_delegated_role.txt" - ] - - -def test_get_role_from_target_paths(repositories): - taf_delegated_roles = repositories["test-delegated-roles"] - - target_paths_with_same_role = [ - "dir1/delegated_role1_1.txt", - "dir1/delegated_role1_2.txt", - ] - role = taf_delegated_roles.get_role_from_target_paths(target_paths_with_same_role) - assert role == "delegated_role1" - - target_paths_with_different_role = [ - "dir2/delegated_role2_1.txt", - "dir2/inner_delegated_role.txt", - ] - role = taf_delegated_roles.get_role_from_target_paths( - target_paths_with_different_role - ) - assert role is None diff --git a/taf/tests/test_repository_tool/test_modify_targets.py b/taf/tests/test_repository_tool/test_modify_targets.py deleted file mode 100644 index eeadb85e2..000000000 --- a/taf/tests/test_repository_tool/test_modify_targets.py +++ /dev/null @@ -1,152 +0,0 @@ -import json -import os -from pathlib import Path - -import pytest -from pytest import fixture - -from taf.exceptions import TargetsError -from taf.git import GitRepository - - -@fixture(autouse=True) -def run_around_tests(repositories): - yield - for taf_repository in repositories.values(): - repo = GitRepository(path=taf_repository.path) - repo.reset_to_head() - repo.clean() - taf_repository._repository.targets.clear_targets() - - -def test_add_targets_new_files(repositories): - taf_happy_path = repositories["test-happy-path"] - old_targets = {"targets": _get_old_targets(taf_happy_path)} - - json_file_content = {"attr1": "value1", "attr2": "value2"} - regular_file_content = "this file is not empty" - data = { - "new_json_file": {"target": json_file_content}, - "new_file": {"target": regular_file_content}, - "empty_file": {"target": None}, - } - role = taf_happy_path.modify_targets(data) - assert role == "targets" - - _check_target_files(taf_happy_path, data, old_targets) - - -def test_add_targets_nested_files(repositories): - taf_happy_path = repositories["test-happy-path"] - old_targets = {"targets": _get_old_targets(taf_happy_path)} - - data = { - "inner_folder1/new_file_1": {"target": "file 1 content"}, - "inner_folder2/new_file_2": {"target": "file 2 content"}, - } - taf_happy_path.modify_targets(data) - _check_target_files(taf_happy_path, data, old_targets) - - -def test_add_targets_files_to_keep(repositories): - taf_happy_path = repositories["test-happy-path"] - old_targets = {"targets": _get_old_targets(taf_happy_path)} - data = {"a_new_file": {"target": "new file content"}} - taf_happy_path.modify_targets(data) - _check_target_files(taf_happy_path, data, old_targets, files_to_keep=["branch"]) - - -def test_add_targets_delegated_roles_no_child_roles(repositories): - taf_delegated_roles = repositories["test-delegated-roles"] - old_targets = { - "delegated_role1": ["dir1/delegated_role1_1.txt", "dir1/delegated_role1_2.txt"], - "delegated_role2": ["dir2/delegated_role2_1.txt", "dir2/delegated_role2_2.txt"], - "inner_delegated_role": ["dir2/inner_delegated_role.txt"], - } - - data = {"dir1/a_new_file": {"target": "new file content"}} - role = taf_delegated_roles.modify_targets(data) - assert role == "delegated_role1" - - _check_target_files(taf_delegated_roles, data, old_targets, role) - - -def test_add_targets_multiple_delegated_roles_should_raise_error(repositories): - taf_delegated_roles = repositories["test-delegated-roles"] - data = { - "dir1/a_new_file": {"target": "new file content"}, - "dir2/a_new_file": {"target": "new file content"}, - } - - with pytest.raises(TargetsError): - taf_delegated_roles.modify_targets(data) - - -def test_add_targets_delegated_roles_child_roles(repositories): - taf_delegated_roles = repositories["test-delegated-roles"] - old_targets = { - "delegated_role1": ["dir1/delegated_role1_1.txt", "dir1/delegated_role1_2.txt"], - "delegated_role2": ["dir2/delegated_role2_1.txt", "dir2/delegated_role2_2.txt"], - "inner_delegated_role": ["dir2/inner_delegated_role.txt"], - } - - data = {"dir2/a_new_file": {"target": "new file content"}} - role = "delegated_role2" - taf_delegated_roles.modify_targets(data) - _check_target_files(taf_delegated_roles, data, old_targets, role) - - -def _check_target_files( - repo, data, old_targets, targets_role="targets", files_to_keep=None -): - if files_to_keep is None: - files_to_keep = [] - - targets_path = repo.targets_path - for target_rel_path, content in data.items(): - target_path = targets_path / target_rel_path - assert target_path.exists() - with open(str(target_path)) as f: - file_content = f.read() - target_content = content["target"] - if isinstance(target_content, dict): - content_json = json.loads(file_content) - assert content_json == target_content - elif target_content: - assert file_content == target_content - else: - assert file_content == "" - - # make sure that everything defined in repositories.json still exists if there was - # repositories.json - repository_targets = [] - for _, roles_targets in old_targets.items(): - if "repositories.json" in roles_targets: - repositories_path = targets_path / "repositories.json" - assert repositories_path.exists() - with open(str(repositories_path)) as f: - repositories = json.load(f)["repositories"] - for target_rel_path in repositories: - target_path = targets_path / target_rel_path - assert target_path.exists() - repository_targets.append(target_rel_path) - break - - # make sure that files to keep exist - for file_to_keep in files_to_keep: - # if the file didn't exists prior to adding new targets - # it won't exists after adding them - if file_to_keep not in old_targets: - continue - target_path = targets_path / file_to_keep - assert target_path.exists() - - -def _get_old_targets(repo): - targets_path = repo.targets_path - old_targets = [] - for root, _, filenames in os.walk(str(targets_path)): - for filename in filenames: - rel_path = Path(root, filename).relative_to(targets_path) - old_targets.append(rel_path.as_posix()) - return old_targets diff --git a/taf/tests/test_repository_tool/test_repository_tool.py b/taf/tests/test_repository_tool/test_repository_tool.py deleted file mode 100644 index 0966045f3..000000000 --- a/taf/tests/test_repository_tool/test_repository_tool.py +++ /dev/null @@ -1,204 +0,0 @@ -import datetime -from pathlib import Path - -import pytest -import tuf -import json - -import taf.exceptions -import taf.yubikey as yk -from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME -from taf.tests import TEST_WITH_REAL_YK -from taf.tools.yubikey.yubikey_utils import VALID_PIN -from taf.utils import to_tuf_datetime_format - - -@pytest.mark.skipif(TEST_WITH_REAL_YK, reason="Testing with real Yubikey.") -def test_check_no_key_inserted_for_targets_should_raise_error(repositories, targets_yk): - taf_happy_path = repositories["test-happy-path"] - targets_yk.insert() - targets_yk.remove() - with pytest.raises(taf.exceptions.YubikeyError): - taf_happy_path.is_valid_metadata_yubikey("targets") - - -def test_check_targets_key_id_for_targets_should_return_true(repositories, targets_yk): - taf_happy_path = repositories["test-happy-path"] - targets_yk.insert() - assert taf_happy_path.is_valid_metadata_yubikey("targets", targets_yk.tuf_key) - - -def test_check_root_key_id_for_targets_should_return_false(repositories, root1_yk): - taf_happy_path = repositories["test-happy-path"] - root1_yk.insert() - assert not taf_happy_path.is_valid_metadata_yubikey("targets", root1_yk.tuf_key) - - -def test_update_snapshot_valid_key(repositories, snapshot_key): - taf_happy_path = repositories["test-happy-path"] - start_date = datetime.datetime.now() - interval = 1 - expected_expiration_date = to_tuf_datetime_format(start_date, interval) - targets_metadata_path = Path(taf_happy_path.metadata_path) / "targets.json" - old_targets_metadata = targets_metadata_path.read_bytes() - taf_happy_path.update_snapshot_keystores( - [snapshot_key], start_date=start_date, interval=interval - ) - new_snapshot_metadata_path = Path(taf_happy_path.metadata_path) / "snapshot.json" - new_snapshot_metadata = new_snapshot_metadata_path.read_text() - signable = json.loads(new_snapshot_metadata) - tuf.formats.SIGNABLE_SCHEMA.check_match(signable) - actual_expiration_date = signable["signed"]["expires"] - - # Targets data should remain the same - assert old_targets_metadata == targets_metadata_path.read_bytes() - assert actual_expiration_date == expected_expiration_date - - -def test_update_snapshot_wrong_key(repositories, timestamp_key): - taf_happy_path = repositories["test-happy-path"] - with pytest.raises(taf.exceptions.InvalidKeyError): - taf_happy_path.update_snapshot_keystores([timestamp_key]) - - -def test_update_timestamp_valid_key(repositories, timestamp_key): - taf_happy_path = repositories["test-happy-path"] - start_date = datetime.datetime.now() - interval = 1 - expected_expiration_date = to_tuf_datetime_format(start_date, interval) - targets_metadata_path = Path(taf_happy_path.metadata_path) / "targets.json" - snapshot_metadata_path = Path(taf_happy_path.metadata_path) / "snapshot.json" - old_targets_metadata = targets_metadata_path.read_bytes() - old_snapshot_metadata = snapshot_metadata_path.read_bytes() - taf_happy_path.update_timestamp_keystores( - [timestamp_key], start_date=start_date, interval=interval - ) - new_timestamp_metadata_path = Path(taf_happy_path.metadata_path) / "timestamp.json" - new_timestamp_metadata = new_timestamp_metadata_path.read_text() - signable = json.loads(new_timestamp_metadata) - tuf.formats.SIGNABLE_SCHEMA.check_match(signable) - actual_expiration_date = signable["signed"]["expires"] - - assert actual_expiration_date == expected_expiration_date - # check if targets and snapshot remained the same - assert old_targets_metadata == targets_metadata_path.read_bytes() - assert old_snapshot_metadata == snapshot_metadata_path.read_bytes() - - -def test_update_timestamp_wrong_key(repositories, snapshot_key): - taf_happy_path = repositories["test-happy-path"] - with pytest.raises(taf.exceptions.InvalidKeyError): - taf_happy_path.update_timestamp_keystores([snapshot_key]) - - -def test_update_targets_from_keystore_valid_key(repositories, targets_key): - taf_happy_path = repositories["test-happy-path"] - targets_path = Path(taf_happy_path.targets_path) - repositories_json_path = targets_path / "repositories.json" - - branch_id = "14e81cd1-0050-43aa-9e2c-e34fffa6f517" - target_commit_sha = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - repositories_json_old = repositories_json_path.read_text() - - targets_data = { - "branch": {"target": branch_id}, - "dummy/target_dummy_repo": {"target": {"commit": target_commit_sha}}, - "test_file": {}, - } - - taf_happy_path.update_targets_keystores( - [targets_key], - added_targets_data=targets_data, - start_date=datetime.datetime.now(), - ) - - assert (targets_path / "branch").read_text() == branch_id - assert target_commit_sha in (targets_path / "dummy/target_dummy_repo").read_text() - assert (targets_path / "test_file").is_file() - assert repositories_json_old == repositories_json_path.read_text() - - -def test_update_targets_from_keystore_wrong_key(repositories, snapshot_key): - taf_happy_path = repositories["test-happy-path"] - targets_data = {"test_file": {}} - - with pytest.raises(taf.exceptions.TargetsMetadataUpdateError): - taf_happy_path.update_targets_keystores([snapshot_key], targets_data) - - -def test_update_targets_valid_key_valid_pin(repositories, targets_yk): - taf_happy_path = repositories["test-happy-path"] - if targets_yk.scheme != DEFAULT_RSA_SIGNATURE_SCHEME: - pytest.skip() - targets_path = Path(taf_happy_path.targets_path) - repositories_json_path = targets_path / "repositories.json" - - branch_id = "14e81cd1-0050-43aa-9e2c-e34fffa6f517" - target_commit_sha = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - repositories_json_old = repositories_json_path.read_text() - - targets_data = { - "branch": {"target": branch_id}, - "dummy/target_dummy_repo": {"target": {"commit": target_commit_sha}}, - "test_file": {}, - } - yk.add_key_pin(targets_yk.serial, VALID_PIN) - targets_yk.insert() - public_key = targets_yk.tuf_key - taf_happy_path.update_targets_yubikeys( - [public_key], - added_targets_data=targets_data, - start_date=datetime.datetime.now(), - ) - - assert (targets_path / "branch").read_text() == branch_id - assert target_commit_sha in (targets_path / "dummy/target_dummy_repo").read_text() - assert (targets_path / "test_file").is_file() - assert repositories_json_old == repositories_json_path.read_text() - - -def test_delete_target_file_valid_key_valid_pin(repositories, targets_yk): - taf_happy_path = repositories["test-happy-path"] - if targets_yk.scheme != DEFAULT_RSA_SIGNATURE_SCHEME: - pytest.skip() - targets_path = Path(taf_happy_path.targets_path) - - yk.add_key_pin(targets_yk.serial, VALID_PIN) - targets_yk.insert() - public_key = targets_yk.tuf_key - - # add test_file - targets_data = {"test_file": {}} - taf_happy_path.update_targets_yubikeys( - [public_key], - added_targets_data=targets_data, - start_date=datetime.datetime.now(), - ) - - assert (targets_path / "test_file").is_file() - targets_obj = taf_happy_path._role_obj("targets") - assert "test_file" in targets_obj.target_files - - # remove test_file - taf_happy_path.update_targets_yubikeys( - [public_key], - removed_targets_data=targets_data, - start_date=datetime.datetime.now(), - ) - - assert not (targets_path / "test_file").is_file() - targets_obj = taf_happy_path._role_obj("targets") - assert "test_file" not in targets_obj.target_files - - -@pytest.mark.skipif(TEST_WITH_REAL_YK, reason="Testing with real Yubikey.") -def test_update_targets_wrong_key(repositories, root1_yk): - taf_happy_path = repositories["test-happy-path"] - targets_data = {"test_file": {}} - - with pytest.raises(taf.exceptions.TargetsMetadataUpdateError): - root1_yk.insert() - yk.add_key_pin(root1_yk.serial, VALID_PIN) - taf_happy_path.update_targets_yubikeys( - [root1_yk.tuf_key], added_targets_data=targets_data - ) diff --git a/taf/tests/test_updater/conftest.py b/taf/tests/test_updater/conftest.py index 4fa0954ee..982973ee6 100644 --- a/taf/tests/test_updater/conftest.py +++ b/taf/tests/test_updater/conftest.py @@ -1,7 +1,6 @@ import enum import os import re -from typing import Optional import uuid import pytest import inspect @@ -9,23 +8,22 @@ import shutil import string import json +from typing import Optional from functools import partial from freezegun import freeze_time from pathlib import Path from jinja2 import Environment, BaseLoader +from taf.api.api_workflow import manage_repo_and_signers from taf.api.metadata import ( - _update_expiration_date_of_role, update_metadata_expiration_date, ) from taf.auth_repo import AuthenticationRepository -from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME -from taf.messages import git_commit_message +from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME, TARGETS_DIRECTORY_NAME from taf import repositoriesdb, settings from taf.exceptions import GitError from taf.utils import on_rm_error from taf.log import disable_console_logging from taf.tests.test_updater.update_utils import load_target_repositories -from tuf.repository_tool import TARGETS_DIRECTORY_NAME from taf.api.repository import create_repository from taf.api.targets import ( register_target_files, @@ -43,6 +41,8 @@ TEST_INIT_DATA_PATH, ) +from tuf.api.metadata import Timestamp + KEYS_DESCRIPTION = str(TEST_INIT_DATA_PATH / "keys.json") @@ -307,7 +307,7 @@ def create_authentication_repository( def sign_target_files(library_dir, repo_name, keystore): repo_path = Path(library_dir, repo_name) - register_target_files(str(repo_path), keystore, write=True) + register_target_files(str(repo_path), keystore) def _init_auth_repo( @@ -664,15 +664,14 @@ def update_auth_repo_without_committing( def update_role_metadata_without_signing( auth_repo: AuthenticationRepository, role: str ): - _update_expiration_date_of_role( - auth_repo=auth_repo, - role=role, - loaded_yubikeys={}, - start_date=None, + update_metadata_expiration_date( + path=auth_repo.path, + roles=[role], keystore=KEYSTORE_PATH, - interval=None, - scheme=DEFAULT_RSA_SIGNATURE_SCHEME, prompt_for_keys=False, + commit=False, + push=False, + update_snapshot_and_timestamp=False, ) @@ -682,42 +681,41 @@ def update_target_repo_without_committing(target_repos: list, target_name: str): update_target_repository(target_repo) -def update_role_metadata_invalid_signature( - auth_repo: AuthenticationRepository, role: str -): - role_metadata_path = Path(auth_repo.path, "metadata", f"{role}.json") - content = json.loads(role_metadata_path.read_text()) - content["signatures"][0]["sign"] = "invalid signature" - version = content["signed"]["version"] - content["signed"]["version"] = version + 1 - role_metadata_path.write_text(json.dumps(content, indent=4)) - auth_repo.commit("Invalid metadata update") +def update_timestamp_metadata_invalid_signature(auth_repo: AuthenticationRepository): + + role = Timestamp.type + with manage_repo_and_signers( + auth_repo, + [role], + keystore=KEYSTORE_PATH, + scheme=DEFAULT_RSA_SIGNATURE_SCHEME, + prompt_for_keys=False, + load_snapshot_and_timestamp=False, + commit=True, + commit_msg="Invalid metadata update", + push=False, + ): + role_metadata_path = Path(auth_repo.path, "metadata", f"{role}.json") + content = json.loads(role_metadata_path.read_text()) + content["signatures"][0]["sig"] = "invalid signature" + version = content["signed"]["version"] + content["signed"]["version"] = version + 1 + role_metadata_path.write_text(json.dumps(content, indent=1)) def update_and_sign_metadata_without_clean_check( auth_repo: AuthenticationRepository, roles: list ): - if "root" or "targets" in roles: - if "snapshot" not in roles: - roles.append("snapshot") - if "timestamp" not in roles: - roles.append("timestamp") - - roles = ["root", "snapshot", "timestamp"] - for role in roles: - _update_expiration_date_of_role( - auth_repo=auth_repo, - role=role, - loaded_yubikeys={}, - start_date=None, - keystore=KEYSTORE_PATH, - interval=None, - scheme=DEFAULT_RSA_SIGNATURE_SCHEME, - prompt_for_keys=False, - ) - commit_msg = git_commit_message("update-expiration-dates", roles=",".join(roles)) - auth_repo.commit_and_push(commit_msg=commit_msg, push=False) + update_metadata_expiration_date( + path=auth_repo.path, + roles=roles, + keystore=KEYSTORE_PATH, + scheme=DEFAULT_RSA_SIGNATURE_SCHEME, + prompt_for_keys=False, + skip_clean_check=True, + update_snapshot_and_timestamp=True, + ) def update_target_repository( diff --git a/taf/tests/test_updater/test_clone/test_clone_invalid.py b/taf/tests/test_updater/test_clone/test_clone_invalid.py index c1893fdb1..94ee3ec92 100644 --- a/taf/tests/test_updater/test_clone/test_clone_invalid.py +++ b/taf/tests/test_updater/test_clone/test_clone_invalid.py @@ -16,7 +16,7 @@ clone_client_repo, swap_last_two_commits, update_expiration_dates, - update_role_metadata_invalid_signature, + update_timestamp_metadata_invalid_signature, ) from taf.tests.test_updater.update_utils import ( check_if_last_validated_commit_exists, @@ -172,9 +172,7 @@ def test_clone_invalid_target_repositories_targets_exist( def test_clone_invalid_target_invalid_singature(origin_auth_repo, client_dir): setup_manager = SetupManager(origin_auth_repo) - setup_manager.add_task( - update_role_metadata_invalid_signature, kwargs={"role": "timestamp"} - ) + setup_manager.add_task(update_timestamp_metadata_invalid_signature) setup_manager.execute_tasks() update_invalid_repos_and_check_if_repos_exist( diff --git a/taf/tests/test_updater/test_update/test_update_invalid.py b/taf/tests/test_updater/test_update/test_update_invalid.py index a0fd5d982..a2d0144e8 100644 --- a/taf/tests/test_updater/test_update/test_update_invalid.py +++ b/taf/tests/test_updater/test_update/test_update_invalid.py @@ -11,7 +11,7 @@ create_index_lock, set_last_commit_of_auth_repo, update_expiration_dates, - update_role_metadata_invalid_signature, + update_timestamp_metadata_invalid_signature, ) from taf.tests.test_updater.update_utils import ( check_if_last_validated_commit_exists, @@ -125,9 +125,7 @@ def test_update_invalid_target_invalid_singature(origin_auth_repo, client_dir): clone_repositories(origin_auth_repo, client_dir) setup_manager = SetupManager(origin_auth_repo) - setup_manager.add_task( - update_role_metadata_invalid_signature, kwargs={"role": "targets"} - ) + setup_manager.add_task(update_timestamp_metadata_invalid_signature) setup_manager.add_task(update_expiration_dates) setup_manager.execute_tasks() diff --git a/taf/tests/test_updater/test_update/test_validation_and_sync.py b/taf/tests/test_updater/test_update/test_validation_and_sync.py index a581a3f90..9dd11db07 100644 --- a/taf/tests/test_updater/test_update/test_validation_and_sync.py +++ b/taf/tests/test_updater/test_update/test_validation_and_sync.py @@ -18,7 +18,7 @@ pull_specific_target_repo, remove_commits, update_expiration_dates, - update_role_metadata_invalid_signature, + update_timestamp_metadata_invalid_signature, ) from taf.tests.test_updater.update_utils import verify_partial_targets_update @@ -143,9 +143,7 @@ def test_auth_repo_not_in_sync_partial(origin_auth_repo, client_dir): setup_manager = SetupManager(origin_auth_repo) setup_manager.add_task(add_valid_target_commits) - setup_manager.add_task( - update_role_metadata_invalid_signature, kwargs={"role": "timestamp"} - ) + setup_manager.add_task(update_timestamp_metadata_invalid_signature) setup_manager.execute_tasks() assert client_auth_repo.head_commit_sha() != origin_auth_repo.head_commit_sha() diff --git a/taf/tests/test_updater/test_update_library/conftest.py b/taf/tests/test_updater/test_update_library/conftest.py index 4b06277d2..b662f3f1c 100644 --- a/taf/tests/test_updater/test_update_library/conftest.py +++ b/taf/tests/test_updater/test_update_library/conftest.py @@ -1,4 +1,5 @@ import re +from taf.constants import TARGETS_DIRECTORY_NAME from taf.repositoriesdb import ( DEPENDENCIES_JSON_NAME, ) @@ -14,7 +15,6 @@ ) from tuf.ngclient._internal import trusted_metadata_set from pytest import fixture -from tuf.repository_tool import TARGETS_DIRECTORY_NAME original_tuf_trusted_metadata_set = trusted_metadata_set.TrustedMetadataSet diff --git a/taf/tests/test_updater/test_update_library/test_clone_library_invalid.py b/taf/tests/test_updater/test_update_library/test_clone_library_invalid.py index cfcc74641..92e535647 100644 --- a/taf/tests/test_updater/test_update_library/test_clone_library_invalid.py +++ b/taf/tests/test_updater/test_update_library/test_clone_library_invalid.py @@ -8,10 +8,10 @@ SetupManager, add_unauthenticated_commits_to_all_target_repos, add_valid_target_commits, - update_role_metadata_invalid_signature, + update_timestamp_metadata_invalid_signature, ) from taf.updater.types.update import UpdateType -from taf.tests.test_updater.update_utils import _clone_full_library +from taf.tests.test_updater.update_utils import clone_full_library @pytest.mark.parametrize( @@ -46,14 +46,12 @@ def test_clone_with_invalid_dependency_repo( # Invalidate one of the authentication repositories in dependencies dependency_auth_repo = library_with_dependencies["namespace1/auth"]["auth_repo"] setup_manager = SetupManager(dependency_auth_repo) - setup_manager.add_task( - update_role_metadata_invalid_signature, kwargs={"role": "timestamp"} - ) + setup_manager.add_task(update_timestamp_metadata_invalid_signature) setup_manager.execute_tasks() # Run the updater which will clone and then update with pytest.raises(UpdateFailedError, match=INVALID_TIMESTAMP_PATTERN): - _clone_full_library( + clone_full_library( library_with_dependencies, origin_dir, client_dir, @@ -102,7 +100,7 @@ def test_clone_invalid_target_repo( setup_manager.execute_tasks() # Run the updater which will clone and then update with pytest.raises(UpdateFailedError, match=TARGET_MISMATCH_PATTERN_DEPENDENCIES): - _clone_full_library( + clone_full_library( library_with_dependencies, origin_dir, client_dir, @@ -144,13 +142,11 @@ def test_clone_with_invalid_root_repo( root_repo = library_with_dependencies["root/auth"]["auth_repo"] setup_manager = SetupManager(root_repo) setup_manager = SetupManager(root_repo) - setup_manager.add_task( - update_role_metadata_invalid_signature, kwargs={"role": "timestamp"} - ) + setup_manager.add_task(update_timestamp_metadata_invalid_signature) setup_manager.execute_tasks() with pytest.raises(UpdateFailedError, match=INVALID_TIMESTAMP_PATTERN_ROOT): - _clone_full_library( + clone_full_library( library_with_dependencies, origin_dir, client_dir, diff --git a/taf/tests/test_updater/test_update_library/test_clone_library_valid.py b/taf/tests/test_updater/test_update_library/test_clone_library_valid.py index 963447220..98fd13249 100644 --- a/taf/tests/test_updater/test_update_library/test_clone_library_valid.py +++ b/taf/tests/test_updater/test_update_library/test_clone_library_valid.py @@ -1,7 +1,7 @@ import pytest from taf.updater.types.update import UpdateType from taf.tests.test_updater.update_utils import ( - _clone_full_library, + clone_full_library, ) @@ -36,7 +36,7 @@ def test_clone_repository_with_dependencies( origin_dir, client_dir, ): - _clone_full_library( + clone_full_library( library_with_dependencies, origin_dir, client_dir, diff --git a/taf/tests/test_updater/test_update_library/test_update_library_invalid.py b/taf/tests/test_updater/test_update_library/test_update_library_invalid.py index 972712a96..e68fde720 100644 --- a/taf/tests/test_updater/test_update_library/test_update_library_invalid.py +++ b/taf/tests/test_updater/test_update_library/test_update_library_invalid.py @@ -7,11 +7,11 @@ SetupManager, add_unauthenticated_commits_to_all_target_repos, add_valid_target_commits, - update_role_metadata_invalid_signature, + update_timestamp_metadata_invalid_signature, ) from taf.updater.types.update import UpdateType from taf.tests.test_updater.update_utils import ( - _clone_full_library, + clone_full_library, update_and_validate_repositories, ) @@ -46,7 +46,7 @@ def test_update_with_invalid_dependency_repo( library_with_dependencies, origin_dir, client_dir ): - _clone_full_library( + clone_full_library( library_with_dependencies, origin_dir, client_dir, @@ -56,9 +56,7 @@ def test_update_with_invalid_dependency_repo( # Invalidate one of the authentication repositories in dependencies dependency_auth_repo = library_with_dependencies["namespace11/auth"]["auth_repo"] setup_manager = SetupManager(dependency_auth_repo) - setup_manager.add_task( - update_role_metadata_invalid_signature, kwargs={"role": "timestamp"} - ) + setup_manager.add_task(update_timestamp_metadata_invalid_signature) setup_manager.execute_tasks() with pytest.raises(UpdateFailedError, match=INVALID_TIMESTAMP_PATTERN): @@ -98,7 +96,7 @@ def test_update_invalid_target_repo( origin_dir, client_dir, ): - _clone_full_library( + clone_full_library( library_with_dependencies, origin_dir, client_dir, @@ -151,7 +149,7 @@ def test_update_all_except_invalid( client_dir, ): - _clone_full_library( + clone_full_library( library_with_dependencies, origin_dir, client_dir, diff --git a/taf/tests/test_updater/test_update_library/test_update_library_valid.py b/taf/tests/test_updater/test_update_library/test_update_library_valid.py index 54efbb780..499ada3c3 100644 --- a/taf/tests/test_updater/test_update_library/test_update_library_valid.py +++ b/taf/tests/test_updater/test_update_library/test_update_library_valid.py @@ -2,7 +2,7 @@ from taf.tests.test_updater.conftest import SetupManager, add_valid_target_commits from taf.updater.types.update import UpdateType from taf.tests.test_updater.update_utils import ( - _clone_full_library, + clone_full_library, update_and_validate_repositories, ) @@ -38,7 +38,7 @@ def test_update_repository_with_dependencies( origin_dir, client_dir, ): - _clone_full_library( + clone_full_library( library_with_dependencies, origin_dir, client_dir, diff --git a/taf/tests/test_updater/update_utils.py b/taf/tests/test_updater/update_utils.py index 1a37d5018..e921c5f3a 100644 --- a/taf/tests/test_updater/update_utils.py +++ b/taf/tests/test_updater/update_utils.py @@ -80,7 +80,7 @@ def check_if_last_validated_commit_exists(client_auth_repo, should_exist): ) -def _clone_full_library( +def clone_full_library( library_dict, origin_dir, client_dir, diff --git a/taf/tests/test_yubikey/conftest.py b/taf/tests/test_yubikey/conftest.py deleted file mode 100644 index 3b69a5673..000000000 --- a/taf/tests/test_yubikey/conftest.py +++ /dev/null @@ -1,17 +0,0 @@ -import taf.yubikey -from taf.tests import TEST_WITH_REAL_YK -from taf.tests.conftest import KEYSTORE_PATH - -from pytest import fixture -from taf.tools.yubikey.yubikey_utils import TargetYubiKey, _yk_piv_ctrl_mock - - -def pytest_configure(config): - if not TEST_WITH_REAL_YK: - taf.yubikey._yk_piv_ctrl = _yk_piv_ctrl_mock - - -@fixture -def targets_yk(pytestconfig): - """Targets YubiKey.""" - return TargetYubiKey(KEYSTORE_PATH, pytestconfig.option.signature_scheme) diff --git a/taf/tests/test_yubikey/test_yubikey.py b/taf/tests/test_yubikey/test_yubikey.py deleted file mode 100644 index cba061b39..000000000 --- a/taf/tests/test_yubikey/test_yubikey.py +++ /dev/null @@ -1,46 +0,0 @@ -import pytest - -from taf import YubikeyMissingLibrary -from taf.tests import TEST_WITH_REAL_YK - -try: - import taf.yubikey as yk -except ImportError: - yk = YubikeyMissingLibrary() # type: ignore - - -@pytest.mark.skipif(not TEST_WITH_REAL_YK, reason="list_devices() is not mocked.") -def test_is_inserted(): - assert yk.is_inserted() is True - - -def test_serial_num(): - assert yk.get_serial_num() is not None - - -def test_export_piv_x509(): - x509_pem = yk.export_piv_x509() - assert isinstance(x509_pem, bytes) - - -def test_export_piv_pub_key(): - pub_key_pem = yk.export_piv_pub_key() - assert isinstance(pub_key_pem, bytes) - - -def test_sign_piv_rsa_pkcs1v15(targets_yk): - targets_yk.insert() - # yubikey-manager only supports rsa-pkcs1v15-sha256 signature scheme - # so skip test otherwise - if targets_yk.scheme == "rsassa-pss-sha256": - pytest.skip() - - from securesystemslib.rsa_keys import verify_rsa_signature - - message = b"Message to be signed." - scheme = "rsa-pkcs1v15-sha256" - - pub_key_pem = yk.export_piv_pub_key().decode("utf-8") - signature = yk.sign_piv_rsa_pkcs1v15(message, yk.DEFAULT_PIN) - - assert verify_rsa_signature(signature, scheme, pub_key_pem, message) is True diff --git a/taf/tests/tuf/__init__.py b/taf/tests/tuf/__init__.py new file mode 100644 index 000000000..47cf82a48 --- /dev/null +++ b/taf/tests/tuf/__init__.py @@ -0,0 +1,5 @@ +from pathlib import Path + + +# TODO: de-duplicate with conftest.py constants +TEST_DATA_PATH = Path(__file__).parent.parent / "data" diff --git a/taf/tests/tuf/conftest.py b/taf/tests/tuf/conftest.py new file mode 100644 index 000000000..cc74e9d5f --- /dev/null +++ b/taf/tests/tuf/conftest.py @@ -0,0 +1,21 @@ +import pytest +import shutil +import uuid + +from taf.utils import on_rm_error + + +@pytest.fixture(scope="module", autouse=True) +def tuf_repo_dir(repo_dir): + path = repo_dir / "tuf" + path.mkdir() + yield path + shutil.rmtree(path, onerror=on_rm_error) + + +@pytest.fixture(scope="module") +def tuf_repo_path(tuf_repo_dir): + random_name = str(uuid.uuid4()) + path = tuf_repo_dir / random_name / "auth" + yield path + shutil.rmtree(path.parent, onerror=on_rm_error) diff --git a/taf/tests/tuf/test_create_edit_repo/__init__.py b/taf/tests/tuf/test_create_edit_repo/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/taf/tests/tuf/test_create_edit_repo/conftest.py b/taf/tests/tuf/test_create_edit_repo/conftest.py new file mode 100644 index 000000000..a7bff043c --- /dev/null +++ b/taf/tests/tuf/test_create_edit_repo/conftest.py @@ -0,0 +1,18 @@ +import shutil + +from taf.utils import on_rm_error +import pytest +from taf.models.converter import from_dict +from taf.models.types import RolesKeysData +from taf.tuf.repository import MetadataRepository + + +@pytest.fixture(autouse=False) +def tuf_repo( + tuf_repo_path, signers_with_delegations, with_delegations_no_yubikeys_input +): + repo = MetadataRepository(tuf_repo_path) + roles_keys_data = from_dict(with_delegations_no_yubikeys_input, RolesKeysData) + repo.create(roles_keys_data, signers_with_delegations) + yield repo + shutil.rmtree(tuf_repo_path, onerror=on_rm_error) diff --git a/taf/tests/tuf/test_create_edit_repo/test_create_repository.py b/taf/tests/tuf/test_create_edit_repo/test_create_repository.py new file mode 100644 index 000000000..c69286564 --- /dev/null +++ b/taf/tests/tuf/test_create_edit_repo/test_create_repository.py @@ -0,0 +1,132 @@ +import pytest +from taf.tuf.repository import MetadataRepository +from taf.models.types import RolesKeysData +from taf.models.converter import from_dict +from taf.tuf.keys import _get_legacy_keyid + + +def test_create_without_delegations(repo_path, signers, no_yubikeys_input): + # Create new metadata repository + tuf_repo = MetadataRepository(repo_path) + roles_keys_data = from_dict(no_yubikeys_input, RolesKeysData) + tuf_repo.create(roles_keys_data, signers) + + # assert metadata files were created + assert sorted([f.name for f in tuf_repo.metadata_path.glob("*")]) == [ + "1.root.json", + "root.json", + "snapshot.json", + "targets.json", + "timestamp.json", + ] + + # assert correct initial version + assert tuf_repo.root().version == 1 + assert tuf_repo.timestamp().version == 1 + assert tuf_repo.snapshot().version == 1 + assert tuf_repo.targets().version == 1 + + def _get_pub_key_ids(role): + return [_get_legacy_keyid(signer.public_key) for signer in signers[role]] + + # assert correct top-level delegation + for role in ("root", "timestamp", "snapshot", "targets"): + assert tuf_repo.root().roles[role].keyids == _get_pub_key_ids(role) + + # assert correct snapshot and timestamp meta + assert tuf_repo.timestamp().snapshot_meta.version == 1 + assert tuf_repo.snapshot().meta["root.json"].version == 1 + assert tuf_repo.snapshot().meta["targets.json"].version == 1 + assert len(tuf_repo.snapshot().meta) == 2 + + # assert repo cannot be created twice + with pytest.raises(FileExistsError): + tuf_repo.create(roles_keys_data, signers) + + +def test_create_with_delegations( + repo_path, signers_with_delegations, with_delegations_no_yubikeys_input +): + # Create new metadata repository + tuf_repo = MetadataRepository(repo_path) + roles_keys_data = from_dict(with_delegations_no_yubikeys_input, RolesKeysData) + tuf_repo.create(roles_keys_data, signers_with_delegations) + + # assert metadata files were created + assert sorted([f.name for f in tuf_repo.metadata_path.glob("*")]) == [ + "1.root.json", + "delegated_role.json", + "inner_role.json", + "root.json", + "snapshot.json", + "targets.json", + "timestamp.json", + ] + + # assert correct initial version + assert tuf_repo.root().version == 1 + assert tuf_repo.timestamp().version == 1 + assert tuf_repo.snapshot().version == 1 + assert tuf_repo.targets().version == 1 + + def _get_pub_key_ids(role): + return [ + _get_legacy_keyid(signer.public_key) + for signer in signers_with_delegations[role] + ] + + # assert correct top-level delegation + for role in ("root", "timestamp", "snapshot", "targets"): + assert tuf_repo.root().roles[role].keyids == _get_pub_key_ids(role) + + # assert correct delegations + assert len(tuf_repo.targets().delegations.roles) == 1 + assert "delegated_role" in tuf_repo.targets().delegations.roles + + # TODO update this if there is a better way to access delegated role of delegated role + # tuf_repo.targets().delegations.roles is a list of DelegatedRole objects + # DelegatedRole does not have a delegations property + inner_role = tuf_repo.open("inner_role") + assert inner_role + + # assert correct snapshot and timestamp meta + assert tuf_repo.timestamp().snapshot_meta.version == 1 + assert tuf_repo.snapshot().meta["root.json"].version == 1 + assert tuf_repo.snapshot().meta["targets.json"].version == 1 + assert tuf_repo.snapshot().meta["delegated_role.json"].version == 1 + assert tuf_repo.snapshot().meta["inner_role.json"].version == 1 + assert len(tuf_repo.snapshot().meta) == 4 + + # assert repo cannot be created twice + with pytest.raises(FileExistsError): + tuf_repo.create(roles_keys_data, signers_with_delegations) + + +def test_create_with_additional_public_keys( + repo_path, signers_with_delegations, with_delegations_no_yubikeys_input, public_keys +): + # Create new metadata repository + tuf_repo = MetadataRepository(repo_path) + roles_keys_data = from_dict(with_delegations_no_yubikeys_input, RolesKeysData) + + additional_verification_keys = { + "targets": public_keys["targets"], + "delegated_role": public_keys["snapshot"], + } + + targets_signing_keys_num = len(signers_with_delegations["targets"]) + delegated_role_signing_keys_num = len(signers_with_delegations["delegated_role"]) + + tuf_repo.create( + roles_keys_data, signers_with_delegations, additional_verification_keys + ) + + # assert correct initial version + assert len(tuf_repo._role_obj("targets").keyids) == targets_signing_keys_num + len( + additional_verification_keys["targets"] + ) + assert len( + tuf_repo._role_obj("delegated_role").keyids + ) == delegated_role_signing_keys_num + len( + additional_verification_keys["delegated_role"] + ) diff --git a/taf/tests/tuf/test_create_edit_repo/test_targets.py b/taf/tests/tuf/test_create_edit_repo/test_targets.py new file mode 100644 index 000000000..fefad75dd --- /dev/null +++ b/taf/tests/tuf/test_create_edit_repo/test_targets.py @@ -0,0 +1,185 @@ +from collections import defaultdict + + +def test_add_target_files(tuf_repo): + + # assert add target file and correct version bumps + path1 = "test1" + tuf_repo.add_target_files_to_role({path1: {"target": "test1"}}) + assert (tuf_repo.path / "targets" / path1).is_file() + assert tuf_repo.targets().targets[path1] + assert tuf_repo.targets().targets[path1].length > 0 + assert len(tuf_repo.targets().targets[path1].hashes) == 2 + assert tuf_repo.root().version == 1 + assert tuf_repo.timestamp().version == 1 + assert tuf_repo.snapshot().version == 1 + assert tuf_repo.targets().version == 2 + + # now add with custom + path2 = "test2" + custom = {"custom_attr": "custom_val"} + tuf_repo.add_target_files_to_role({path2: {"target": "test2", "custom": custom}}) + assert (tuf_repo.path / "targets" / path2).is_file() + assert tuf_repo.targets().targets[path2].length > 0 + assert tuf_repo.targets().targets[path2].custom == custom + + +def test_repo_target_files(tuf_repo): + # assert add target file and correct version bumps + path1 = "test1" + path2 = "test2" + tuf_repo.add_target_files_to_role( + {path1: {"target": "test1"}, path2: {"target": "test2"}} + ) + for path in (path1, path2): + assert (tuf_repo.path / "targets" / path).is_file() + assert tuf_repo.targets().targets[path].length > 0 + + tuf_repo.modify_targets(added_data=None, removed_data={path1: None}) + assert not (tuf_repo.path / "targets" / path1).is_file() + assert (tuf_repo.path / "targets" / path2).is_file() + assert path1 not in tuf_repo.targets().targets + assert path2 in tuf_repo.targets().targets + + +def test_repo_target_files_with_delegations(tuf_repo): + + target_path1 = "test1" + target_path2 = "test2" + + tuf_repo.add_target_files_to_role( + {target_path1: {"target": "test1"}, target_path2: {"target": "test2"}} + ) + for path in (target_path1, target_path2): + assert (tuf_repo.path / "targets" / path).is_file() + assert tuf_repo.targets().targets[path].length > 0 + + delegated_path1 = "dir1/path1" + delegated_path2 = "dir2/path1" + + tuf_repo.add_target_files_to_role( + {delegated_path1: {"target": "test1"}, delegated_path2: {"target": "test2"}} + ) + for path in (delegated_path1, delegated_path2): + assert (tuf_repo.path / "targets" / path).is_file() + assert tuf_repo._signed_obj("delegated_role").targets[path].length > 0 + + path_delegated = "dir2/path2" + tuf_repo.add_target_files_to_role( + { + path_delegated: {"target": "test3"}, + } + ) + assert tuf_repo._signed_obj("inner_role").targets[path_delegated].length > 0 + + +def test_get_all_target_files_state(tuf_repo): + + # assert add target file and correct version bumps + + target_path1 = "test1" + target_path2 = "test2" + + tuf_repo.add_target_files_to_role( + {target_path1: {"target": "test1"}, target_path2: {"target": "test2"}} + ) + + (tuf_repo.path / "targets" / target_path1).unlink() + + delegated_path1 = "dir1/path1" + delegated_path2 = "dir2/path1" + + tuf_repo.add_target_files_to_role( + {delegated_path1: {"target": "test1"}, delegated_path2: {"target": "test2"}} + ) + path = tuf_repo.path / "targets" / delegated_path1 + path.write_text("Updated content") + + actual = tuf_repo.get_all_target_files_state() + assert actual == ( + {delegated_path1: {"target": "Updated content"}}, + {target_path1: {}}, + ) + + +def test_delete_unregistered_target_files(tuf_repo): + + # assert add target file and correct version bumps + tuf_repo.add_target_files_to_role( + {"test1": {"target": "test1"}, "test2": {"target": "test2"}} + ) + + tuf_repo.add_target_files_to_role( + {"dir1/path1": {"target": "test1"}, "dir2/path1": {"target": "test2"}} + ) + new_target1 = tuf_repo.path / "targets" / "new" + new_target1.touch() + new_target2 = tuf_repo.path / "targets" / "dir1" / "new" + new_target2.touch() + assert new_target1.is_file() + assert new_target2.is_file() + tuf_repo.delete_unregistered_target_files() + assert not new_target1.is_file() + tuf_repo.delete_unregistered_target_files("delegated_role") + assert not new_target2.is_file() + + +def test_update_target_toles(tuf_repo): + # create files on disk and then update the roles + # check if the metadata files were updated successfully + + targets_dir = tuf_repo.path / "targets" + dir1 = targets_dir / "dir1" + dir1.mkdir(parents=True) + + new_target1 = targets_dir / "new1" + new_target1.write_text( + "This file is not empty and its lenght should be greater than 0" + ) + new_target2 = dir1 / "new2" + new_target2.touch() + new_target3 = dir1 / "new3" + new_target3.write_text("This file also contains something") + + added_targets_data, removed_targets_data = tuf_repo.get_all_target_files_state() + assert len(added_targets_data) == 3 + assert len(removed_targets_data) == 0 + + roles_and_targets = defaultdict(list) + for path in added_targets_data: + roles_and_targets[tuf_repo.get_role_from_target_paths([path])].append(path) + + len(roles_and_targets) == 2 + assert len(roles_and_targets["targets"]) == 1 + assert len(roles_and_targets["delegated_role"]) == 2 + + tuf_repo.update_target_role("targets", roles_and_targets["targets"]) + targets_obj = tuf_repo._signed_obj("targets") + assert targets_obj.targets + assert len(targets_obj.targets) == 1 + target_name = "new1" + assert target_name in targets_obj.targets + assert targets_obj.targets[target_name].length > 0 + assert ( + "sha256" in targets_obj.targets[target_name].hashes + and "sha512" in targets_obj.targets[target_name].hashes + ) + + tuf_repo.update_target_role("delegated_role", roles_and_targets["delegated_role"]) + targets_obj = tuf_repo._signed_obj("delegated_role") + assert targets_obj.targets + assert len(targets_obj.targets) == 2 + target_name = "dir1/new2" + assert target_name in targets_obj.targets + assert targets_obj.targets[target_name].length == 0 + assert ( + "sha256" in targets_obj.targets[target_name].hashes + and "sha512" in targets_obj.targets[target_name].hashes + ) + target_name = "dir1/new3" + assert target_name in targets_obj.targets + assert targets_obj.targets[target_name].length > 0 + assert ( + "sha256" in targets_obj.targets[target_name].hashes + and "sha512" in targets_obj.targets[target_name].hashes + ) diff --git a/taf/tests/tuf/test_create_edit_repo/test_update.py b/taf/tests/tuf/test_create_edit_repo/test_update.py new file mode 100644 index 000000000..f7eddded8 --- /dev/null +++ b/taf/tests/tuf/test_create_edit_repo/test_update.py @@ -0,0 +1,336 @@ +import datetime + +from taf.models.types import TargetsRole +from taf.tuf.keys import _get_legacy_keyid + + +def test_update_expiration_date(tuf_repo, signers_with_delegations): + + assert tuf_repo.root().version == 1 + today = datetime.datetime.now(datetime.timezone.utc).date() + assert tuf_repo.get_expiration_date("root").date() == today + datetime.timedelta( + days=365 + ) + tuf_repo.set_metadata_expiration_date( + "root", signers_with_delegations["root"], interval=730 + ) + assert tuf_repo.get_expiration_date("root").date() == today + datetime.timedelta( + days=730 + ) + assert tuf_repo.root().version == 2 + # timestamp and snapshot are not updated here + assert tuf_repo.timestamp().version == 1 + assert tuf_repo.snapshot().version == 1 + + +def test_add_delegated_paths(tuf_repo): + + new_paths = ["new", "paths"] + tuf_repo.add_path_to_delegated_role(role="delegated_role", paths=new_paths) + + assert tuf_repo.root().version == 1 + assert tuf_repo.targets().version == 2 + assert tuf_repo.timestamp().version == 1 + assert tuf_repo.snapshot().version == 1 + + for path in new_paths: + assert ( + path in tuf_repo.get_delegations_of_role("targets")["delegated_role"].paths + ) + + +def test_add_new_role(tuf_repo, signers): + role_name = "test" + targets_parent_role = TargetsRole() + paths = ["test1", "test2"] + threshold = 2 + keys_number = 2 + + role_signers = {role_name: [signers["targets"][0], signers["snapshot"][0]]} + new_role = TargetsRole( + name=role_name, + parent=targets_parent_role, + paths=paths, + number=keys_number, + threshold=threshold, + yubikey=False, + ) + tuf_repo.create_delegated_roles([new_role], role_signers) + assert tuf_repo.targets().version == 2 + assert role_name in tuf_repo.targets().delegations.roles + new_role_obj = tuf_repo.open(role_name) + assert new_role_obj + assert tuf_repo._role_obj(role_name).threshold == threshold + + tuf_repo.add_new_roles_to_snapshot([role_name]) + assert tuf_repo.snapshot().version == 2 + assert f"{role_name}.json" in tuf_repo.snapshot().meta + + +def test_remove_delegated_paths(tuf_repo): + + paths_to_remove = ["dir2/path1"] + tuf_repo.remove_delegated_paths({"delegated_role": paths_to_remove}) + + assert tuf_repo.root().version == 1 + assert tuf_repo.targets().version == 2 + assert tuf_repo.timestamp().version == 1 + assert tuf_repo.snapshot().version == 1 + + for path in paths_to_remove: + assert ( + path + not in tuf_repo.get_delegations_of_role("targets")["delegated_role"].paths + ) + + +def test_add_metadata_keys(tuf_repo, signers_with_delegations, public_keys): + + # there public keys were loaded from a different keystore + # (are used to instantiate a repositoru with no delegations) + + new_targets_key = public_keys["targets"][0] + new_snapshot_key = public_keys["snapshot"][0] + new_delegated_key = new_targets_key + + roles_keys = { + "targets": [new_targets_key], + "delegated_role": [new_delegated_key], + "snapshot": [new_snapshot_key], + } + + tuf_repo.add_signers_to_cache(signers_with_delegations) + added_keys, already_added_keys, invalid_keys = tuf_repo.add_metadata_keys( + roles_keys + ) + assert len(added_keys) == 3 + assert len(already_added_keys) == 0 + assert len(invalid_keys) == 0 + + assert _get_legacy_keyid(new_targets_key) in tuf_repo.root().roles["targets"].keyids + assert ( + _get_legacy_keyid(new_snapshot_key) in tuf_repo.root().roles["snapshot"].keyids + ) + assert _get_legacy_keyid(new_targets_key) in tuf_repo.root().keys + assert _get_legacy_keyid(new_snapshot_key) in tuf_repo.root().keys + assert ( + _get_legacy_keyid(new_delegated_key) + in tuf_repo._role_obj("delegated_role").keyids + ) + assert tuf_repo.root().version == 2 + assert tuf_repo.targets().version == 2 + + assert tuf_repo.snapshot().version == 1 + assert tuf_repo._signed_obj("delegated_role").version == 1 + assert tuf_repo.timestamp().snapshot_meta.version == 1 + assert tuf_repo.snapshot().meta["root.json"].version == 1 + assert tuf_repo.snapshot().meta["targets.json"].version == 1 + + tuf_repo.update_snapshot_and_timestamp() + assert tuf_repo.snapshot().version == 2 + assert tuf_repo._signed_obj("delegated_role").version == 1 + assert tuf_repo.timestamp().snapshot_meta.version == 2 + assert tuf_repo.snapshot().meta["root.json"].version == 2 + assert tuf_repo.snapshot().meta["targets.json"].version == 2 + + new_root_key = public_keys["root"][0] + roles_keys = { + "root": [new_root_key], + } + # assert add new root key and version bumps (all but targets) + tuf_repo.add_metadata_keys(roles_keys) + + assert _get_legacy_keyid(new_root_key) in tuf_repo.root().roles["root"].keyids + assert _get_legacy_keyid(new_root_key) in tuf_repo.root().keys + assert tuf_repo.root().version == 3 + assert tuf_repo.targets().version == 2 + + assert tuf_repo.snapshot().version == 2 + assert tuf_repo.timestamp().snapshot_meta.version == 2 + assert tuf_repo.snapshot().meta["root.json"].version == 2 + assert tuf_repo.snapshot().meta["targets.json"].version == 2 + + tuf_repo.update_snapshot_and_timestamp() + assert tuf_repo.snapshot().version == 3 + assert tuf_repo.timestamp().snapshot_meta.version == 3 + assert tuf_repo.snapshot().meta["root.json"].version == 3 + assert tuf_repo.snapshot().meta["targets.json"].version == 2 + + # assert add new timestamp key and version bumps (all but targets) + new_timestamp_key = public_keys["timestamp"][0] + roles_keys = { + "timestamp": [new_timestamp_key], + } + # assert add new root key and version bumps (all but targets) + tuf_repo.add_metadata_keys(roles_keys) + tuf_repo.update_snapshot_and_timestamp() + + assert ( + _get_legacy_keyid(new_timestamp_key) + in tuf_repo.root().roles["timestamp"].keyids + ) + assert _get_legacy_keyid(new_timestamp_key) in tuf_repo.root().keys + assert tuf_repo.root().version == 4 + assert tuf_repo.timestamp().version == 4 + assert tuf_repo.snapshot().version == 4 + assert tuf_repo.targets().version == 2 + assert tuf_repo.timestamp().snapshot_meta.version == 4 + assert tuf_repo.snapshot().meta["root.json"].version == 4 + assert tuf_repo.snapshot().meta["targets.json"].version == 2 + + # assert add new timestamp key and version bumps (all but targets) + new_snapshot_key = public_keys["timestamp"][ + 0 + ] # make sure this key was not already added + roles_keys = { + "snapshot": [new_snapshot_key], + } + # assert add new root key and version bumps (all but targets) + tuf_repo.add_metadata_keys(roles_keys) + tuf_repo.update_snapshot_and_timestamp() + + assert ( + _get_legacy_keyid(new_snapshot_key) in tuf_repo.root().roles["snapshot"].keyids + ) + assert _get_legacy_keyid(new_snapshot_key) in tuf_repo.root().keys + assert tuf_repo.root().version == 5 + assert tuf_repo.snapshot().version == 5 + assert tuf_repo.snapshot().version == 5 + assert tuf_repo.targets().version == 2 + assert tuf_repo.snapshot().meta["root.json"].version == 5 + assert tuf_repo.snapshot().meta["targets.json"].version == 2 + + # assert add new timestamp key and version bumps (all but targets) + new_targets_key = public_keys["root"][1] + roles_keys = { + "targets": [new_targets_key], + } + # assert add new root key and version bumps (all but targets) + tuf_repo.add_metadata_keys(roles_keys) + tuf_repo.update_snapshot_and_timestamp() + + assert _get_legacy_keyid(new_targets_key) in tuf_repo.root().roles["targets"].keyids + assert _get_legacy_keyid(new_targets_key) in tuf_repo.root().keys + assert tuf_repo.root().version == 6 + assert tuf_repo.timestamp().version == 6 + assert tuf_repo.snapshot().version == 6 + assert tuf_repo.targets().version == 2 + assert tuf_repo.snapshot().meta["root.json"].version == 6 + assert tuf_repo.snapshot().meta["targets.json"].version == 2 + + # try adding again, the metadata should not be updated + tuf_repo.add_metadata_keys(roles_keys) + tuf_repo.update_snapshot_and_timestamp() + + assert _get_legacy_keyid(new_targets_key) in tuf_repo.root().roles["targets"].keyids + assert _get_legacy_keyid(new_targets_key) in tuf_repo.root().keys + assert tuf_repo.root().version == 6 + assert tuf_repo.timestamp().version == 7 + assert tuf_repo.snapshot().version == 7 + assert tuf_repo.targets().version == 2 + assert tuf_repo.snapshot().meta["root.json"].version == 6 + assert tuf_repo.snapshot().meta["targets.json"].version == 2 + + +def test_revoke_metadata_key( + tuf_repo, signers_with_delegations, public_keys_with_delegations, public_keys +): + + tuf_repo.add_signers_to_cache(signers_with_delegations) + targets_key1 = public_keys_with_delegations["targets"][0] + targets_key2 = public_keys_with_delegations["targets"][1] + targets_key1_id = _get_legacy_keyid(targets_key1) + targets_key2_id = _get_legacy_keyid(targets_key2) + + assert targets_key1_id in tuf_repo.root().roles["targets"].keyids + assert targets_key1_id in tuf_repo.root().keys + + ( + removed_from_roles, + not_added_roles, + less_than_threshold_roles, + ) = tuf_repo.revoke_metadata_key(targets_key1_id, ["targets"]) + assert len(removed_from_roles) == 1 + assert len(not_added_roles) == 0 + assert len(less_than_threshold_roles) == 0 + + assert targets_key1_id not in tuf_repo.root().roles["targets"].keyids + assert targets_key1_id not in tuf_repo.root().keys + assert len(tuf_repo._role_obj("targets").keyids) == 1 + assert tuf_repo.root().version == 2 + assert tuf_repo.targets().version == 1 + + assert tuf_repo.timestamp().version == 1 + assert tuf_repo.snapshot().version == 1 + + tuf_repo.update_snapshot_and_timestamp() + assert tuf_repo.timestamp().version == 2 + assert tuf_repo.snapshot().version == 2 + # the second key cannot be removed because there is only one key left now + ( + removed_from_roles, + not_added_roles, + less_than_threshold_roles, + ) = tuf_repo.revoke_metadata_key(targets_key2_id, ["targets"]) + + assert targets_key2_id in tuf_repo.root().roles["targets"].keyids + assert targets_key2_id in tuf_repo.root().keys + assert len(removed_from_roles) == 0 + assert len(not_added_roles) == 0 + assert len(less_than_threshold_roles) == 1 + + # try to remove key + # will not be possible, number == threshold + delegated_key1 = public_keys_with_delegations["delegated_role"][0] + delegated_key1_id = _get_legacy_keyid(delegated_key1) + + assert tuf_repo.root().version == 2 + assert tuf_repo.timestamp().version == 2 + assert tuf_repo.snapshot().version == 2 + assert tuf_repo.targets().version == 1 + + assert delegated_key1_id in tuf_repo._role_obj("delegated_role").keyids + ( + removed_from_roles, + not_added_roles, + less_than_threshold_roles, + ) = tuf_repo.revoke_metadata_key(delegated_key1_id, ["delegated_role"]) + assert len(removed_from_roles) == 0 + assert len(not_added_roles) == 0 + assert len(less_than_threshold_roles) == 1 + assert delegated_key1_id in tuf_repo._role_obj("delegated_role").keyids + + # add a key + new_delegated_key = public_keys["targets"][0] + + roles_keys = { + "delegated_role": [new_delegated_key], + } + new_delegated_key_id = _get_legacy_keyid(new_delegated_key) + + tuf_repo.add_metadata_keys(roles_keys) + tuf_repo.update_snapshot_and_timestamp() + assert new_delegated_key_id in tuf_repo._role_obj("delegated_role").keyids + + assert tuf_repo.root().version == 2 + assert tuf_repo.timestamp().version == 3 + assert tuf_repo.snapshot().version == 3 + assert tuf_repo.targets().version == 2 + + assert delegated_key1_id in tuf_repo._role_obj("delegated_role").keyids + # now try removing one of delegated keys again + ( + removed_from_roles, + not_added_roles, + less_than_threshold_roles, + ) = tuf_repo.revoke_metadata_key(delegated_key1_id, ["delegated_role"]) + tuf_repo.update_snapshot_and_timestamp() + assert len(removed_from_roles) == 1 + assert len(not_added_roles) == 0 + assert len(less_than_threshold_roles) == 0 + assert delegated_key1_id not in tuf_repo._role_obj("delegated_role").keyids + + assert tuf_repo.root().version == 2 + assert tuf_repo.timestamp().version == 4 + assert tuf_repo.snapshot().version == 4 + assert tuf_repo.targets().version == 3 diff --git a/taf/tests/tuf/test_keys/conftest.py b/taf/tests/tuf/test_keys/conftest.py new file mode 100644 index 000000000..ae71d4620 --- /dev/null +++ b/taf/tests/tuf/test_keys/conftest.py @@ -0,0 +1,18 @@ +import pytest +import shutil + +from taf.utils import on_rm_error +from taf.models.converter import from_dict +from taf.models.types import RolesKeysData +from taf.tuf.repository import MetadataRepository + + +@pytest.fixture(autouse=False) +def tuf_repo( + tuf_repo_path, signers_with_delegations, with_delegations_no_yubikeys_input +): + repo = MetadataRepository(tuf_repo_path) + roles_keys_data = from_dict(with_delegations_no_yubikeys_input, RolesKeysData) + repo.create(roles_keys_data, signers_with_delegations) + yield repo + shutil.rmtree(tuf_repo_path, onerror=on_rm_error) diff --git a/taf/tests/tuf/test_keys/test_keys.py b/taf/tests/tuf/test_keys/test_keys.py new file mode 100644 index 000000000..eb27649fe --- /dev/null +++ b/taf/tests/tuf/test_keys/test_keys.py @@ -0,0 +1,51 @@ +import pytest +from tuf.api.metadata import Metadata, Root +from taf.tuf.keys import load_public_key_from_file, load_signer_from_file + +from securesystemslib.exceptions import UnverifiedSignatureError + + +def test_keys(tuf_repo, keystore_delegations): + """ + Test loading public and private keys, and compatiblity with existing + metadata: + - newly loaded keys can verify old signatures on metadata + - old keys in metadata can verify signatures from newly loaded signers + + """ + + root = Metadata[Root].from_file(tuf_repo.metadata_path / "root.json") + for name in [ + "root1", + "root2", + "root3", + "snapshot", + "targets1", + "targets2", + "timestamp", + ]: + public_key = load_public_key_from_file(keystore_delegations / f"{name}.pub") + + # assert hard-coded scheme and correct legacy keyid + assert public_key.scheme == "rsa-pkcs1v15-sha256" + assert public_key.keyid in root.signed.keys + + signer = load_signer_from_file(keystore_delegations / name, None) + + # assert public key loaded from disk matches public key derived + # from private key loaded from disk + assert public_key == signer.public_key + + # assert existing keys verify new signatures + sig = signer.sign(b"DATA") + existing_key = root.signed.keys[public_key.keyid] + existing_key.verify_signature(sig, b"DATA") + with pytest.raises(UnverifiedSignatureError): + existing_key.verify_signature(sig, b"NOT DATA") + + # assert newly loaded keys verify existing signatures + if name.startswith("root"): # there are only root sigs on root metadata + existing_sig = root.signatures[public_key.keyid] + public_key.verify_signature(existing_sig, root.signed_bytes) + with pytest.raises(UnverifiedSignatureError): + existing_key.verify_signature(sig, b"NOT DATA") diff --git a/taf/tests/tuf/test_keys/test_yk.py b/taf/tests/tuf/test_keys/test_yk.py new file mode 100644 index 000000000..63efcadb5 --- /dev/null +++ b/taf/tests/tuf/test_keys/test_yk.py @@ -0,0 +1,73 @@ +"""Test YkSigner""" + +from getpass import getpass +import os +import pytest + +from securesystemslib.exceptions import UnverifiedSignatureError + + +# Test data to sign +_DATA = b"DATA" +_NOT_DATA = b"NOT DATA" + +# Test public key +# >>> with open("taf/tests/data/keystores/keystore/root1.pub", "rb") as f: +# >>> _PUB = f.read() +_PUB = b"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5EGVh9xqVFFHnGGIofks\ncA3vHWFs1QP60QTX+ZJUPiUJdDb8wuJ6mu9d8bKojE3SEVHCLpJeV4+muMnLtZWq\nAipiuFUU9QDpOYaqQ5SD5n/9sZfiWDzjVsqZA4WMj0OCd/Bkn+umz3ljHFe0EJUE\nCxYRvmArC05UyJej7fCaQ/cD7QELrpmBaE2qLcG0Vfirz9NekaXixGiKNiIjHAj6\nYwIfES9SycVo42LEOskGFciqgfZJVtSaTIurW+KnOToStazEWY8okon91s+5ltIN\nOS68TtBLtph5PXcLhqSozE8SqMW3gZni6zXHHQtuouFLdGkgw+0V2YLX15Ka78zj\nhQIDAQAB\n-----END PUBLIC KEY-----" + +# Test signature +# >>> signer = load_signer_from_file("taf/tests/data/keystores/keystore/root1", None) +# >>> sig = signer.sign(_DATA) +# >>> _SIG = bytes.fromhex(sig.signature) +_SIG = b"\xc1}\xaa\xec\xf6#;\xe6\x89\xc26\x81\x1a;\xd3\xb2\x7f\xce\xe3}\x9a6w}P\xe0d\x8d\xeb\xbcb\xba8\x8c\x96tS\xf2_\xf37\xe8Z\xc4\xf4\x1a\xaa\xdd\xdd%AB#w\x93\xc9\x0f\x8d\xe4\x93)\x9f\xa4)\x0b\xbb\xce\xf4\x9e\x8b\xaa\x1c\xda\xb8\x9ex\xe2\xc8\x9c\x02\\\xb7\x89\x88g\xd3\xb2\x0be\xf4S\x0c*\x0c\xce\xfe\x8aL=\x07\xfa\xe9\xa2\xe1\xed\x1cA\xf9\xbeZR\x91\xae@\x12\xfe\xbey`\x07 /)Z_\xd0\xca\x7f\xcey\xe6\x1ee~\x01\x0c\xcfQZ=a\xf6\xe9\xabm_\x12\x8e\xda\xb0\xd4\xaeb1W\x0e\xf0\x909\xae\x05}\x8f\xba\xf7\xa0\\Rx\xe9\x98\x0f4j86\x87\x17\xf5\xff\xc2U\x80oh\xad\xb2\xaf\xa5\x91\x9a\xafI,\xadj\xd5\x02$\xc6\xf8\xf2`y\xd2\xa6\xf3\xce[;\r\xb6y\xd4\xa5\x96y$}{!r\xc1\xfb@\x1e<\xd9\xa0\xe6\x7f\xf1\x17\xe5\x0c\x8e\xbd\xf3\xba" + + +def is_yubikey_manager_installed(): + try: + import taf.yubikey # noqa: F401 + except ImportError: + return False + else: + return True + + +@pytest.mark.skipif( + not is_yubikey_manager_installed(), + reason="Yubikey Manager not installed)", +) +def test_fake_yk(mocker): + """Test public key export and signing with fake Yubikey.""" + mocker.patch("taf.yubikey.export_piv_pub_key", return_value=_PUB) + mocker.patch("taf.yubikey.sign_piv_rsa_pkcs1v15", return_value=_SIG) + + from taf.tuf.keys import YkSigner + + key = YkSigner.import_() + signer = YkSigner(key, lambda sec: None) + + sig = signer.sign(_DATA) + key.verify_signature(sig, _DATA) + with pytest.raises(UnverifiedSignatureError): + key.verify_signature(sig, _NOT_DATA) + + +@pytest.mark.skipif( + not os.environ.get("REAL_YK"), + reason="Run test with REAL_YK=1 (test will prompt for pin)", +) +def test_real_yk(): + """Test public key export and signing with real Yubikey.""" + + def sec_handler(secret_name: str) -> str: + return getpass(f"Enter {secret_name}: ") + + from taf.tuf.keys import YkSigner + + key = YkSigner.import_() + signer = YkSigner(key, sec_handler) + + sig = signer.sign(_DATA) + key.verify_signature(sig, _DATA) + with pytest.raises(UnverifiedSignatureError): + key.verify_signature(sig, _NOT_DATA) diff --git a/taf/tests/tuf/test_query_repo/conftest.py b/taf/tests/tuf/test_query_repo/conftest.py new file mode 100644 index 000000000..8bfd3b849 --- /dev/null +++ b/taf/tests/tuf/test_query_repo/conftest.py @@ -0,0 +1,61 @@ +import shutil +from taf.tuf.repository import MetadataRepository +from taf.utils import on_rm_error +import pytest +from taf.models.types import RolesKeysData +from taf.models.converter import from_dict + + +@pytest.fixture(scope="module") +def tuf_repo_no_delegations(tuf_repo_path, signers, no_yubikeys_input): + # Create new metadata repository + path = tuf_repo_path / "repository_without_delegations" + path.mkdir(parents=True) + tuf_repo = MetadataRepository(path) + roles_keys_data = from_dict(no_yubikeys_input, RolesKeysData) + tuf_repo.create(roles_keys_data, signers) + + tuf_repo.add_target_files_to_role( + {"test1.txt": {"target": "test1"}, "test2.txt": {"target": "test2"}} + ) + yield tuf_repo + shutil.rmtree(path, onerror=on_rm_error) + + +@pytest.fixture(scope="module") +def tuf_repo_with_delegations( + tuf_repo_path, signers_with_delegations, with_delegations_no_yubikeys_input +): + # Create new metadata repository + path = tuf_repo_path / "repository_with_delegations" + path.mkdir(parents=True) + tuf_repo = MetadataRepository(path) + roles_keys_data = from_dict(with_delegations_no_yubikeys_input, RolesKeysData) + tuf_repo.create(roles_keys_data, signers_with_delegations) + + # targets role's targets + target_path1 = "test1" + target_path2 = "test2" + tuf_repo.add_target_files_to_role( + {target_path1: {"target": "test1"}, target_path2: {"target": "test2"}} + ) + delegated_path1 = "dir1/path1" + delegated_path2 = "dir2/path1" + custom1 = {"custom_attr1": "custom_val1"} + custom2 = {"custom_attr2": "custom_val2"} + + tuf_repo.add_target_files_to_role( + { + delegated_path1: {"target": "test1", "custom": custom1}, + delegated_path2: {"target": "test2", "custom": custom2}, + } + ) + + path_delegated = "dir2/path2" + tuf_repo.add_target_files_to_role( + { + path_delegated: {"target": "test3"}, + } + ) + yield tuf_repo + shutil.rmtree(path, onerror=on_rm_error) diff --git a/taf/tests/tuf/test_query_repo/test_query_repo.py b/taf/tests/tuf/test_query_repo/test_query_repo.py new file mode 100644 index 000000000..749363027 --- /dev/null +++ b/taf/tests/tuf/test_query_repo/test_query_repo.py @@ -0,0 +1,316 @@ +import pytest +import datetime +from taf.exceptions import TAFError + + +def test_open(tuf_repo_with_delegations): + # assert existing role metadata can be opened + for role in [ + "root", + "timestamp", + "snapshot", + "targets", + "delegated_role", + "inner_role", + ]: + assert tuf_repo_with_delegations.open(role) + + # assert non-existing role metadata cannot be opened + with pytest.raises(TAFError): + tuf_repo_with_delegations.open("foo") + + +def test_get_threshold_no_delegations(tuf_repo_no_delegations): + assert tuf_repo_no_delegations.get_role_threshold("root") == 2 + assert tuf_repo_no_delegations.get_role_threshold("targets") == 1 + assert tuf_repo_no_delegations.get_role_threshold("snapshot") == 1 + assert tuf_repo_no_delegations.get_role_threshold("timestamp") == 1 + with pytest.raises(TAFError): + tuf_repo_no_delegations.get_role_threshold("doestexist") + + +def test_get_threshold_delegations(tuf_repo_with_delegations): + assert tuf_repo_with_delegations.get_role_threshold("root") == 2 + assert tuf_repo_with_delegations.get_role_threshold("targets") == 1 + assert tuf_repo_with_delegations.get_role_threshold("snapshot") == 1 + assert tuf_repo_with_delegations.get_role_threshold("timestamp") == 1 + assert tuf_repo_with_delegations.get_role_threshold("delegated_role") == 2 + assert tuf_repo_with_delegations.get_role_threshold("inner_role") == 1 + + +def test_get_expiration_date(tuf_repo_with_delegations): + today = datetime.datetime.now(datetime.timezone.utc).date() + assert tuf_repo_with_delegations.get_expiration_date( + "root" + ).date() == today + datetime.timedelta(days=365) + assert tuf_repo_with_delegations.get_expiration_date( + "targets" + ).date() == today + datetime.timedelta(days=90) + assert tuf_repo_with_delegations.get_expiration_date( + "delegated_role" + ).date() == today + datetime.timedelta(days=90) + + +def test_get_all_target_roles_no_delegations(tuf_repo_no_delegations): + assert tuf_repo_no_delegations.get_all_targets_roles() == ["targets"] + + +def test_get_all_target_roles_with_delegations(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.get_all_targets_roles() + assert len(actual) == 3 + assert set(actual) == {"targets", "delegated_role", "inner_role"} + + +def test_get_all_roles_with_delegations(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.get_all_roles() + assert len(actual) == 6 + assert set(actual) == { + "root", + "snapshot", + "timestamp", + "targets", + "delegated_role", + "inner_role", + } + + +def test_find_delegated_roles_parent(tuf_repo_with_delegations): + assert ( + tuf_repo_with_delegations.find_delegated_roles_parent("delegated_role") + == "targets" + ) + assert ( + tuf_repo_with_delegations.find_delegated_roles_parent("inner_role") + == "delegated_role" + ) + + +def test_check_if_role_exists(tuf_repo_with_delegations): + assert tuf_repo_with_delegations.check_if_role_exists("targets") + assert tuf_repo_with_delegations.check_if_role_exists("inner_role") + assert not tuf_repo_with_delegations.check_if_role_exists("doesntexist") + + +def test_check_roles_expiration_dates(tuf_repo_no_delegations): + ( + expired_dict, + will_expire_dict, + ) = tuf_repo_no_delegations.check_roles_expiration_dates() + assert not len(expired_dict) + assert "root" not in will_expire_dict + assert "targets" not in will_expire_dict + assert "timestamp" in will_expire_dict + + +def test_get_role_paths(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.get_role_paths("delegated_role") + assert actual == ["dir1/*", "dir2/path1"] + actual = tuf_repo_with_delegations.get_role_paths("inner_role") + assert actual == ["dir2/path2"] + + +def test_signing_roles(tuf_repo_with_delegations): + test_target_paths = ["dir1/file1.txt", "dir2/path2", "other"] + actual = tuf_repo_with_delegations.map_signing_roles(test_target_paths) + assert actual["dir1/file1.txt"] == "delegated_role" + assert actual["dir2/path2"] == "inner_role" + assert actual["other"] == "targets" + + +def test_get_role_from_target_paths(tuf_repo_with_delegations): + assert ( + tuf_repo_with_delegations.get_role_from_target_paths( + ["dir1/file1.txt", "dir1/file2.txt"] + ) + == "delegated_role" + ) + + +def test_find_keys_roles(tuf_repo_with_delegations, public_keys_with_delegations): + target_keys = public_keys_with_delegations["targets"] + delegated_role_keys = public_keys_with_delegations["delegated_role"] + actual = tuf_repo_with_delegations.find_keys_roles( + target_keys + delegated_role_keys + ) + assert actual == ["targets", "delegated_role"] + actual = tuf_repo_with_delegations.find_keys_roles( + target_keys[2:] + delegated_role_keys + ) + assert actual == ["delegated_role"] + root_keys = public_keys_with_delegations["root"] + actual = tuf_repo_with_delegations.find_keys_roles(root_keys) + assert actual == ["root"] + + +def test_find_associated_roles_of_key( + tuf_repo_with_delegations, public_keys_with_delegations +): + for role in ( + "root", + "targets", + "snapshot", + "timestamp", + "delegated_role", + "inner_role", + ): + key = public_keys_with_delegations[role][0] + assert tuf_repo_with_delegations.find_associated_roles_of_key(key) == [role] + + +def test_all_target_files(tuf_repo_with_delegations): + # this method is expected to list all target files inside the targets directory + actual = tuf_repo_with_delegations.all_target_files() + assert actual == {"test2", "test1", "dir2/path2", "dir1/path1", "dir2/path1"} + + +def test_get_signed_target_files_of_roles(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.get_signed_target_files_of_roles() + assert actual == {"test2", "test1", "dir2/path2", "dir1/path1", "dir2/path1"} + actual = tuf_repo_with_delegations.get_signed_target_files_of_roles(["targets"]) + assert actual == {"test2", "test1"} + actual = tuf_repo_with_delegations.get_signed_target_files_of_roles(["targets"]) + assert actual == {"test2", "test1"} + actual = tuf_repo_with_delegations.get_signed_target_files_of_roles( + ["targets", "delegated_role"] + ) + assert actual == {"test2", "test1", "dir1/path1", "dir2/path1"} + + +def test_get_signed_target_files(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.get_signed_target_files() + assert actual == {"test2", "test1", "dir2/path2", "dir1/path1", "dir2/path1"} + + +def test_get_signed_targets_with_custom_data(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.get_signed_targets_with_custom_data() + assert actual == { + "test1": {}, + "test2": {}, + "dir1/path1": {"custom_attr1": "custom_val1"}, + "dir2/path1": {"custom_attr2": "custom_val2"}, + "dir2/path2": {}, + } + + +def test_get_target_file_custom_data(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.get_target_file_custom_data("dir1/path1") + assert actual == {"custom_attr1": "custom_val1"} + actual = tuf_repo_with_delegations.get_target_file_custom_data("dir2/path1") + assert actual == {"custom_attr2": "custom_val2"} + + tuf_repo_with_delegations.get_target_file_custom_data("doesntexist") is None + + +def test_get_target_file_hashes(tuf_repo_with_delegations): + hash_value = tuf_repo_with_delegations.get_target_file_hashes( + "dir1/path1", "sha256" + ) + assert len(hash_value) == 64 + hash_value = tuf_repo_with_delegations.get_target_file_hashes( + "dir1/path1", "sha512" + ) + assert len(hash_value) == 128 + + tuf_repo_with_delegations.get_target_file_hashes("doesntexist") is None + + +def test_get_key_length_and_scheme_from_metadata(tuf_repo_with_delegations): + keyid = tuf_repo_with_delegations._role_obj("targets").keyids[0] + actual = tuf_repo_with_delegations.get_key_length_and_scheme_from_metadata( + "root", keyid + ) + key, scheme = actual + assert key is not None + assert scheme == "rsa-pkcs1v15-sha256" + + +def test_generate_roles_description(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.generate_roles_description() + roles_data = actual["roles"] + root_data = roles_data["root"] + assert root_data["threshold"] == 2 + assert root_data["number"] == 3 + assert root_data["scheme"] == "rsa-pkcs1v15-sha256" + assert root_data["length"] == 3072 + targets_data = roles_data["targets"] + assert targets_data["threshold"] == 1 + assert targets_data["number"] == 2 + assert targets_data["scheme"] == "rsa-pkcs1v15-sha256" + assert targets_data["length"] == 3072 + snapshot_data = roles_data["snapshot"] + assert snapshot_data["threshold"] == 1 + assert snapshot_data["number"] == 1 + assert snapshot_data["scheme"] == "rsa-pkcs1v15-sha256" + assert snapshot_data["length"] == 3072 + timestamp_data = roles_data["timestamp"] + assert timestamp_data["threshold"] == 1 + assert timestamp_data["number"] == 1 + assert timestamp_data["scheme"] == "rsa-pkcs1v15-sha256" + assert timestamp_data["length"] == 3072 + assert targets_data["delegations"] + delegated_role_data = targets_data["delegations"]["delegated_role"] + assert delegated_role_data["threshold"] == 2 + assert delegated_role_data["number"] == 2 + assert delegated_role_data["scheme"] == "rsa-pkcs1v15-sha256" + assert delegated_role_data["length"] == 3072 + assert delegated_role_data["delegations"] + inner_role_data = delegated_role_data["delegations"]["inner_role"] + assert inner_role_data["threshold"] == 1 + assert inner_role_data["number"] == 1 + assert inner_role_data["scheme"] == "rsa-pkcs1v15-sha256" + assert inner_role_data["length"] == 3072 + + +def test_sort_roles_targets_for_filenames(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.sort_roles_targets_for_filenames() + assert actual["targets"] == ["test1", "test2"] + assert actual["delegated_role"] == ["dir1/path1", "dir2/path1"] + assert actual["inner_role"] == ["dir2/path2"] + + +def test_is_valid_metadata_key(tuf_repo_with_delegations, public_keys_with_delegations): + for role in ( + "root", + "targets", + "snapshot", + "timestamp", + "delegated_role", + "inner_role", + ): + key = public_keys_with_delegations[role][0] + assert tuf_repo_with_delegations.is_valid_metadata_key(role, key) + assert tuf_repo_with_delegations.is_valid_metadata_key( + role, key.keyval["public"] + ) + + assert not tuf_repo_with_delegations.is_valid_metadata_key( + "root", public_keys_with_delegations["targets"][0] + ) + + with pytest.raises(TAFError): + tuf_repo_with_delegations.is_valid_metadata_key("root", "123456") + + +def test_get_signable_metadata(tuf_repo_with_delegations): + actual = tuf_repo_with_delegations.get_signable_metadata("root") + assert len(actual) == 7 + for key in ( + "_type", + "version", + "spec_version", + "expires", + "consistent_snapshot", + "keys", + "roles", + ): + assert key in actual + + +def test_roles_targets_for_filenames(tuf_repo_with_delegations): + target_filenames = ["dir2/path1", "dir2/path2", "test"] + actual = tuf_repo_with_delegations.roles_targets_for_filenames(target_filenames) + assert actual == { + "delegated_role": ["dir2/path1"], + "inner_role": ["dir2/path2"], + "targets": ["test"], + } diff --git a/taf/tests/utils.py b/taf/tests/utils.py new file mode 100644 index 000000000..1b03cfa01 --- /dev/null +++ b/taf/tests/utils.py @@ -0,0 +1,31 @@ +from typing import Dict +from taf.constants import TARGETS_DIRECTORY_NAME +import json +from pathlib import Path +import shutil + + +def read_json(path): + return json.loads(Path(path).read_text()) + + +def copy_repositories_json( + repositories_json_template: Dict, namespace: str, auth_repo_path: Path +): + output = auth_repo_path / TARGETS_DIRECTORY_NAME + + repositories = { + "repositories": { + repo_name.format(namespace=namespace): repo_data + for repo_name, repo_data in repositories_json_template[ + "repositories" + ].items() + } + } + output.mkdir(parents=True, exist_ok=True) + Path(output / "repositories.json").write_text(json.dumps(repositories)) + + +def copy_mirrors_json(mirrors_json_path: Path, auth_repo_path: Path): + output = auth_repo_path / TARGETS_DIRECTORY_NAME + shutil.copy(str(mirrors_json_path), output) diff --git a/taf/tools/cli/__init__.py b/taf/tools/cli/__init__.py index 231c0bc8e..0b7dca9e4 100644 --- a/taf/tools/cli/__init__.py +++ b/taf/tools/cli/__init__.py @@ -32,23 +32,26 @@ def wrapper(*args, **kwargs): successful = True return result except handle as e: - if print_error: - click.echo(e) + # TODO + # for now + # if print_error: + taf_logger.error(e) except Exception as e: if is_run_from_python_executable(): - click.echo(f"An error occurred: {e}") + taf_logger.error(f"An error occurred: {e}") sys.exit(1) else: raise e finally: if not skip_cleanup and not successful and "path" in kwargs: path = kwargs["path"] - if path: - repo = GitRepository(path=path) - if repo.is_git_repository and not repo.is_bare_repository: - repo.clean_and_reset() - if remove_dir_on_error: - shutil.rmtree(path, onerror=on_rm_error) + repo = GitRepository(path=path) + if repo.is_git_repository and not repo.is_bare_repository: + repo.restore(["metadata"]) + # repo.clean_and_reset() + + if remove_dir_on_error: + shutil.rmtree(path, onerror=on_rm_error) return wrapper diff --git a/taf/tools/roles/__init__.py b/taf/tools/roles/__init__.py index 24de96c11..7d887fddd 100644 --- a/taf/tools/roles/__init__.py +++ b/taf/tools/roles/__init__.py @@ -2,7 +2,16 @@ from pathlib import Path import sys import click -from taf.api.roles import add_multiple_roles, add_role, list_keys_of_role, add_signing_key, remove_role +from taf.api.roles import ( + add_multiple_roles, + add_role, + list_keys_of_role, + add_signing_key, + remove_role, + revoke_signing_key, + remove_paths, + rotate_signing_key, +) from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME from taf.exceptions import TAFError from taf.auth_repo import AuthenticationRepository @@ -217,6 +226,32 @@ def remove(role, path, keystore, scheme, remove_targets, no_commit, prompt_for_k return remove +def remove_paths_command(): + @click.command(help="""Remove paths from delegated role""") + @find_repository + @catch_cli_exception(handle=TAFError) + @click.option("--path", default=".", help="Authentication repository's location. If not specified, set to the current directory") + @click.option("--delegated-path", multiple=True, help="A list of paths to be removed") + @click.option("--keystore", default=None, help="Location of the keystore files") + @click.option("--scheme", default=DEFAULT_RSA_SIGNATURE_SCHEME, help="A signature scheme used for signing") + @click.option("--no-commit", is_flag=True, default=False, help="Indicates that the changes should not be committed automatically") + @click.option("--prompt-for-keys", is_flag=True, default=False, help="Whether to ask the user to enter their key if not located inside the keystore directory") + def remove_delegated_paths(path, delegated_path, keystore, scheme, no_commit, prompt_for_keys): + if not delegated_path: + print("Specify at least one role") + return + + remove_paths( + path=path, + paths=delegated_path, + keystore=keystore, + scheme=scheme, + commit=not no_commit, + prompt_for_keys=prompt_for_keys, + ) + return remove_delegated_paths + + def add_signing_key_command(): @click.command(help=""" Add a new signing key. This will make it possible to a sign metadata files @@ -233,11 +268,10 @@ def add_signing_key_command(): @click.option("--role", multiple=True, help="A list of roles to whose list of signing keys the new key should be added") @click.option("--pub-key-path", default=None, help="Path to the public key corresponding to the private key which should be registered as the role's signing key") @click.option("--keystore", default=None, help="Location of the keystore files") - @click.option("--keys-description", help="A dictionary containing information about the keys or a path to a json file which stores the needed information") @click.option("--scheme", default=DEFAULT_RSA_SIGNATURE_SCHEME, help="A signature scheme used for signing") @click.option("--no-commit", is_flag=True, default=False, help="Indicates that the changes should not be committed automatically") @click.option("--prompt-for-keys", is_flag=True, default=False, help="Whether to ask the user to enter their key if not located inside the keystore directory") - def adding_signing_key(path, role, pub_key_path, keystore, keys_description, scheme, no_commit, prompt_for_keys): + def adding_signing_key(path, role, pub_key_path, keystore, scheme, no_commit, prompt_for_keys): if not role: print("Specify at least one role") return @@ -247,7 +281,6 @@ def adding_signing_key(path, role, pub_key_path, keystore, keys_description, sch roles=role, pub_key_path=pub_key_path, keystore=keystore, - roles_key_infos=keys_description, scheme=scheme, commit=not no_commit, prompt_for_keys=prompt_for_keys @@ -255,6 +288,63 @@ def adding_signing_key(path, role, pub_key_path, keystore, keys_description, sch return adding_signing_key +def revoke_signing_key_command(): + @click.command(help=""" + Revoke a signing key. + """) + @find_repository + @catch_cli_exception(handle=TAFError) + @click.argument("keyid") + @click.option("--path", default=".", help="Authentication repository's location. If not specified, set to the current directory") + @click.option("--role", multiple=True, help="A list of roles from which to remove the key. If unspecified, the key is removed from all roles by default.") + @click.option("--keystore", default=None, help="Location of the keystore files") + @click.option("--scheme", default=DEFAULT_RSA_SIGNATURE_SCHEME, help="A signature scheme used for signing") + @click.option("--no-commit", is_flag=True, default=False, help="Indicates that the changes should not be committed automatically") + @click.option("--prompt-for-keys", is_flag=True, default=False, help="Whether to ask the user to enter their key if not located inside the keystore directory") + def revoke_key(path, role, keyid, keystore, scheme, no_commit, prompt_for_keys): + + revoke_signing_key( + path=path, + roles=role, + key_id=keyid, + keystore=keystore, + scheme=scheme, + commit=not no_commit, + prompt_for_keys=prompt_for_keys + ) + return revoke_key + + +def rotate_signing_key_command(): + @click.command(help=""" + Rotate a signing key. + """) + @find_repository + @catch_cli_exception(handle=TAFError) + @click.argument("keyid") + @click.option("--path", default=".", help="Authentication repository's location. If not specified, set to the current directory") + @click.option("--role", multiple=True, help="A list of roles from which to remove the key. Remove from all by default") + @click.option("--pub-key-path", default=None, help="Path to the public key corresponding to the private key which should be registered as the role's signing key") + @click.option("--keystore", default=None, help="Location of the keystore files") + @click.option("--scheme", default=DEFAULT_RSA_SIGNATURE_SCHEME, help="A signature scheme used for signing") + @click.option("--prompt-for-keys", is_flag=True, default=False, help="Whether to ask the user to enter their key if not located inside the keystore directory") + @click.option("--revoke-commit-msg", default=None, help="Revoke key commit message") + @click.option("--add-commit-msg", default=None, help="Add new signing key commit message") + def rotate_key(path, role, keyid, pub_key_path, keystore, scheme, prompt_for_keys, revoke_commit_msg, add_commit_msg): + rotate_signing_key( + path=path, + roles=role, + key_id=keyid, + keystore=keystore, + scheme=scheme, + prompt_for_keys=prompt_for_keys, + pub_key_path=pub_key_path, + revoke_commit_msg=revoke_commit_msg, + add_commit_msg=add_commit_msg, + ) + return rotate_key + + def list_keys_command(): @click.command(help=""" List all keys of the specified role. If certs directory exists and contains certificates exported from YubiKeys, @@ -278,7 +368,10 @@ def attach_to_group(group): group.add_command(add_role_command(), name='add') group.add_command(add_multiple_command(), name='add-multiple') group.add_command(add_role_paths_command(), name='add-role-paths') + group.add_command(remove_paths_command(), name='remove-paths') # group.add_command(remove_role_command(), name='remove') group.add_command(add_signing_key_command(), name='add-signing-key') + group.add_command(revoke_signing_key_command(), name='revoke-key') + group.add_command(rotate_signing_key_command(), name='rotate-key') group.add_command(list_keys_command(), name='list-keys') group.add_command(export_roles_description_command(), name="export-description") diff --git a/taf/tools/targets/__init__.py b/taf/tools/targets/__init__.py index 61e66ea1e..d27452328 100644 --- a/taf/tools/targets/__init__.py +++ b/taf/tools/targets/__init__.py @@ -24,14 +24,29 @@ def add_repo_command(): ), help="""Add a new repository by adding it to repositories.json, creating a delegation (if targets is not its signing role) and adding and signing initial target files if the repository is found on the filesystem. All additional information that should be saved as the repository's custom content in `repositories.json` - is specified by providing a json file containing this data + is specified by providing a json file containing this data. If a new role should be added, this configuration + file should also contain informatoin about that role. E.g. { "custom-prop1": "custom-val1", - "custom-prop2": "custom-val2" + "custom-prop2": "custom-val2", + "role": { + "parent_role": "targets", + "delegated_path": ["/delegated_path_inside_targets1", "/delegated_path_inside_targets2"], + "keys_number": 1, + "threshold": 1, + "yubikey": true, + "scheme": "rsa-pkcs1v15-sha256" + } } + parent_role = config_data.get("parent_role", "targets") + keys_number = config_data.get("keys_number", 1) + threshold = config_data.get("threshold", 1) + yubikey = config_data.get("yubikey", False) + scheme = config_data.get("scheme", DEFAULT_RSA_SIGNATURE_SCHEME) + if directly inside the authentication repository. In this case, custom-prop1 and custom-prop2 will be added to the custom part of the target repository's entry in @@ -48,32 +63,62 @@ def add_repo_command(): @click.option("--path", default=".", help="Authentication repository's location. If not specified, set to the current directory") @click.argument("target-name") @click.option("--target-path", default=None, help="Target repository's filesystem path") - @click.option("--role", default="targets", help="Signing role of the corresponding target file. Can be a new role, in which case it will be necessary to enter its information when prompted") + @click.option("--role", default="targets", help="Signing role of the corresponding target file. Can be a new role, in which case it will be necessary to provide additional information") + @click.option("--config-file", type=click.Path(exists=True), help="Path to the JSON configuration file containing information about the new role and/or targets custom data.") @click.option("--keystore", default=None, help="Location of the keystore files") @click.option("--prompt-for-keys", is_flag=True, default=False, help="Whether to ask the user to enter their key if not located inside the keystore directory") + @click.option("--scheme", default=DEFAULT_RSA_SIGNATURE_SCHEME, help="A signature scheme used for signing") @click.option("--no-commit", is_flag=True, default=False, help="Indicates that the changes should not be committed automatically") - @click.option("--custom-file", type=click.Path(exists=True), help="Path to the JSON file containing additional, custom targets data.") - def add_repo(path, target_path, target_name, role, keystore, prompt_for_keys, no_commit, custom_file): + def add_repo(path, target_path, target_name, role, config_file, keystore, prompt_for_keys, scheme, no_commit): - custom = {} - if custom_file: + config_data = {} + if config_file: try: - custom = json.loads(Path(custom_file).read_text()) + config_data = json.loads(Path(config_file).read_text()) except json.JSONDecodeError: - taf_logger.error("Invalid custom JSON provided") + click.echo("Invalid JSON provided. Please check your input.", err=True) sys.exit(1) - add_target_repo( - path=path, - target_path=target_path, - target_name=target_name, - library_dir=None, - role=role, - keystore=keystore, - custom=custom, - prompt_for_keys=prompt_for_keys, - commit=not no_commit - ) + if "role" in config_data: + role_data = config_data.pop("role") + delegated_path = role_data.get("delegated_path", [target_name]) + parent_role = role_data.get("parent_role", "targets") + keys_number = role_data.get("keys_number", 1) + threshold = role_data.get("threshold", 1) + yubikey = role_data.get("yubikey", False) + + add_target_repo( + path=path, + target_path=target_path, + target_name=target_name, + library_dir=None, + role=role, + parent_role=parent_role, + paths=delegated_path, + keys_number=keys_number, + threshold=threshold, + yubikey=yubikey, + keystore=keystore, + custom=config_data, + scheme=scheme, + prompt_for_keys=prompt_for_keys, + commit=not no_commit, + should_create_new_role=True, + ) + else: + add_target_repo( + path=path, + target_path=target_path, + target_name=target_name, + library_dir=None, + role=role, + keystore=keystore, + custom=config_data, + scheme=scheme, + prompt_for_keys=prompt_for_keys, + commit=not no_commit, + should_create_new_role=False, + ) return add_repo @@ -159,7 +204,7 @@ def sign(path, keystore, keys_description, scheme, prompt_for_keys, no_commit): keystore=keystore, roles_key_infos=keys_description, scheme=scheme, - write=True, + update_snapshot_and_timestamp=True, prompt_for_keys=prompt_for_keys, commit=not no_commit ) diff --git a/taf/tools/yubikey/__init__.py b/taf/tools/yubikey/__init__.py index 90bc0e0d6..ec720cf79 100644 --- a/taf/tools/yubikey/__init__.py +++ b/taf/tools/yubikey/__init__.py @@ -1,6 +1,12 @@ import click import json -from taf.api.yubikey import export_yk_certificate, export_yk_public_pem, get_yk_roles, setup_signing_yubikey, setup_test_yubikey +from taf.api.yubikey import ( + export_yk_certificate, + export_yk_public_pem, + get_yk_roles, + setup_signing_yubikey, + setup_test_yubikey, +) from taf.exceptions import YubikeyError from taf.repository_utils import find_valid_repository from taf.tools.cli import catch_cli_exception @@ -12,32 +18,42 @@ def check_pin_command(): def check_pin(pin): try: from taf.yubikey import is_valid_pin + valid, retries = is_valid_pin(pin) inserted = True except YubikeyError: valid = False inserted = False retries = None - print(json.dumps({ - "pin": valid, - "retries": retries, - "inserted": inserted - })) + print(json.dumps({"pin": valid, "retries": retries, "inserted": inserted})) + return check_pin def export_pub_key_command(): - @click.command(help="Export the inserted Yubikey's public key and save it to the specified location.") - @click.option("--output", help="File to which the exported public key will be written. The result will be written to the console if path is not specified") + @click.command( + help="Export the inserted Yubikey's public key and save it to the specified location." + ) + @click.option( + "--output", + help="File to which the exported public key will be written. The result will be written to the console if path is not specified", + ) def export_pub_key(output): export_yk_public_pem(output) + return export_pub_key def get_roles_command(): - @click.command(help="Export the inserted Yubikey's public key and save it to the specified location.") + @click.command( + help="Export the inserted Yubikey's public key and save it to the specified location." + ) @catch_cli_exception(handle=YubikeyError, print_error=True) - @click.option("--path", default=".", help="Authentication repository's location. If not specified, set to the current directory") + @click.option( + "--path", + default=".", + help="Authentication repository's location. If not specified, set to the current directory", + ) def get_roles(path): path = find_valid_repository(path) roles_with_paths = get_yk_roles(path) @@ -45,40 +61,56 @@ def get_roles(path): print(f"\n{role}") for path in paths: print(f"\n -{path}") + return get_roles def export_certificate_command(): - @click.command(help="Export the inserted Yubikey's public key and save it to the specified location.") - @click.option("--output", help="File to which the exported certificate key will be written. The result will be written to the user's home directory by default") + @click.command( + help="Export the inserted Yubikey's public key and save it to the specified location." + ) + @click.option( + "--output", + help="File to which the exported certificate key will be written. The result will be written to the user's home directory by default", + ) def export_certificate(output): export_yk_certificate(output) + return export_certificate def setup_signing_key_command(): - @click.command(help="""Generate a new key on the yubikey and set the pin. Export the generated certificate + @click.command( + help="""Generate a new key on the yubikey and set the pin. Export the generated certificate to the specified directory. - WARNING - this will delete everything from the inserted key.""") - @click.option("--certs-dir", help="Path of the directory where the exported certificate will be saved. Set to the user home directory by default") + WARNING - this will delete everything from the inserted key.""" + ) + @click.option( + "--certs-dir", + help="Path of the directory where the exported certificate will be saved. Set to the user home directory by default", + ) def setup_signing_key(certs_dir): - setup_signing_yubikey(certs_dir,key_size=2048) + setup_signing_yubikey(certs_dir, key_size=2048) + return setup_signing_key def setup_test_key_command(): - @click.command(help="""Copies the specified key onto the inserted YubiKey - WARNING - this will reset the inserted key.""") + @click.command( + help="""Copies the specified key onto the inserted YubiKey + WARNING - this will reset the inserted key.""" + ) @click.argument("key-path") def setup_test_key(key_path): - setup_test_yubikey(key_path,key_size=2048) + setup_test_yubikey(key_path) + return setup_test_key def attach_to_group(group): - group.add_command(check_pin_command(), name='check-pin') - group.add_command(export_pub_key_command(), name='export-pub-key') - group.add_command(get_roles_command(), name='get-roles') - group.add_command(export_certificate_command(), name='export-certificate') - group.add_command(setup_signing_key_command(), name='setup-signing-key') - group.add_command(setup_test_key_command(), name='setup-test-key') + group.add_command(check_pin_command(), name="check-pin") + group.add_command(export_pub_key_command(), name="export-pub-key") + group.add_command(get_roles_command(), name="get-roles") + group.add_command(export_certificate_command(), name="export-certificate") + group.add_command(setup_signing_key_command(), name="setup-signing-key") + group.add_command(setup_test_key_command(), name="setup-test-key") diff --git a/taf/tools/yubikey/yubikey_utils.py b/taf/tools/yubikey/yubikey_utils.py index 87bd79b9f..ffbf6cbdc 100644 --- a/taf/tools/yubikey/yubikey_utils.py +++ b/taf/tools/yubikey/yubikey_utils.py @@ -5,8 +5,7 @@ from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes, serialization -from securesystemslib.rsa_keys import create_rsa_signature -from tuf.repository_tool import import_rsakey_from_pem +from taf.tuf.keys import load_signer_from_file VALID_PIN = "123456" WRONG_PIN = "111111" @@ -30,7 +29,7 @@ def __init__(self, priv_key_path, pub_key_path, scheme, serial=None, pin=VALID_P self.pub_key_pem, default_backend() ) - self.tuf_key = import_rsakey_from_pem(self.pub_key_pem.decode("utf-8"), scheme) + self.tuf_key = load_signer_from_file(priv_key_path) @property def driver(self): @@ -112,10 +111,8 @@ def sign(self, slot, key_type, data, hash, padding): if isinstance(data, str): data = data.encode("utf-8") - sig, _ = create_rsa_signature( - self._driver.priv_key_pem.decode("utf-8"), data, self._driver.scheme - ) - return sig + signature = self._driver.priv_key.sign(data, padding, hash) + return signature def verify_pin(self, pin): if self._driver.pin != pin: diff --git a/taf/tuf/keys.py b/taf/tuf/keys.py new file mode 100644 index 000000000..624201e96 --- /dev/null +++ b/taf/tuf/keys.py @@ -0,0 +1,254 @@ +"""TUF metadata key functions. + +""" + + +from typing import Optional, Tuple, Union + +from pathlib import Path +from securesystemslib.signer import ( + SSlibKey, + CryptoSigner, + Signer, + SecretsHandler, + Signature, +) +from securesystemslib.formats import encode_canonical +from securesystemslib.hash import digest +from cryptography.hazmat.primitives.serialization import ( + load_pem_private_key, + load_pem_public_key, +) +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicKey +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.primitives.asymmetric import rsa + +from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME + + +def generate_rsa_keypair(key_size=3072, password=None) -> Tuple[bytes, bytes]: + """ + Generate a private-public key pair. Returns the generated keys as bytes in PEM format.. + """ + private_key = rsa.generate_private_key( + public_exponent=65537, key_size=key_size, backend=default_backend() + ) + + # Encrypt the private key if a password is provided + if password: + encryption_algorithm = serialization.BestAvailableEncryption(password.encode()) + else: + encryption_algorithm = serialization.NoEncryption() + + # Serialize private key + private_pem = private_key.private_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PrivateFormat.TraditionalOpenSSL, + encryption_algorithm=encryption_algorithm, + ) + + # Get the public key from the private key + public_key = private_key.public_key() + # Serialize public key + public_pem = public_key.public_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PublicFormat.SubjectPublicKeyInfo, + ) + + return private_pem, public_pem + + +def generate_and_write_rsa_keypair(path, key_size, password) -> bytes: + """ + Generate a private-public key pair and write and save it to files. + Returns the private key in PEM format. + """ + if not password: + password = None + private_pem, public_pem = generate_rsa_keypair(key_size, password) + + with open(path, "wb") as f: + f.write(private_pem) + + with open(f"{path}.pub", "wb") as f: + f.write(public_pem) + + return private_pem + + +def get_sslib_key_from_value( + key: str, scheme: str = DEFAULT_RSA_SIGNATURE_SCHEME +) -> SSlibKey: + """ + Converts a key from its string representation into an SSlibKey object. + """ + key_val = key.encode() + crypto_key = load_pem_public_key(key_val, backend=default_backend()) + return _from_crypto(crypto_key, scheme=scheme) + + +def _get_legacy_keyid(key: SSlibKey) -> str: + """Computes legacy keyid as hash over an opinionated canonical + representation of the public key.""" + data = encode_canonical( + { + "keytype": key.keytype, + "scheme": key.scheme, + "keyval": {"public": key.keyval["public"].strip()}, + "keyid_hash_algorithms": ["sha256", "sha512"], + } + ).encode("utf-8") + hasher = digest("sha256") + hasher.update(data) + return hasher.hexdigest() + + +def _from_crypto(pub: RSAPublicKey, scheme=DEFAULT_RSA_SIGNATURE_SCHEME) -> SSlibKey: + """Converts pyca/cryptography public key to SSlibKey with default signing + scheme and legacy keyid.""" + # securesystemslib does not (yet) check if keytype and scheme are compatible + # https://github.com/secure-systems-lab/securesystemslib/issues/766 + if not isinstance(pub, RSAPublicKey): + raise ValueError(f"keytype '{type(pub)}' not supported") + key = SSlibKey.from_crypto(pub, scheme=scheme) + key.keyid = _get_legacy_keyid(key) + return key + + +def load_public_key_from_file( + path: Union[str, Path], scheme=DEFAULT_RSA_SIGNATURE_SCHEME +) -> SSlibKey: + """Load SSlibKey from RSA public key file. + + * Expected key file format is SubjectPublicKeyInfo/PEM + * Signing scheme defaults to 'rsa-pkcs1v15-sha256' + * Keyid is computed from legacy canonical representation of public key + + """ + # TODO handle scheme + with open(path, "rb") as f: + pem = f.read() + + pub = load_pem_public_key(pem) + return _from_crypto(pub) + + +def load_signer_from_file( + path: Path, password: Optional[str] = None, scheme=DEFAULT_RSA_SIGNATURE_SCHEME +) -> CryptoSigner: + """Load CryptoSigner from RSA private key file. + + * Expected key file format is PKCS8/PEM + * Signing scheme defaults to 'rsa-pkcs1v15-sha256' + * Keyid is computed from legacy canonical representation of public key + * If password is None, the key is expected to be unencrypted + + """ + with open(path, "rb") as f: + pem = f.read() + + # TODO scheme + + password_encoded = password.encode() if password is not None else None + priv = load_pem_private_key(pem, password_encoded) + pub = priv.public_key() + return CryptoSigner(priv, _from_crypto(pub)) + + +def load_signer_from_pem(pem: bytes, password: Optional[bytes] = None) -> CryptoSigner: + """Load CryptoSigner from RSA private key file. + + * Expected key file format is PKCS8/PEM + * Signing scheme defaults to 'rsa-pkcs1v15-sha256' + * Keyid is computed from legacy canonical representation of public key + * If password is None, the key is expected to be unencrypted + + """ + priv = load_pem_private_key(pem, password) + pub = priv.public_key() + return CryptoSigner(priv, _from_crypto(pub)) + + +class YkSigner(Signer): + """Signer implementation for Yubikeys. + + Provides a minimal compatibility layer over `taf.yubikey` module functions + for use with MetadataRepository. + + Attrs: + public_key: An SSlibkey, whose keyid and signing scheme are the single + of truth for creating signatures. + pin_handler: A function, which is called in `sign` and expected to + return the Yubikey pin. + """ + + _SECRET_PROMPT = "pin" + + def __init__(self, public_key: SSlibKey, pin_handler: SecretsHandler): + + self._public_key = public_key + self._pin_handler = pin_handler + + @property + def public_key(self) -> SSlibKey: + return self._public_key + + @classmethod + def import_(cls) -> SSlibKey: + """Import rsa public key from Yubikey. + + * Assigns default signing scheme: "rsa-pkcs1v15-sha256" + * Raises ValueError, if key on Yubikey is not an rsa key. + + TODO: Consider returning priv key uri along with public key. + See e.g. `self.from_priv_key_uri` and other `import_` methods on + securesystemslib signers, e.g. `HSMSigner.import_`. + """ + # TODO: export pyca/cryptography key to avoid duplicate deserialization + from taf.yubikey import export_piv_pub_key + + pem = export_piv_pub_key() + pub = load_pem_public_key(pem) + return _from_crypto(pub) + + def sign(self, payload: bytes) -> Signature: + pin = self._pin_handler(self._SECRET_PROMPT) + # TODO: openlawlibrary/taf#515 + # sig = sign_piv_rsa_pkcs1v15(payload, pin, self.public_key.keyval["public"]) + from taf.yubikey import sign_piv_rsa_pkcs1v15 + + sig = sign_piv_rsa_pkcs1v15(payload, pin) + return Signature(self.public_key.keyid, sig.hex()) + + @classmethod + def from_priv_key_uri( + cls, + priv_key_uri: str, + public_key: SSlibKey, + secrets_handler: Optional[SecretsHandler] = None, + ) -> "Signer": + # TODO: Implement this to better separate public key management + # (e.g. tuf delegation) and signer configuration from signing. See + # https://python-securesystemslib.readthedocs.io/en/latest/signer.html + raise NotImplementedError + + +def root_signature_provider(signature_dict, key_id, _key, _data): + """Root signature provider used to return signatures created remotely. + + Args: + - signature_dict(dict): Dict where key is key_id and value is signature + - key_id(str): Key id from targets metadata file + - _key(securesystemslib.formats.RSAKEY_SCHEMA): Key info + - _data(dict): Data to sign (already signed remotely) + + Returns: + Dictionary that comforms to `securesystemslib.formats.SIGNATURE_SCHEMA` + + Raises: + - KeyError: If signature for key_id is not present in signature_dict + """ + from binascii import hexlify + + return {"keyid": key_id, "sig": hexlify(signature_dict.get(key_id)).decode()} diff --git a/taf/tuf/repository.py b/taf/tuf/repository.py new file mode 100644 index 000000000..e8de21535 --- /dev/null +++ b/taf/tuf/repository.py @@ -0,0 +1,1668 @@ +"""TUF metadata repository""" + + +from fnmatch import fnmatch +from functools import reduce +import json +import operator +import os +from pathlib import Path +import logging +from collections import defaultdict +from datetime import datetime, timedelta, timezone +import shutil +from typing import Dict, List, Optional, Set, Tuple, Union +from securesystemslib.exceptions import StorageError +from cryptography.hazmat.primitives import serialization + +from securesystemslib.signer import Signer +from securesystemslib import hash as sslib_hash + +from taf import YubikeyMissingLibrary + +from securesystemslib.storage import FilesystemBackend + +from tuf.api.metadata import Signed + +try: + import taf.yubikey as yk +except ImportError: + yk = YubikeyMissingLibrary() # type: ignore + +from taf.constants import DEFAULT_RSA_SIGNATURE_SCHEME +from taf.utils import ( + default_backend, + get_file_details, + on_rm_error, + normalize_file_line_endings, +) +from tuf.api.metadata import ( + Metadata, + MetaFile, + Role, + Root, + Snapshot, + Targets, + TargetFile, + Timestamp, + DelegatedRole, + Delegations, +) +from tuf.api.serialization.json import JSONSerializer +from taf.exceptions import InvalidKeyError, SignersNotLoaded, TAFError, TargetsError +from taf.models.types import RolesIterator, RolesKeysData, TargetsRole +from taf.tuf.keys import SSlibKey, _get_legacy_keyid, get_sslib_key_from_value +from tuf.repository import Repository + +from securesystemslib.signer import CryptoSigner + + +logger = logging.getLogger(__name__) + +# TODO remove this, use from constants or remove from constants +METADATA_DIRECTORY_NAME = "metadata" +TARGETS_DIRECTORY_NAME = "targets" + +MAIN_ROLES = ["root", "targets", "snapshot", "timestamp"] + +DISABLE_KEYS_CACHING = False +HASH_FUNCTION = "sha256" +HASH_ALGS = ["sha256", "sha512"] + + +def get_role_metadata_path(role: str) -> str: + """ + Arguments: + role: Name of a TUF role, main or delegated + + Return: + Path of the metadata file corresponding to the specified role, + relative to the repository's root + """ + return f"{METADATA_DIRECTORY_NAME}/{role}.json" + + +def get_target_path(target_name: str) -> str: + """ + Arguments: + target_name: Name of the target file expected to be inside the targets directory + + Return: + Path of the specified target file relative to the repository's root + """ + return f"{TARGETS_DIRECTORY_NAME}/{target_name}" + + +def is_delegated_role(role: str) -> bool: + return role not in ("root", "targets", "snapshot", "timestamp") + + +def is_auth_repo(repo_path: str) -> bool: + """Check if the given path contains a valid TUF repository""" + try: + Repository(repo_path)._repository + return True + except Exception: + return False + + +class MetadataRepository(Repository): + """TUF metadata repository implementation for on-disk top-level roles. + + Provides methods to read and edit metadata, handling version and expiry + bumps, and signature creation, and facilitating snapshot and timestamp + creation. + + Arguments: + path: Base path of metadata repository. + + Attributes: + signer_cache: All signers available to the repository. Keys are role + names, values are lists of signers. On `close` each signer for a + role is used to sign the related role metadata. + metadata_to_keep_open: A set containing metadata whose version numbers should not + be increased when saving to disk. This makes it possible to combine multiple updates + """ + + expiration_intervals = {"root": 365, "targets": 90, "snapshot": 7, "timestamp": 1} + + serializer = JSONSerializer(compact=False) + + def __init__(self, path: Union[Path, str], *args, **kwargs) -> None: + storage_backend = kwargs.pop("storage", None) + super().__init__(*args, **kwargs) + self.signer_cache: Dict[str, Dict[str, Signer]] = defaultdict(dict) + self.path = Path(path) + + self._snapshot_info = MetaFile(1) + self._targets_infos: Dict[str, MetaFile] = defaultdict(lambda: MetaFile(1)) + if storage_backend: + self.storage_backend = storage_backend + else: + self.storage_backend = FilesystemBackend() + self._metadata_to_keep_open: Set[str] = set() + + @property + def metadata_path(self) -> Path: + """ + Full path of the metadata directory. + """ + return self.path / METADATA_DIRECTORY_NAME + + @property + def targets_path(self): + """ + Full path of the targets directory. + """ + return self.path / TARGETS_DIRECTORY_NAME + + @property + def targets_infos(self) -> Dict[str, MetaFile]: + """ + Tracks targets and root metadata changes, needed in `do_snapshot` + """ + return self._targets_infos + + @property + def snapshot_info(self) -> MetaFile: + """ + Tracks snapshot metadata changes, needed in `do_timestamp` + """ + return self._snapshot_info + + def calculate_hashes(self, md: Metadata, algorithms: List[str]) -> Dict: + """ + Calculate hashes of the specified signed metadata after serializing + it using the previously initialized serializer. + Hashes are computed for each specified algorithm. + + Arguments: + md: Signed metadata + algorithms: A list of hash algorithms (e.g., 'sha256', 'sha512'). + Return: + A dcitionary mapping algorithms and calculated hashes + """ + hashes = {} + data = md.to_bytes(serializer=self.serializer) + for algo in algorithms: + digest_object = sslib_hash.digest(algo) + digest_object.update(data) + + hashes[algo] = digest_object.hexdigest() + return hashes + + def calculate_length(self, md: Metadata) -> int: + """ + Calculate length of the specified signed metadata after serializing + it using the previously initialized serializer. + + Arguments: + md: Signed metadata + Return: + Langth of the signed metadata + """ + data = md.to_bytes(serializer=self.serializer) + return len(data) + + def add_signers_to_cache(self, roles_signers: Dict): + for role, signers in roles_signers.items(): + if self._role_obj(role): + self._load_role_signers(role, signers) + + def all_target_files(self) -> Set: + """ + Return a set of relative paths of all files inside the targets + directory + """ + targets = [] + # Assume self.targets_path is a Path object, or convert it if necessary + base_path = Path(self.targets_path) + + for filepath in base_path.rglob("*"): + if filepath.is_file(): + # Get the relative path to the base directory and convert it to a POSIX path + relative_path = filepath.relative_to(base_path).as_posix() + targets.append(relative_path) + + return set(targets) + + def add_metadata_keys(self, roles_keys: Dict[str, List]) -> Tuple[Dict, Dict, Dict]: + """Add signer public keys for role to root and update signer cache without updating snapshot and timestamp. + + Return: + added_keys, already_added_keys, invalid_keys + """ + already_added_keys = defaultdict(list) + invalid_keys = defaultdict(list) + added_keys = defaultdict(list) + + def _filter_if_can_be_added(roles): + keys_to_be_added = defaultdict(list) + for role, keys in roles_keys.items(): + if role in roles: + for key in keys: + try: + if self.is_valid_metadata_key(role, key): + already_added_keys[role].append(key) + continue + except TAFError: + invalid_keys[role].append(key) + continue + keys_to_be_added[role].append(key) + return keys_to_be_added + + parents = self.find_parents_of_roles(list(roles_keys.keys())) + self.verify_signers_loaded(parents) + + # when a key is added to one of the main roles + # root is modified + keys_to_be_added_to_root = _filter_if_can_be_added(MAIN_ROLES) + if keys_to_be_added_to_root: + with self.edit_root() as root: + for role, keys in keys_to_be_added_to_root.items(): + for key in keys: + root.add_key(key, role) + added_keys[role].append(key) + + other_roles = [role for role in roles_keys if role not in MAIN_ROLES] + keys_to_be_added_to_targets = _filter_if_can_be_added(other_roles) + + roles_by_parents = defaultdict(list) + if keys_to_be_added_to_targets: + # group other roles by parents + for role, keys in keys_to_be_added_to_targets.items(): + parent = self.find_delegated_roles_parent(role) + roles_by_parents[parent].append(role) + + for parent, roles in roles_by_parents.items(): + with self.edit(parent) as parent_role: + for role in roles: + keys = roles_keys[role] + for key in keys: + parent_role.add_key(key, role) + added_keys[role].append(key) + + return added_keys, already_added_keys, invalid_keys + + def add_target_files_to_role(self, added_data: Dict[str, Dict]) -> None: + """Add target files to top-level targets metadata. + + Arguments: + added_data(dict): Dictionary of new data whose keys are target paths of repositories + (as specified in targets.json, relative to the targets dictionary). + The values are of form: + { + target: content of the target file + custom: { + custom_field1: custom_value1, + custom_field2: custom_value2 + } + } + """ + self.modify_targets(added_data=added_data) + + def add_path_to_delegated_role(self, role: str, paths: List[str]) -> bool: + """ + Add delegated paths to delegated role and return True if successful + + Arguments: + role: Name of a delegated target role + path: A list of paths to be appended to a list of the role's delegated pats + """ + if not self.check_if_role_exists(role): + raise TAFError(f"Role {role} does not exist") + + parent_role = self.find_delegated_roles_parent(role) + if parent_role is None: + return False + if all( + path in self.get_delegations_of_role(parent_role)[role].paths + for path in paths + ): + return False + if parent_role: + self.verify_signers_loaded([parent_role]) + with self.edit(parent_role) as parent: + parent.delegations.roles[role].paths.extend(paths) + return True + return False + + def add_new_roles_to_snapshot(self, roles: List[str]) -> None: + """ + Add versions of newly created target roles to the snapshot. + Also update the versions of their parent roles, which are modified + when a new delegated role is added. + """ + with self.edit(Snapshot.type) as sn: + parents_of_roles = set() + for role in roles: + sn.meta[f"{role}.json"] = MetaFile(1) + parent_role = self.find_delegated_roles_parent(role) + parents_of_roles.add(parent_role) + for parent_role in parents_of_roles: + sn.meta[f"{parent_role}.json"].version = ( + sn.meta[f"{parent_role}.json"].version + 1 + ) + + def add_to_open_metadata(self, roles: List[str]) -> None: + """ + In order to execute several methods before updating the metadata on disk, + some metadata might need to be kept open, which is done by adding them to + _metadata_to_keep_open list. + This method adds all roles from the provided list to _metadata_to_keep_open. + """ + self._metadata_to_keep_open.update(roles) + + def open(self, role: str) -> Metadata: + """Read role metadata from disk.""" + try: + path = self.metadata_path / f"{role}.json" + return Metadata.from_file(path, storage_backend=self.storage_backend) + except StorageError: + raise TAFError(f"Metadata file {path} does not exist") + + def check_if_keys_loaded(self, role_name: str) -> bool: + """ + Check if at least a threshold of signers of the specified role + has been added to the signer cache. + """ + threshold = self.get_role_threshold(role_name) + return ( + role_name in self.signer_cache + and len(self.signer_cache[role_name]) >= threshold + ) + + def check_if_role_exists(self, role_name: str) -> bool: + """ + Given a name of a main or delegated target role, return True if it exist + """ + role = self._role_obj(role_name) + return role is not None + + def check_roles_expiration_dates( + self, + interval: Optional[int] = None, + start_date: Optional[datetime] = None, + excluded_roles: Optional[List[str]] = None, + ) -> Tuple[Dict, Dict]: + """Determines which metadata roles have expired, or will expire within a time frame. + Args: + - interval(int): Number of days to look ahead for expiration. + - start_date(datetime): Start date to look for expiration. + - excluded_roles(list): List of roles to exclude from the search. + + Returns: + - A dictionary of roles that have expired, or will expire within the given time frame. + Results are sorted by expiration date. + """ + if start_date is None: + start_date = datetime.now(timezone.utc) + if interval is None: + interval = 30 + expiration_threshold = start_date + timedelta(days=interval) + + if excluded_roles is None: + excluded_roles = [] + + target_roles = self.get_all_targets_roles() + main_roles = ["root", "targets", "snapshot", "timestamp"] + existing_roles = list(set(target_roles + main_roles) - set(excluded_roles)) + + expired_dict = {} + will_expire_dict = {} + for role in existing_roles: + expiry_date = self.get_expiration_date(role) + if start_date > expiry_date: + expired_dict[role] = expiry_date + elif expiration_threshold >= expiry_date: + will_expire_dict[role] = expiry_date + # sort by expiry date + expired_dict = { + k: v for k, v in sorted(expired_dict.items(), key=lambda item: item[1]) + } + will_expire_dict = { + k: v for k, v in sorted(will_expire_dict.items(), key=lambda item: item[1]) + } + + return expired_dict, will_expire_dict + + def _create_target_file(self, target_path: Path, target_data: Dict) -> None: + """ + Writes the specified data to a target file and stores it on disk. + Target data is of the following form: + { + target: content of the target file, string or Dict (json) + custom: { + custom_field1: custom_value1, + custom_field2: custom_value2 + } + } + """ + # if the target's parent directory should not be "targets", create + # its parent directories if they do not exist + target_dir = target_path.parent + target_dir.mkdir(parents=True, exist_ok=True) + + # create the target file + content = target_data.get("target", None) + if content is None: + if not target_path.is_file(): + target_path.touch() + else: + with open(str(target_path), "w") as f: + if isinstance(content, dict): + json.dump(content, f, indent=4) + else: + f.write(content) + + def clear_open_metadata(self) -> None: + """ + Removes everything from the _metadata_to_keep_open list + """ + self._metadata_to_keep_open = set() + + def close(self, role: str, md: Metadata) -> None: + """Bump version and expiry, re-sign, and write role metadata to disk.""" + + # expiration date is updated before close is called + if role not in self._metadata_to_keep_open: + md.signed.version += 1 + + md.signatures.clear() + for signer in self.signer_cache[role].values(): + md.sign(signer, append=True) + + fname = f"{role}.json" + + # Track snapshot, targets and root metadata changes, needed in + # `do_snapshot` and `do_timestamp` + if role == "snapshot": + self._snapshot_info.version = md.signed.version + self._snapshot_info.hashes = self.calculate_hashes(md, HASH_ALGS) + self._snapshot_info.length = self.calculate_length(md) + root_version = self.signed_obj("root").version + md.signed.meta["root.json"].version = root_version + + elif role != "timestamp": # role in [root, targets, ] + self._targets_infos[fname].version = md.signed.version + + # Write role metadata to disk (root gets a version-prefixed copy) + md.to_file( + self.metadata_path / fname, + serializer=self.serializer, + storage_backend=self.storage_backend, + ) + + if role == "root": + md.to_file( + self.metadata_path / f"{md.signed.version}.{fname}", + serializer=self.serializer, + ) + + def create( + self, + roles_keys_data: RolesKeysData, + signers: dict, + additional_verification_keys: Optional[dict] = None, + ) -> None: + """Create a new metadata repository on disk. + + 1. Create metadata subdir (fail, if exists) + 2. Create initial versions of top-level metadata + 3. Perform top-level delegation using keys from passed signers. + + Arguments: + roles_keys_data: an object containing information about roles, their threshold, delegations etc. + signers: A dictionary, where dict-keys are role names and values + are dictionaries, where-dict keys are keyids and values + are signers. + additional_verification_keys: A dictionary where keys are names of roles and values are lists + of public keys that should be registered as the corresponding role's keys, but the private + keys are not available. E.g. keys exporeted from YubiKeys of maintainers who are not + present at the time of the repository's creation + """ + # TODO add verification keys + # support yubikeys + self.metadata_path.mkdir(parents=True) + self.signer_cache = defaultdict(dict) + + root = Root(consistent_snapshot=False) + + # Snapshot tracks targets and root versions. targets v1 is included by + # default in snapshot v1. root must be added explicitly. + sn = Snapshot() + sn.meta["root.json"] = MetaFile(1) + + public_keys = { + role_name: { + _get_legacy_keyid(signer.public_key): signer.public_key + for signer in role_signers + } + for role_name, role_signers in signers.items() + } + if additional_verification_keys: + for role_name, roles_public_keys in additional_verification_keys.items(): + for public_key in roles_public_keys: + key_id = _get_legacy_keyid(public_key) + if key_id not in public_keys[role_name]: + public_keys[role_name][key_id] = public_key + + for role in RolesIterator(roles_keys_data.roles, include_delegations=False): + if signers.get(role.name) is None: + raise TAFError(f"Cannot setup role {role.name}. Keys not specified") + for signer in signers[role.name]: + key_id = _get_legacy_keyid(signer.public_key) + self.signer_cache[role.name][key_id] = signer + for public_key in public_keys[role.name].values(): + root.add_key(public_key, role.name) + root.roles[role.name].threshold = role.threshold + + targets = Targets() + target_roles = {"targets": targets} + delegations_per_parent: Dict[str, Dict] = defaultdict(dict) + for role in RolesIterator(roles_keys_data.roles.targets): + if role.parent is None: + continue + parent = role.parent.name + parent_obj = target_roles.get(parent) + for signer in signers[role.name]: + self.signer_cache[role.name][key_id] = signer + delegated_role = DelegatedRole( + name=role.name, + threshold=role.threshold, + paths=role.paths, + terminating=role.terminating, + keyids=list(public_keys[role.name].keys()), + ) + delegated_metadata = Targets() + target_roles[role.name] = delegated_metadata + delegations_per_parent[parent][role.name] = delegated_role + sn.meta[f"{role.name}.json"] = MetaFile(1) + + for parent, role_data in delegations_per_parent.items(): + parent_obj = target_roles[parent] + delegated_keys = {} + for delegated_role_name in role_data: + delegated_keys.update(public_keys[delegated_role_name]) + delegations = Delegations(roles=role_data, keys=delegated_keys) + parent_obj.delegations = delegations + + for signed in [root, Timestamp(), sn, targets]: + # Setting the version to 0 here is a trick, so that `close` can + # always bump by the version 1, even for the first time + self._set_default_expiration_date(signed) + signed.version = 0 # `close` will bump to initial valid verison 1 + self.close(signed.type, Metadata(signed)) + + for name, signed in target_roles.items(): + if name != "targets": + self._set_default_expiration_date(signed) + signed.version = 0 # `close` will bump to initial valid verison 1 + self.close(name, Metadata(signed)) + + def create_delegated_roles( + self, roles_data: List[TargetsRole], signers: Dict[str, List[CryptoSigner]] + ) -> Tuple[List, List]: + """ + Create a new delegated roles, signes them using the provided signers and + updates their paren roles. + + Arguments: + roles_data (list): A list containing data about new roles. Each entry specifies + a role's name, path, threshold, and number of signing keys. + signers (dict): A dictionary that maps each new role to a list of its signers + + Return: + A list ofroles that were added and a list of roles that already existed + """ + existing_roles = self.get_all_targets_roles() + existing_roles.extend(MAIN_ROLES) + existing_roles = [] + added_roles = [] + roles_parents_dict = defaultdict(list) + for role_data in roles_data: + if role_data.name in existing_roles: + existing_roles.append(role_data.name) + continue + if role_data.parent is not None: + parent = role_data.parent.name + roles_parents_dict[parent].append(role_data) + + for parent, parents_roles_data in roles_parents_dict.items(): + with self.edit(parent) as parent_obj: + keys_data = {} + for role_data in parents_roles_data: + for signer in signers[role_data.name]: + public_key = signer.public_key + key_id = _get_legacy_keyid(public_key) + keys_data[key_id] = public_key + self.signer_cache[role_data.name][key_id] = signer + delegated_role = DelegatedRole( + name=role_data.name, + threshold=role_data.threshold, + paths=role_data.paths, + terminating=role_data.terminating, + keyids=list(keys_data.keys()), + ) + if parent_obj.delegations is None: + parent_obj.delegations = Delegations( + roles={role_data.name: delegated_role}, keys=keys_data + ) + else: + parent_obj.delegations.roles[role_data.name] = delegated_role + parent_obj.delegations.keys.update(keys_data) + + for role_data in parents_roles_data: + new_role_signed = Targets() + self._set_default_expiration_date(new_role_signed) + new_role_signed.version = ( + 0 # `close` will bump to initial valid verison 1 + ) + self.close(role_data.name, Metadata(new_role_signed)) + added_roles.append(role_data.name) + return added_roles, existing_roles + + def create_and_remove_target_files( + self, added_data: Optional[Dict] = None, removed_data: Optional[Dict] = None + ) -> Tuple: + """Create/updates/removes files in the targets directory + Args: + - added_data(dict): Dictionary of new data whose keys are target paths of repositories + (as specified in targets.json, relative to the targets dictionary). + The values are of form: + { + target: content of the target file + } + - removed_data(dict): Dictionary of the old data whose keys are target paths of + repositories + (as specified in targets.json, relative to the targets dictionary). + The values are not needed. This is just for consistency. + + Content of the target file can be a dictionary, in which case a json file will be created. + If that is not the case, an ordinary textual file will be created. + If content is not specified and the file already exists, it will not be modified. + If it does not exist, an empty file will be created. To replace an existing file with an + empty file, specify empty content (target: '') + + Returns: + - Role whose targets were updates + """ + added_data = {} if added_data is None else added_data + removed_data = {} if removed_data is None else removed_data + data = dict(added_data, **removed_data) + if not data: + raise TargetsError("Nothing to be modified!") + + added_paths = [] + for path, target_data in added_data.items(): + target_path = (self.targets_path / path).absolute() + self._create_target_file(target_path, target_data) + added_paths.append(target_path) + + # remove existing target files + removed_paths = [] + for path in removed_data.keys(): + target_path = (self.targets_path / path).absolute() + if target_path.exists(): + if target_path.is_file(): + target_path.unlink() + elif target_path.is_dir(): + shutil.rmtree(target_path, onerror=on_rm_error) + removed_paths.append(str(path)) + + return added_paths, removed_paths + + def _create_target_object( + self, filesystem_path: str, target_path: str, custom: Optional[Dict] + ) -> TargetFile: + """ + Creates a TUF target object, later used to update targets metadata. + It's first necessary to normalize file line endings (convert all line endings to unix style endings) + before adding a target objects due to hashes getting calculated differently when using CRLF vs LF line endings. + So we instead convert all to unix style endings. + """ + normalize_file_line_endings(filesystem_path) + data = Path(filesystem_path).read_text().encode() + target_file = TargetFile.from_data( + target_file_path=target_path, + data=data, + hash_algorithms=["sha256", "sha512"], + ) + if custom: + unrecognized_fields = {"custom": custom} + target_file.unrecognized_fields = unrecognized_fields + return target_file + + def delete_unregistered_target_files(self, targets_role="targets"): + """ + Delete all target files not specified in targets.json + """ + target_files_by_roles = self.sort_roles_targets_for_filenames() + if targets_role in target_files_by_roles: + for file_rel_path in target_files_by_roles[targets_role]: + if file_rel_path not in self.get_targets_of_role(targets_role): + (self.targets_path / file_rel_path).unlink() + + def do_timestamp(self, force=False): + self._snapshot_info.version = self._signed_obj(Snapshot.type).version + return super().do_timestamp(force) + + def find_delegated_roles_parent(self, delegated_role: str) -> Optional[str]: + """ + Find parent role of the specified delegated targets role + """ + parents = ["targets"] + + while parents: + parent = parents.pop() + for delegation in self.get_delegations_of_role(parent): + if delegation == delegated_role: + return parent + parents.append(delegation) + return None + + def find_parents_of_roles(self, roles: List[str]): + """ + Find parents of all roles contained by the specified list of roles. + """ + parents = set() + for role in roles: + if role in MAIN_ROLES: + parents.add("root") + else: + parent = self.find_delegated_roles_parent(role) + if parent is None: + raise TAFError(f"Could not determine parent of role {role}") + parents.add(parent) + return parents + + def get_delegations_of_role(self, role_name: str) -> Dict: + """ + Return a dictionary of delegated roles of the specified target role + """ + signed_obj = self.signed_obj(role_name) + if signed_obj.delegations: + return signed_obj.delegations.roles + return {} + + def get_keyids_of_role(self, role_name: str) -> List: + """ + Return all key ids of the specified role + """ + role_obj = self._role_obj(role_name) + return role_obj.keyids + + def get_paths_of_role(self, role_name: str) -> List: + """ + Return all delegated paths of the specified target role + """ + parent = self.find_delegated_roles_parent(role_name) + if parent: + parent_obj = self.signed_obj(parent) + return parent_obj.delegations.roles[role_name].paths + return [] + + def get_targets_of_role(self, role_name: str): + """ + Return all targets of the specified target role + """ + return self.signed_obj(role_name).targets + + def find_keys_roles( + self, public_keys: List, check_threshold: Optional[bool] = True + ) -> List: + """Find all roles that can be signed by the provided keys. + A role can be signed by the list of keys if at least the number + of keys that can sign that file is equal to or greater than the role's + threshold + """ + key_ids = [_get_legacy_keyid(public_key) for public_key in public_keys] + return self.find_keysid_roles(key_ids=key_ids, check_threshold=check_threshold) + + def find_keysid_roles( + self, key_ids: List, check_threshold: Optional[bool] = True + ) -> List: + """Find all roles that can be signed by the provided keys. + A role can be signed by the list of keys if at least the number + of keys that can sign that file is equal to or greater than the role's + threshold + """ + roles: List[Tuple[str, Optional[str]]] = [] + for role in MAIN_ROLES: + roles.append((role, None)) + keys_roles = [] + while roles: + role_name, parent = roles.pop() + role_obj = self._role_obj(role_name, parent) + target_roles_key_ids = role_obj.keyids + threshold = role_obj.threshold + num_of_signing_keys = len(set(target_roles_key_ids).intersection(key_ids)) + if ( + not check_threshold and num_of_signing_keys >= 1 + ) or num_of_signing_keys >= threshold: + keys_roles.append(role_name) + + if role_name not in MAIN_ROLES or role_name == "targets": + for delegation in self.get_delegations_of_role(role_name): + roles.append((delegation, role_name)) + + return keys_roles + + def find_associated_roles_of_key(self, public_key: SSlibKey) -> List: + """ + Find all roles whose metadata files can be signed by this key + Threshold is not important, as long as the key is one of the signing keys + """ + return self.find_keys_roles([public_key], check_threshold=False) + + def get_all_roles(self) -> List: + """ + Return a list of all defined roles, main roles combined with delegated targets roles + """ + all_target_roles = self.get_all_targets_roles() + all_roles = ["root", "snapshot", "timestamp"] + all_target_roles + return all_roles + + def get_all_targets_roles(self) -> List: + """ + Return a list containing names of all target roles + """ + target_roles = ["targets"] + all_roles = [] + while target_roles: + role = target_roles.pop() + all_roles.append(role) + for delegation in self.get_delegations_of_role(role): + target_roles.append(delegation) + + return all_roles + + def get_all_target_files_state(self) -> Tuple: + """Create dictionaries of added/modified and removed files by comparing current + file-system state with current signed targets (and delegations) metadata state. + + Args: + - None + Returns: + - Dict of added/modified files and dict of removed target files (inputs for + `modify_targets` method.) + + Raises: + - None + """ + added_target_files: Dict = {} + removed_target_files: Dict = {} + # current fs state + fs_target_files = self.all_target_files() + # current signed state + signed_target_files = self.get_signed_target_files() + + # existing files with custom data and (modified) content + for file_name in fs_target_files: + target_file = self.targets_path / file_name + _, hashes = get_file_details(str(target_file)) + # register only new or changed files + if hashes.get(HASH_FUNCTION) != self.get_target_file_hashes(file_name): + custom = self.get_target_file_custom_data(file_name) + added_target_files[file_name] = { + "target": target_file.read_text(), + } + if custom: + added_target_files[file_name]["custom"] = custom + + # removed files + for file_name in signed_target_files - fs_target_files: + removed_target_files[file_name] = {} + + return added_target_files, removed_target_files + + def get_expiration_date(self, role: str) -> datetime: + """ + Return expiration date of the specified role + """ + meta_file = self.signed_obj(role) + if meta_file is None: + raise TAFError(f"Role {role} does not exist") + + date = meta_file.expires + return date.replace(tzinfo=timezone.utc) + + def get_role_threshold(self, role: str, parent: Optional[str] = None) -> int: + """Get threshold of the given role + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + - parent_role(str): Name of the parent role of the delegated role. If not specified, + it will be set automatically, but this might be slow if there + are many delegations. + + Returns: + Role's signatures threshold + + Raises: + - TAFError if the role does not exist or if metadata files are invalid + """ + role_obj = self._role_obj(role, parent) + if role_obj is None: + raise TAFError(f"Role {role} does not exist") + return role_obj.threshold + + def get_role_paths(self, role): + """Get paths of the given role + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + + Returns: + Defined delegated paths of delegate target role or * in case of targets + (the main target is responsible for signing all target files that no delegated role should sign.) + + Raises: + - TAFError if the role does not exist + """ + if role == "targets": + return "*" + role = self._role_obj(role) + if role is None: + raise TAFError(f"Role {role} does not exist") + return role.paths + + def get_role_from_target_paths(self, target_paths: List) -> Optional[str]: + """ + Find a common role that can be used to sign given target paths. + + NOTE: Currently each target has only one mapped role. + """ + targets_roles = self.map_signing_roles(target_paths) + roles = list(targets_roles.values()) + + try: + # all target files should have at least one common role + common_role = reduce( + set.intersection, + [set([r]) if isinstance(r, str) else set(r) for r in roles], + ) + except TypeError: + return None + + if not common_role: + return None + + return common_role.pop() + + def get_signable_metadata(self, role: str): + """Return signable portion of newly generate metadata for given role. + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + + Returns: + A string representing the 'object' encoded in canonical JSON form or None + + Raises: + None + """ + signed = self.signed_obj(role) + return signed.to_dict() + + def get_signed_target_files(self) -> Set[str]: + """Return all target files signed by all roles. + + Args: + - None + + Returns: + - Set of all target paths relative to targets directory + """ + all_roles = self.get_all_targets_roles() + return self.get_signed_target_files_of_roles(all_roles) + + def get_signed_target_files_of_roles( + self, roles: Optional[List] = None + ) -> Set[str]: + """Return all target files signed by the specified roles + + Args: + - roles whose target files will be returned + + Returns: + - Set of paths of target files of a role relative to targets directory + """ + if roles is None: + roles = self.get_all_targets_roles() + + return set( + reduce( + operator.iconcat, + [self.signed_obj(role).targets.keys() for role in roles], + [], + ) + ) + + def get_signed_targets_with_custom_data( + self, roles: Optional[List[str]] = None + ) -> Dict[str, Dict]: + """Return all target files signed by the specified roles and and their custom data + as specified in the metadata files + + Args: + - roles whose target files will be returned + + Returns: + - A dictionary whose keys are paths target files relative to the targets directory + and values are custom data dictionaries. + """ + if roles is None: + roles = self.get_all_targets_roles() + target_files: Dict[str, Dict] = {} + try: + for role in roles: + roles_targets = self.get_targets_of_role(role) + for target_path, target_file in roles_targets.items(): + target_files.setdefault(target_path, {}).update( + target_file.custom or {} + ) + except StorageError: + pass + return target_files + + def get_target_file_custom_data(self, target_path: str) -> Optional[Dict]: + """ + Return a custom data of a given target. + """ + try: + role = self.get_role_from_target_paths([target_path]) + if role is None: + return None + target_obj = self.get_targets_of_role(role).get(target_path) + if target_obj: + return target_obj.custom + return None + except KeyError: + raise TAFError(f"Target {target_path} does not exist") + + def get_target_file_hashes( + self, target_path: str, hash_func: str = HASH_FUNCTION + ) -> Optional[str]: + """ + Return hashes of the given target path. + + Raises: + - TAFError if the target does not exist + """ + try: + role = self.get_role_from_target_paths([target_path]) + if role is None: + return None + targets_of_role = self.get_targets_of_role(role) + if target_path not in targets_of_role: + return None + hashes = targets_of_role[target_path].hashes + if hash_func not in hashes: + raise TAFError(f"Invalid hashing algorithm {hash_func}") + return hashes[hash_func] + except KeyError: + raise TAFError(f"Target {target_path} does not exist") + + def get_key_length_and_scheme_from_metadata( + self, parent_role: str, keyid: str + ) -> Tuple: + """ + Return length and signing scheme of the specified key id. + This data is specified in metadata files (root or a target role that has delegations) + """ + try: + metadata = json.loads( + Path( + self.path, METADATA_DIRECTORY_NAME, f"{parent_role}.json" + ).read_text() + ) + metadata = metadata["signed"] + if "delegations" in metadata: + metadata = metadata["delegations"] + scheme = metadata["keys"][keyid]["scheme"] + pub_key_pem = metadata["keys"][keyid]["keyval"]["public"] + pub_key = serialization.load_pem_public_key( + pub_key_pem.encode(), backend=default_backend() + ) + return pub_key, scheme + except Exception: + return None, None + + def generate_roles_description(self) -> Dict: + """ + Generate a roles description dictionary, containing information + about each role, like its threhold, number of signing keys, delegations + if it is a target role, key scheme, key lengths. + """ + roles_description = {} + + def _get_delegations(role_name): + delegations_info = {} + for delegation in self.get_delegations_of_role(role_name): + delegated_role = self._role_obj(delegation) + delegations_info[delegation] = { + "threshold": delegated_role.threshold, + "number": len(delegated_role.keyids), + "paths": delegated_role.paths, + "terminating": delegated_role.terminating, + } + pub_key, scheme = self.get_key_length_and_scheme_from_metadata( + role_name, delegated_role.keyids[0] + ) + + delegations_info[delegation]["scheme"] = scheme + delegations_info[delegation]["length"] = pub_key.key_size + delegated_signed = self.signed_obj(delegation) + if delegated_signed.delegations: + inner_roles_data = _get_delegations(delegation) + if len(inner_roles_data): + delegations_info[delegation]["delegations"] = inner_roles_data + return delegations_info + + for role_name in MAIN_ROLES: + role_obj = self._role_obj(role_name) + roles_description[role_name] = { + "threshold": role_obj.threshold, + "number": len(role_obj.keyids), + } + pub_key, scheme = self.get_key_length_and_scheme_from_metadata( + "root", role_obj.keyids[0] + ) + roles_description[role_name]["scheme"] = scheme + roles_description[role_name]["length"] = pub_key.key_size + if role_name == "targets": + targets_signed = self.signed_obj(role_name) + if targets_signed.delegations: + delegations_info = _get_delegations(role_name) + if len(delegations_info): + roles_description[role_name]["delegations"] = delegations_info + return {"roles": roles_description} + + def get_role_keys(self, role): + """Get keyids of the given role + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + + Returns: + List of the role's keyids (i.e., keyids of the keys). + + """ + role_obj = self._role_obj(role) + if role_obj is None: + return None + try: + return role_obj.keyids + except KeyError: + pass + + def is_valid_metadata_key( + self, role: str, key: Union[SSlibKey, str], scheme=DEFAULT_RSA_SIGNATURE_SCHEME + ) -> bool: + """Checks if metadata role contains key id of provided key. + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + - key(securesystemslib.formats.RSAKEY_SCHEMA): Role's key. + + Returns: + Boolean. True if key id is in metadata role key ids, False otherwise. + + Raises: + - TAFError if key is not valid + """ + + try: + if isinstance(key, str): + # mypy will complain if we redefine key + ssl_lib_key = get_sslib_key_from_value(key, scheme) + else: + ssl_lib_key = key + key_id = _get_legacy_keyid(ssl_lib_key) + except Exception: + # TODO log + raise TAFError("Invalid public key specified") + else: + return key_id in self.get_keyids_of_role(role) + + def is_valid_metadata_yubikey(self, role: str, public_key=None) -> bool: + """Checks if metadata role contains key id from YubiKey. + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one + - public_key(securesystemslib.formats.RSAKEY_SCHEMA): RSA public key dict + + Returns: + Boolean. True if smart card key id belongs to metadata role key ids + + Raises: + - YubikeyError + """ + + if public_key is None: + public_key = yk.get_piv_public_key_tuf() + + return self.is_valid_metadata_key(role, public_key) + + def _load_role_signers(self, role: str, signers: List) -> None: + """Verify that the signers can be used to sign the specified role and + add them to the signer cache + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + - signers: A list of signers + + Returns: + None + + Raises: + - InvalidKeyError: If metadata cannot be signed with given key. + """ + + for signer in signers: + key = signer.public_key + if not self.is_valid_metadata_key(role, key): + raise InvalidKeyError(role) + self.signer_cache[role][key.keyid] = signer + + def map_signing_roles(self, target_filenames: List) -> Dict: + """ + For each target file, find delegated role responsible for that target file based + on the delegated paths. The most specific role (meaning most deeply nested) whose + delegation path matches the target's path is returned as that file's matching role. + If there are no delegated roles with a path that matches the target file's path, + 'targets' role will be returned as that file's matching role. Delegation path + is expected to be relative to the targets directory. It can be defined as a glob + pattern. + """ + + roles = ["targets"] + roles_targets = { + target_filename: "targets" for target_filename in target_filenames + } + while roles: + role = roles.pop() + path_patterns = self.get_role_paths(role) + for path_pattern in path_patterns: + for target_filename in target_filenames: + if fnmatch( + target_filename.lstrip(os.sep), + path_pattern.lstrip(os.sep), + ): + roles_targets[target_filename] = role + + for delegation in self.get_delegations_of_role(role): + roles.append(delegation) + + return roles_targets + + def modify_targets( + self, added_data: Optional[Dict] = None, removed_data: Optional[Dict] = None + ) -> Targets: + """Creates a target.json file containing a repository's commit for each repository. + Adds those files to the tuf repository. + + Args: + - added_data(dict): Dictionary of new data whose keys are target paths of repositories + (as specified in targets.json, relative to the targets dictionary). + The values are of form: + { + target: content of the target file + custom: { + custom_field1: custom_value1, + custom_field2: custom_value2 + } + } + - removed_data(dict): Dictionary of the old data whose keys are target paths of + repositories + (as specified in targets.json, relative to the targets dictionary). + The values are not needed. This is just for consistency. + + Content of the target file can be a dictionary, in which case a json file will be created. + If that is not the case, an ordinary textual file will be created. + If content is not specified and the file already exists, it will not be modified. + If it does not exist, an empty file will be created. To replace an existing file with an + empty file, specify empty content (target: '') + + Custom is an optional property which, if present, will be used to specify a TUF target's + + Returns: + - Role whose targets were updates + """ + added_data = {} if added_data is None else added_data + removed_data = {} if removed_data is None else removed_data + data = dict(added_data, **removed_data) + if not data: + raise TargetsError("Nothing to be modified!") + + target_paths = list(data.keys()) + targets_role = self.get_role_from_target_paths(target_paths) + if targets_role is None: + raise TargetsError( + f"Could not find a common role for target paths:\n{'-'.join(target_paths)}" + ) + _, removed_paths = self.create_and_remove_target_files(added_data, removed_data) + + target_files = [] + for path, target_data in added_data.items(): + target_path = (self.targets_path / path).absolute() + custom = target_data.get("custom", None) + target_file = self._create_target_object(target_path, path, custom) + target_files.append(target_file) + + targets_role = self._modify_targets_role( + target_files, removed_paths, targets_role + ) + return targets_role + + def _modify_targets_role( + self, + added_target_files: List[TargetFile], + removed_paths: List[str], + role_name: Optional[str] = Targets.type, + ) -> Targets: + """Add target files to top-level targets metadata.""" + with self.edit_targets(rolename=role_name) as targets: + for target_file in added_target_files: + targets.targets[target_file.path] = target_file + for path in removed_paths: + targets.targets.pop(path, None) + return targets + + def revoke_metadata_key(self, key_id: str, roles: Optional[List[str]] = None): + """Remove metadata key of the provided role without updating timestamp and snapshot. + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + - key_id(str): An object conformant to 'securesystemslib.formats.KEYID_SCHEMA'. + + Returns: + removed_from_roles, not_added_roles, less_than_threshold_roles + """ + if key_id is None: + raise TAFError("Keyid to revoke not specified") + if not roles: + roles = self.find_keysid_roles([key_id]) + + if not roles: + raise TAFError("Key not used to sign any role") + + parents = self.find_parents_of_roles(roles) + self.verify_signers_loaded(parents) + + removed_from_roles = [] + not_added_roles = [] + less_than_threshold_roles = [] + + def _check_if_can_remove(key_id, role): + role_obj = self._role_obj(role) + if len(role_obj.keyids) - 1 < role_obj.threshold: + less_than_threshold_roles.append(role) + return False + key_ids_of_role = self.get_keyids_of_role(role) or [] + if key_id not in key_ids_of_role: + not_added_roles.append(role) + return False + return True + + main_roles = [ + role + for role in roles + if role in MAIN_ROLES and _check_if_can_remove(key_id, role) + ] + if len(main_roles): + with self.edit_root() as root: + for role in main_roles: + root.revoke_key(keyid=key_id, role=role) + removed_from_roles.append(role) + + roles_by_parents = defaultdict(list) + delegated_roles = [ + role + for role in roles + if role not in MAIN_ROLES and _check_if_can_remove(key_id, role) + ] + if len(delegated_roles): + for role in delegated_roles: + parent = self.find_delegated_roles_parent(role) + roles_by_parents[parent].append(role) + + for parent, roles_of_parent in roles_by_parents.items(): + with self.edit(parent) as parent_role: + for role in roles_of_parent: + parent_role.revoke_key(keyid=key_id, role=role) + removed_from_roles.append(role) + + return removed_from_roles, not_added_roles, less_than_threshold_roles + + def remove_delegated_paths(self, roles_paths: Dict[str, List[str]]): + """ + Remove delegated paths to delegated role and return True if at least one removed + """ + + updated = False + for role, paths in roles_paths.items(): + + if not self.check_if_role_exists(role): + raise TAFError(f"Role {role} does not exist") + + parent_role = self.find_delegated_roles_parent(role) + if parent_role is None: + raise TAFError(f"Role {role} is not a delegated role") + + self.verify_signers_loaded([parent_role]) + with self.edit(parent_role) as parent: + for path in paths: + if path in parent.delegations.roles[role].paths: + parent.delegations.roles[role].paths.remove(path) + updated = True + return updated + + def remove_from_open_metadata(self, roles: List[str]) -> None: + """ + Removes the listed roles from metadata_to_keep_open list + """ + for role in roles: + if role in self._metadata_to_keep_open: + self._metadata_to_keep_open.remove(role) + + def roles_targets_for_filenames(self, target_filenames): + """Sort target files by roles + Args: + - target_filenames: List of relative paths of target files + Returns: + - A dictionary mapping roles to a list of target files belonging + to the provided target_filenames list delegated to the role + """ + targets_roles_mapping = self.map_signing_roles(target_filenames) + roles_targets_mapping = {} + for target_filename, role_name in targets_roles_mapping.items(): + roles_targets_mapping.setdefault(role_name, []).append(target_filename) + return roles_targets_mapping + + def _role_obj(self, role: str, parent: Optional[str] = None): + """ + Return TUF's role object for the specified role + """ + if role in MAIN_ROLES: + md = self.open("root") + try: + data = md.to_dict()["signed"]["roles"][role] + return Role.from_dict(data) + except (KeyError, ValueError): + raise TAFError("root.json is invalid") + else: + parent_name = self.find_delegated_roles_parent(role) + if parent_name is None: + return None + md = self.open(parent_name) + delegations_data = md.to_dict()["signed"]["delegations"]["roles"] + for delegation in delegations_data: + if delegation["name"] == role: + try: + return DelegatedRole.from_dict(delegation) + except (KeyError, ValueError): + raise TAFError(f"{delegation}.json is invalid") + return None + + def signed_obj(self, role: str): + """ + Return TUF's signed object for the specified role + """ + md = self.open(role) + return self._signed_obj(role, md) + + def _signed_obj(self, role: str, md=None): + if md is None: + md = self.open(role) + try: + signed_data = md.to_dict()["signed"] + role_to_role_class = { + "root": Root, + "targets": Targets, + "snapshot": Snapshot, + "timestamp": Timestamp, + } + role_class = role_to_role_class.get(role, Targets) + return role_class.from_dict(signed_data) + except (KeyError, ValueError): + raise TAFError(f"Invalid metadata file {role}.json") + + def _set_default_expiration_date(self, signed: Signed) -> None: + """ + Update expiration dates of the specified signed object + """ + interval = self.expiration_intervals.get(signed.type, 90) + start_date = datetime.now(timezone.utc) + expiration_date = start_date + timedelta(days=interval) + signed.expires = expiration_date + + def set_metadata_expiration_date( + self, + role_name: str, + start_date: Optional[datetime] = None, + interval: Optional[int] = None, + ) -> None: + """Set expiration date of the provided role. + + Args: + - role(str): TUF role (root, targets, timestamp, snapshot or delegated one) + - start_date(datetime): Date to which the specified interval is added when calculating + expiration date. If a value is not provided, it is set to the + current time. + - signers(List[CryptoSigner]): a list of signers + - interval(int): A number of days added to the start date. + If not provided, the default value is set based on the role: + + root - 365 days + targets - 90 days + snapshot - 7 days + timestamp - 1 day + all other roles (delegations) - same as targets + + Returns: + None + + Raises: + - securesystemslib.exceptions.FormatError: If the arguments are improperly formatted. + - securesystemslib.exceptions.UnknownRoleError: If 'rolename' has not been delegated by + this targets object. + """ + self.verify_signers_loaded([role_name]) + with self.edit(role_name) as role: + start_date = datetime.now(timezone.utc) + if interval is None: + try: + interval = self.expiration_intervals[role_name] + except KeyError: + interval = self.expiration_intervals["targets"] + expiration_date = start_date + timedelta(days=interval) + role.expires = expiration_date + + def sort_roles_targets_for_filenames(self): + """ + Group target files per target roles + """ + rel_paths = [] + for filepath in self.targets_path.rglob("*"): + if filepath.is_file(): + file_rel_path = str( + Path(filepath).relative_to(self.targets_path).as_posix() + ) + rel_paths.append(file_rel_path) + + files_to_roles = self.map_signing_roles(rel_paths) + roles_targets = {} + for target_file, role in files_to_roles.items(): + roles_targets.setdefault(role, []).append(target_file) + return roles_targets + + def sync_snapshot_with_roles(self, roles: List[str]) -> None: + """ + Add versions of newly created target roles to the snapshot. + Also update the versions of their parent roles, which are modified + when a new delegated role is added. + """ + with self.edit(Snapshot.type) as sn: + for role in roles: + sn.meta[f"{role}.json"].version = sn.meta[f"{role}.json"].version + 1 + + def update_target_role(self, role: str, target_paths: Dict, force=False): + """ + Update the specified target role by adding or removing + target files and target objects for the specified target paths + If false is True, update the metadata files even if no target + paths are specified + """ + if not self.check_if_role_exists(role): + raise TAFError(f"Role {role} does not exist") + self.verify_signers_loaded([role]) + removed_paths = [] + target_files = [] + if target_paths: + for target_path in target_paths: + full_path = self.path / TARGETS_DIRECTORY_NAME / target_path + # file removed, removed from te role + if not full_path.is_file(): + removed_paths.append(target_path) + else: + custom_data = self.get_target_file_custom_data(target_path) + target_file = self._create_target_object( + full_path, target_path, custom_data + ) + target_files.append(target_file) + + self._modify_targets_role(target_files, removed_paths, role) + elif force: + with self.edit(role) as _: + pass + + def update_snapshot_and_timestamp(self, force: Optional[bool] = True): + """ + Update timestamp and snapshot roles. If force is true, update them + even if their content was not modified + """ + self.verify_signers_loaded(["snapshot", "timestamp"]) + self.do_snapshot(force=force) + self.do_timestamp(force=force) + + def verify_roles_exist(self, roles: List[str]): + """ + Check if the specified roles exist and raise an error if an least one does not exist + """ + non_existant_roles = [] + for role in roles: + if not self.check_if_role_exists(role): + non_existant_roles.append(role) + if len(non_existant_roles): + raise TAFError(f"Role(s) {', '.join(non_existant_roles)} do not exist") + + def verify_signers_loaded(self, roles: List[str]): + """ + Verify that the signers associated with the specified keys were added to the signer cache. + Raise an error if that is not the case + """ + not_loaded = [role for role in roles if role not in self.signer_cache] + if len(not_loaded): + raise SignersNotLoaded(roles=not_loaded) diff --git a/taf/tuf/storage.py b/taf/tuf/storage.py new file mode 100644 index 000000000..0372d4c2b --- /dev/null +++ b/taf/tuf/storage.py @@ -0,0 +1,121 @@ +from contextlib import contextmanager +import io +from pathlib import Path +from typing import IO, Dict, Optional +import pygit2 +from taf.constants import METADATA_DIRECTORY_NAME +from taf.exceptions import GitError, TAFError +from taf.git import GitRepository + +from securesystemslib.storage import FilesystemBackend + +from securesystemslib.exceptions import StorageError + +git_repos_cache: Dict[str, GitRepository] = {} + + +def is_subpath(path, potential_subpath): + path = Path(path).resolve() + potential_subpath = Path(potential_subpath).resolve() + + try: + potential_subpath.relative_to(path) + return True + except ValueError: + return False + + +def find_git_repository(inner_path): + """ + Instantiates a git repository based on a path + that is expected to be inside that repository. + Enables smoother integration with TUF's default + FilesystemBackend implementation + """ + for path in list(git_repos_cache.keys()): + if is_subpath(inner_path, path): + return git_repos_cache[path] + repo_path = pygit2.discover_repository(inner_path) + repo = None + if not repo_path: + # could be a bare repository + repo_path = str(inner_path).split(METADATA_DIRECTORY_NAME)[0] + if repo_path: + try: + pygit2.Repository(repo_path) + except Exception: + return None + else: + repo = GitRepository(path=repo_path) + else: + repo_path = Path(repo_path).parent + repo = GitRepository(path=repo_path) + + if repo: + git_repos_cache[repo.path] = repo + return repo + + +class GitStorageBackend(FilesystemBackend): + """ + Storage backend implemnantation that loads data + from a specific commit, if it is specified, + or from the filesystem, if the commit is None + Extends TUF's FilesystemBackend. + """ + + commit: Optional[str] = None + + def __new__(cls, *args, **kwargs): + # Bypass singleton + # This is necessary in order to use this within the context of + # parallel update of multiple repositories + return super(FilesystemBackend, cls).__new__(cls, *args, **kwargs) + + @contextmanager + def get(self, filepath: str): + # If the commit is specified, read from Git. + # If it is not specified, read from the filesystem. + if self.commit is None: + with super().get(filepath=filepath) as value_from_base: + yield value_from_base + else: + try: + repo = find_git_repository(filepath) + file_path = Path(filepath) + relative_path = file_path.relative_to(repo.path) + data = repo.get_file(self.commit, relative_path).encode() + yield io.BytesIO(data) + except GitError as e: + raise StorageError(e) + except TAFError as e: + raise StorageError(e) + + def getsize(self, filepath: str) -> int: + # Get size of a file after reading it from Git or the filesystem. + # If the commit is specified, read from Git. + # If it is not specified, read from the filesystem. + if self.commit is None: + return super().getsize(filepath=filepath) + try: + repo = find_git_repository(filepath) + file_path = Path(filepath) + relative_path = file_path.relative_to(repo.path) + data = repo.get_file(self.commit, relative_path).encode() + return len(data) + except GitError as e: + raise StorageError(e) + except TAFError as e: + raise StorageError(e) + + def put(self, fileobj: IO, filepath: str, restrict: Optional[bool] = False) -> None: + # Write the file to the filesystem. + # Raise an error if the repository is a bare repository. + repo_path = pygit2.discover_repository(filepath) + if repo_path: + repo = find_git_repository(filepath) + if repo.is_bare_repository: + raise TAFError( + f"Cannot write to {filepath}. Repository is a bare repository" + ) + super().put(fileobj, filepath, restrict) diff --git a/taf/updater/git_trusted_metadata_set.py b/taf/updater/git_trusted_metadata_set.py index 7d7217642..33cbf2d8e 100644 --- a/taf/updater/git_trusted_metadata_set.py +++ b/taf/updater/git_trusted_metadata_set.py @@ -1,5 +1,6 @@ import datetime from tuf.ngclient._internal import trusted_metadata_set +from tuf.ngclient.config import EnvelopeType class GitTrustedMetadataSet(trusted_metadata_set.TrustedMetadataSet): @@ -16,6 +17,8 @@ class GitTrustedMetadataSet(trusted_metadata_set.TrustedMetadataSet): See: GitUpdater """ - def __init__(self, data): - super(GitTrustedMetadataSet, self).__init__(data) - self.reference_time = datetime.datetime.min + def __init__(self, data, envelope_type=EnvelopeType.METADATA): + super(GitTrustedMetadataSet, self).__init__(data, envelope_type) + self.reference_time = datetime.datetime.min.replace( + tzinfo=datetime.timezone.utc + ) diff --git a/taf/updater/lifecycle_handlers.py b/taf/updater/lifecycle_handlers.py index bdfc614ae..af16212c8 100644 --- a/taf/updater/lifecycle_handlers.py +++ b/taf/updater/lifecycle_handlers.py @@ -8,7 +8,7 @@ from pathlib import Path import taf.settings as settings -from taf.repository_tool import get_target_path +from taf.tuf.repository import get_target_path from taf.utils import ( run, safely_save_json_to_disk, diff --git a/taf/updater/updater.py b/taf/updater/updater.py index 2650e22a8..1bf27861c 100644 --- a/taf/updater/updater.py +++ b/taf/updater/updater.py @@ -39,7 +39,7 @@ ) from pathlib import Path -from taf.log import taf_logger, disable_tuf_console_logging +from taf.log import taf_logger import taf.repositoriesdb as repositoriesdb from taf.utils import is_non_empty_directory, timed_run import taf.settings as settings @@ -59,8 +59,6 @@ from concurrent.futures import ThreadPoolExecutor from taf.updater.types.update import Update -disable_tuf_console_logging() - def _check_update_status(repos_update_data: Dict[str, Any]) -> Tuple[Event, str]: # helper function to set update status of update handler based on repo status. diff --git a/taf/utils.py b/taf/utils.py index 5e847725a..0bfa0e6b7 100644 --- a/taf/utils.py +++ b/taf/utils.py @@ -21,9 +21,13 @@ load_pem_private_key, ) from json import JSONDecoder +from taf.log import taf_logger import taf.settings from taf.exceptions import PINMissmatchError -from taf.log import taf_logger + +# TODO: Remove legacy imports +# from taf.log import taf_logger + from typing import List, Optional, Tuple, Dict from securesystemslib.hash import digest_fileobject from securesystemslib.storage import FilesystemBackend, StorageBackendInterface @@ -146,7 +150,7 @@ def is_run_from_python_executable() -> bool: def read_input_dict(value): if value is None: return {} - if type(value) is str: + if not isinstance(value, dict): if Path(value).is_file(): with open(value) as f: try: diff --git a/taf/validation.py b/taf/validation.py index e71f629f3..856a6d43a 100644 --- a/taf/validation.py +++ b/taf/validation.py @@ -1,9 +1,8 @@ from pathlib import Path -from tuf.repository_tool import TARGETS_DIRECTORY_NAME, METADATA_DIRECTORY_NAME -from taf.repository_tool import Repository, get_target_path -from taf.constants import CAPSTONE +from taf.constants import CAPSTONE, METADATA_DIRECTORY_NAME, TARGETS_DIRECTORY_NAME from taf.exceptions import GitError, InvalidBranchError +from taf.tuf.repository import MetadataRepository, get_target_path def validate_branch( @@ -237,7 +236,7 @@ def _compare_commit_with_targets_metadata( def _get_unchanged_targets_metadata(auth_repo, updated_roles): - taf_repo = Repository(auth_repo.path) + taf_repo = MetadataRepository(auth_repo.path) all_roles = taf_repo.get_all_targets_roles() all_roles = [*(set(all_roles) - set(updated_roles))] return all_roles diff --git a/taf/yubikey.py b/taf/yubikey.py index 002f6a2c3..36825e0f1 100644 --- a/taf/yubikey.py +++ b/taf/yubikey.py @@ -13,7 +13,8 @@ from cryptography.hazmat.primitives.serialization import load_pem_private_key from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import rsa, padding -from tuf.repository_tool import import_rsakey_from_pem + +from taf.tuf.keys import get_sslib_key_from_value from ykman.device import list_all_devices from yubikit.core.smartcard import SmartCardConnection from ykman.piv import ( @@ -33,6 +34,8 @@ from taf.exceptions import InvalidPINError, YubikeyError from taf.utils import get_pin_for +from securesystemslib.signer._key import SSlibKey + DEFAULT_PIN = "123456" DEFAULT_PUK = "12345678" EXPIRATION_INTERVAL = 36500 @@ -220,20 +223,20 @@ def export_piv_pub_key(pub_key_format=serialization.Encoding.PEM): @raise_yubikey_err("Cannot export yk certificate.") -def export_yk_certificate(certs_dir, key): +def export_yk_certificate(certs_dir, key: SSlibKey): if certs_dir is None: certs_dir = Path.home() else: certs_dir = Path(certs_dir) certs_dir.mkdir(parents=True, exist_ok=True) - cert_path = certs_dir / f"{key['keyid']}.cert" + cert_path = certs_dir / f"{key.keyid}.cert" print(f"Exporting certificate to {cert_path}") with open(cert_path, "wb") as f: f.write(export_piv_x509()) @raise_yubikey_err("Cannot get public key in TUF format.") -def get_piv_public_key_tuf(scheme=DEFAULT_RSA_SIGNATURE_SCHEME): +def get_piv_public_key_tuf(scheme=DEFAULT_RSA_SIGNATURE_SCHEME) -> SSlibKey: """Return public key from a Yubikey in TUF's RSAKEY_SCHEMA format. Args: @@ -250,7 +253,7 @@ def get_piv_public_key_tuf(scheme=DEFAULT_RSA_SIGNATURE_SCHEME): - YubikeyError """ pub_key_pem = export_piv_pub_key().decode("utf-8") - return import_rsakey_from_pem(pub_key_pem, scheme) + return get_sslib_key_from_value(pub_key_pem, scheme) @raise_yubikey_err("Cannot sign data.") @@ -366,7 +369,9 @@ def setup( ) -def setup_new_yubikey(serial_num, scheme=DEFAULT_RSA_SIGNATURE_SCHEME, key_size=2048): +def setup_new_yubikey( + serial_num, scheme=DEFAULT_RSA_SIGNATURE_SCHEME, key_size=2048 +) -> SSlibKey: pin = get_key_pin(serial_num) cert_cn = input("Enter key holder's name: ") print("Generating key, please wait...") @@ -374,7 +379,7 @@ def setup_new_yubikey(serial_num, scheme=DEFAULT_RSA_SIGNATURE_SCHEME, key_size= pin, cert_cn, cert_exp_days=EXPIRATION_INTERVAL, key_size=key_size ).decode("utf-8") scheme = DEFAULT_RSA_SIGNATURE_SCHEME - key = import_rsakey_from_pem(pub_key_pem, scheme) + key = get_sslib_key_from_value(pub_key_pem, scheme) return key @@ -491,3 +496,9 @@ def _read_and_check_yubikey( if success: return key, serial_num retry_counter += 1 + + +def yk_secrets_handler(prompt, serial_num): + if prompt == "pin": + return get_key_pin(serial_num) + raise YubikeyError(f"Invalid prompt {prompt}")