Skip to content

Get-VaultObject assumes port 8200 #3

@MB34

Description

@MB34

In this code:

begin{
        if($Address -notlike "http://*.*.*.*:8200"){$Address = "http://127.0.0.1:8200" }
    }

 process{
        $vaultobject = [PSCustomObject]@{'uri'= $Address + $prefix
                            'auth_header' = @{'X-Vault-Token'=$Token}
                            } 
    }
    end{
        return  $vaultobject
    }

You are assuming that the Vault is on port 8200. If anyone installs Hashicorp Vault on another port, this module will never work.
Ours is installed at a URL like this: https://hashivault.dev.local.

When doing this:
get-Vaultobject -Address https://hashivault.dev.local -Token <token>
It returns this:

uri                   auth_header    
---                   -----------    
http://127.0.0.1:8200 {X-Vault-Token}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions