Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add client with cert auth support and adding API call to get public-key from Blackduck #17

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

aclairekeum
Copy link

Added clients with cert auth, with auth token and without auth token.
Added API call to retrieve the public-key from Blackduck

Copy link
Contributor

@mattfenwick mattfenwick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 🎉 Nice work @aclairekeum !!!!

func ConfigureTLSWithCerts(systemCert string, systemKey string, cacert string, insecure bool) (*tls.Config, error) {
cert, err := tls.LoadX509KeyPair(systemCert, systemKey)
if err != nil {
log.Warnf("Cannot load system cert and key file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: why are errors logged with Warn?

@@ -0,0 +1,6 @@
package hubapi
Copy link
Contributor

@mattfenwick mattfenwick Sep 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these files need this little license header?

 // Copyright 2018 Synopsys, Inc.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
 // http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.

}

c.doPreRequest(req)
log.Debugf("POST Request: %+v.", req)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this call will log request's headers, they will contain basic auth header, and will be visible in a log file too

@tandr
Copy link
Contributor

tandr commented Sep 28, 2021

@mattfenwick -- thoughts on cleaning it up, and maybe merging? Or closing...

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.

4 participants