Skip to content

Commit 0825c06

Browse files
committed
Merge branch 'danimtb/extension-plugin-pkgsign' of github.com:conan-io/examples2 into danimtb/extension-plugin-pkgsign
2 parents cd3e0c8 + 1977255 commit 0825c06

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

examples/extensions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
- Learn how to create a custom deployer in Conan. [Docs](https://docs.conan.io/2/reference/extensions/deployers.html)
1010

11-
### [Package signing plugin example with OpenSSL](extensions/plugins/sign)
11+
### [Package signing plugin example with OpenSSL](extensions/plugins/openssl_sign)
1212

1313
- Learn how to create a package signing plugin in Conan. [Docs](https://docs.conan.io/2/reference/extensions/package_signing.html)

examples/extensions/plugins/openssl_sign/ci_test_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
return
99

1010
current_dir = os.path.abspath(os.path.dirname(__file__))
11-
provider_folder = os.path.join(current_dir, "your-organization")
11+
provider_folder = os.path.join(current_dir, "my-organization")
1212
os.makedirs(provider_folder)
1313
run(f"openssl genpkey -algorithm RSA -out {provider_folder}/private_key.pem -pkeyopt rsa_keygen_bits:2048")
1414
run(f"openssl pkey -in {provider_folder}/private_key.pem -pubout -out {provider_folder}/public_key.pem")

examples/extensions/plugins/openssl_sign/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Steps to test the example:
55

66
- Copy the ``sign.py`` file to your Conan home at ```CONAN_HOME/extensions/plugins/sign/sign.py```.
77
- Generate your signing keys (see comment at the top of the ``sign.py`` file) and place them next to the ``sign.py`` file,
8-
inside a folder with the name of your provider (``your-organization`` in the example).
8+
inside a folder with the name of your provider (``my-organization`` in the example).
99
- Generate a new project to test the sign and verify commands: ``conan new cmake_lib -d name=hello -d version=1.0``.
1010
- Create the package: ``conan create``.
1111
- Sign the package: ``conan cache sign hello/1.0``.
1212
- Verify the package signature: ```conan cache verify hello/1.0```.
13-
- You can also use the ``conan install`` command, and the packages should be verified automatically.
13+
- You can also use the ``conan install`` command, and the packages should be verified automatically when they are downloaded from a remote.

examples/extensions/plugins/openssl_sign/sign.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _run_command(command):
4242

4343

4444
def sign(ref, artifacts_folder, signature_folder, **kwargs):
45-
provider = "your-organization" # This maps to the folder containing the signing keys (for simplicity)
45+
provider = "my-organization" # This maps to the folder containing the signing keys (for simplicity)
4646
manifest_filepath = os.path.join(signature_folder, "pkgsign-manifest.json")
4747
signature_filename = "pkgsign-manifest.json.sig"
4848
signature_filepath = os.path.join(signature_folder, signature_filename)
@@ -63,7 +63,7 @@ def sign(ref, artifacts_folder, signature_folder, **kwargs):
6363
_run_command(openssl_sign_cmd)
6464
ConanOutput().success(f"Package signed for reference {ref}")
6565
except Exception as exc:
66-
raise ConanException(f"Error signing artifact {summary_filepath}: {exc}")
66+
raise ConanException(f"Error signing artifact")
6767
return [{"method": "openssl-dgst",
6868
"provider": provider,
6969
"sign_artifacts": {
@@ -80,7 +80,7 @@ def verify(ref, artifacts_folder, signature_folder, files, **kwargs):
8080
raise ConanException("Signature file does not exist")
8181

8282
# The provider is useful to choose the correct public key to verify packages with
83-
expected_provider = "your-organization"
83+
expected_provider = "my-organization"
8484
signature_provider = signature.get("provider")
8585
if signature_provider != expected_provider:
8686
raise ConanException(f"The provider does not match ({expected_provider} [expected] != {signature_provider} "

examples/libraries/libcurl/download_image/ci_test_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
print("libcurl and stb example")
55

6-
# not using a conanfile because that will be created by the CLion plugins, in case someone just wants to
6+
# not using a conanfile because that will be created by the CLion plugin, in case someone just wants to
77
# copy this code to its folder so that the user does not find any conflicting file
88
run("conan install --requires=stb/cci.20240531 --build=missing -g CMakeDeps -g CMakeToolchain --output-folder=build")
99
run("conan install --requires=libcurl/8.12.1 --build=missing -g CMakeDeps -g CMakeToolchain --output-folder=build")

0 commit comments

Comments
 (0)