Skip to content

Conversation

@isivaselvan
Copy link
Collaborator

Description

Implemented Registry Provider Version API Specs

https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/provider-versions-platforms

Feature contains:

  • list() --> Listing all versions
  • create() --> Creating new registry provider version
  • read() --> Show the specific registry provider version
  • delete() --> Delete the specific registry provider version
  • _registry_provider_version_from() --> Helper method to parse a version from API response data.
  • Unit test cases added at tests/units/test_registry_provider_version.py
  • examples added at examples/registry_provider_version.py
  • Modified the utils.py to validate the string id pattern on whitespace and slashes.

Testing plan

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

> python examples/registry_provider_version.py --organization prab-sandbox01 --registry-name private --namespace prab-sandbox01 --name test-provider-1764841619

================================================================================
Listing versions for private/prab-sandbox01/test-provider-1764841619
================================================================================
- Version 1.0.0 (ID: provver-4y7x3KaNLswoiRar)
  Created: 2025-12-04 09:47:01.043000+00:00
  Updated: 2025-12-04 09:47:01.043000+00:00
  Key ID: test-key-1764841619
  Protocols: 5.0, 6.0
  Shasums Uploaded: False
  Shasums Signature Uploaded: False
  Permissions:
    Can Delete: True
    Can Upload Asset: True

- Version 1.1.0 (ID: provver-9NHKNHCbzHvZzSmc)
  Created: 2025-12-04 09:47:01.448000+00:00
  Updated: 2025-12-04 09:47:01.448000+00:00
  Key ID: test-key-1764841619
  Protocols: 5.0, 6.0
  Shasums Uploaded: False
  Shasums Signature Uploaded: False
  Permissions:
    Can Delete: True
    Can Upload Asset: True

- Version 1.2.0 (ID: provver-ug6EpkG3rEpj5kdE)
  Created: 2025-12-08 11:35:01.168000+00:00
  Updated: 2025-12-08 11:35:01.168000+00:00
  Key ID: test-key-siva
  Protocols: 6.0
  Shasums Uploaded: False
  Shasums Signature Uploaded: False
  Permissions:
    Can Delete: True
    Can Upload Asset: True

Total: 3 versions

> python examples/registry_provider_version.py --organization prab-sandbox01 --registry-name private --namespace prab-sandbox01 --name test-provider-1764841619 --read --version 1.0.0

================================================================================
Reading version: 1.0.0
================================================================================
Version ID: provver-4y7x3KaNLswoiRar
  Version: 1.0.0
  Created: 2025-12-04 09:47:01.043000+00:00
  Updated: 2025-12-04 09:47:01.043000+00:00
  Key ID: test-key-1764841619
  Protocols: 5.0, 6.0
  Shasums Uploaded: False
  Shasums Signature Uploaded: False
  Permissions:
    Can Delete: True
    Can Upload Asset: True


> python examples/registry_provider_version.py --organization prab-sandbox01 --registry-name private --namespace prab-sandbox01 --name test-provider-1764841619 --create --version 1.3.0 --key-id create-new-version --protocols 6.0

================================================================================
Creating new version: 1.3.0
================================================================================
Created version: provver-oY3ov8zuCah91CzF
  Version: 1.3.0
  Created: 2025-12-16 09:27:09.791000+00:00
  Key ID: create-new-version
  Protocols: 6.0
  Shasums Uploaded: False
  Shasums Signature Uploaded: False

> python examples/registry_provider_version.py --organization prab-sandbox01 --registry-name private --namespace prab-sandbox01 --name test-provider-1764841619 --delete --version 1.3.0  

================================================================================
Deleting version: 1.3.0
================================================================================
Version to delete:
  ID: provver-oY3ov8zuCah91CzF
  Version: 1.3.0
  Protocols: 6.0
  Key ID: create-new-version

  Successfully deleted version: 1.3.0

Rollback Plan

Changes to Security Controls

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

If you have any questions, please contact your direct supervisor, GRC (#team-grc), or the PCI working group (#proj-pci-reboot). You can also find more information at PCI Compliance.

@isivaselvan isivaselvan requested a review from a team as a code owner December 16, 2025 09:29
@isivaselvan isivaselvan changed the title Feature/registry provider version feature/registry provider version Dec 16, 2025
@isivaselvan isivaselvan changed the title feature/registry provider version feature/registry-provider-version Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant