Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
a775c979
Commit
a775c979
authored
Jun 19, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/digitalocean: Scrub sensitive information out of logs
/cc @pearkes
parent
bb5b12d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
builder/digitalocean/api.go
builder/digitalocean/api.go
+5
-2
No files found.
builder/digitalocean/api.go
View file @
a775c979
...
@@ -166,12 +166,15 @@ func (d DigitalOceanClient) DropletStatus(id uint) (string, string, error) {
...
@@ -166,12 +166,15 @@ func (d DigitalOceanClient) DropletStatus(id uint) (string, string, error) {
// the response.
// the response.
func
NewRequest
(
d
DigitalOceanClient
,
path
string
,
params
string
)
(
map
[
string
]
interface
{},
error
)
{
func
NewRequest
(
d
DigitalOceanClient
,
path
string
,
params
string
)
(
map
[
string
]
interface
{},
error
)
{
client
:=
d
.
client
client
:=
d
.
client
url
:=
fmt
.
Sprintf
(
"%
v/%v?%v&client_id=%v&api_key=%v
"
,
url
:=
fmt
.
Sprintf
(
"%
s/%s?%s&client_id=%s&api_key=%s
"
,
DIGITALOCEAN_API_URL
,
path
,
params
,
d
.
ClientID
,
d
.
APIKey
)
DIGITALOCEAN_API_URL
,
path
,
params
,
d
.
ClientID
,
d
.
APIKey
)
var
decodedResponse
map
[
string
]
interface
{}
var
decodedResponse
map
[
string
]
interface
{}
log
.
Printf
(
"sending new request to digitalocean: %v"
,
url
)
// Do some basic scrubbing so sensitive information doesn't appear in logs
scrubbedUrl
:=
strings
.
Replace
(
url
,
d
.
ClientID
,
"CLIENT_ID"
)
scrubbedUrl
:=
strings
.
Replace
(
url
,
d
.
APIKey
,
"API_KEY"
)
log
.
Printf
(
"sending new request to digitalocean: %s"
,
scrubbedUrl
)
resp
,
err
:=
client
.
Get
(
url
)
resp
,
err
:=
client
.
Get
(
url
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment