GoogleCloudPlatform / artifact-registry-yum-plugin

Apache License 2.0
6 stars 14 forks source link

Refactor for credential helper #22

Closed hopkiw closed 1 year ago

hopkiw commented 1 year ago

Using native python libraries is introducing a serious dependency management risk due to the state of python environments we want to integrate with. To remove the burden of the vendored packages and associated patches, include and call a binary credential helper. The python plugin code is still responsible for parsing the config and updating the repository object headers, but detecting credentials and generating tokens is offloaded to the helper.

Tested builds and installed on RHEL7 and RHEL8 hosts to test authenticated repo access. No config change was required when using these.

dnf-plugin-artifact-registry:

Name        : dnf-plugin-artifact-registry
Epoch       : 1
Version     : 1testing
Release     : g1.el8
Architecture: x86_64
Install Date: (not installed)
Group       : Unspecified
Size        : 5247647
License     : ASL 2.0
Signature   : (none)
Source RPM  : dnf-plugin-artifact-registry-1testing-g1.el8.src.rpm
Build Date  : Wed 14 Dec 2022 08:52:47 PM UTC
Build Host  : inst-build-pkg-el8-build-package-qsl6d.c.<redact>.internal
Relocations : (not relocatable)
URL         : https://cloud.google.com/artifact-registry
Summary     : dnf plugin for Artifact Registry
Description :
Contains a dnf plugin for authenticated access to Artifact Registry repositories.
config(dnf-plugin-artifact-registry) = 1:1testing-g1.el8
dnf >= 1.0.0
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
/etc/dnf/plugins/artifact-registry.conf
/usr/lib/python3.6/site-packages/dnf-plugins/__pycache__/artifact-registry.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/dnf-plugins/__pycache__/artifact-registry.cpython-36.pyc
/usr/lib/python3.6/site-packages/dnf-plugins/artifact-registry.py
/usr/libexec/ar-token
/usr/share/doc/dnf-plugin-artifact-registry
/usr/share/doc/dnf-plugin-artifact-registry/LICENSE

yum-plugin-artifact-registry:

Name        : yum-plugin-artifact-registry
Epoch       : 1
Version     : 1testing
Release     : g1.el7
Architecture: x86_64
Install Date: (not installed)
Group       : Unspecified
Size        : 5246846
License     : ASL 2.0
Signature   : (none)
Source RPM  : yum-plugin-artifact-registry-1testing-g1.el7.src.rpm
Build Date  : Wed 14 Dec 2022 08:37:55 PM UTC
Build Host  : inst-build-pkg-el7-build-package-yjws8.c.<redact>.internal
Relocations : (not relocatable)
URL         : https://cloud.google.com/artifact-registry
Summary     : Yum plugin for Artifact Registry
Description :
Contains a Yum plugin for authenticated access to Artifact Registry repositories.
config(yum-plugin-artifact-registry) = 1:1testing-g1.el7
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
yum >= 3.0
rpmlib(PayloadIsXz) <= 5.2-1
/etc/yum/pluginconf.d/artifact-registry.conf
/usr/lib/yum-plugins/artifact-registry.py
/usr/lib/yum-plugins/artifact-registry.pyc
/usr/lib/yum-plugins/artifact-registry.pyo
/usr/libexec/ar-token
/usr/share/doc/yum-plugin-artifact-registry-1testing
/usr/share/doc/yum-plugin-artifact-registry-1testing/LICENSE
hopkiw commented 1 year ago

This presubmit is actually not valid. Amending in GoogleCloudPlatform/oss-test-infra#1855 Will rerun presubmits after this is merged.

hopkiw commented 1 year ago

/retest

google-oss-prow[bot] commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hopkiw, illfelder

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/GoogleCloudPlatform/artifact-registry-yum-plugin/blob/main/OWNERS)~~ [hopkiw,illfelder] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment