infamousjoeg / cybr-cli

A "Swiss Army Knife" command-line interface (CLI) for easy human and non-human interaction with @CyberArk suite of products.
Apache License 2.0
71 stars 15 forks source link

Fix #133 - Self-signed flag truncates left side characters in Base URL in certain scenarios #134

Closed infamousjoeg closed 2 years ago

infamousjoeg commented 2 years ago

When formatting the Base URL of the Conjur service, strings.TrimLeft("https://") was being used. This creates a "cut set" of h, t, p, :, and / and removes all instances of that from the left side of the given string until the characters no longer exist. This caused the Base URL https://poc-sandbox.joe-garcia.com to truncate to oc-sandbox.joe-garcia.com.

By changing to strings.TrimPrefix("https://") it will only remove that static value from the beginning of the string and prevent unwanted truncation from the hostname. This fix has been implemented.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication