Skip to content

Commit

Permalink
adding basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
sigalmaya committed Dec 6, 2021
1 parent c9ba7fa commit a84a512
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/osb/osb_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ func (c *Controller) proxy(r *web.Request, logger *logrus.Entry, broker *types.S

modifiedRequest := r.Request.WithContext(ctx)
if broker.Credentials.BasicExists() {
logger.Infof("######@@@ setting basic auth %s:%s",broker.Credentials.Basic.Username, broker.Credentials.Basic.Password)
modifiedRequest.SetBasicAuth(broker.Credentials.Basic.Username, broker.Credentials.Basic.Password)
}else{
logger.Infof("######@@@ Not setting basic auth")
}

referencedInstance := getReferencedInstance(ctx)
Expand Down
3 changes: 3 additions & 0 deletions pkg/client/broker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ func (bc *BrokerClient) authAndTlsDecorator(requestHandler util.DoRequestWithCli
ctx := req.Context()
logger := log.C(ctx)
if bc.broker.Credentials.BasicExists() {
logger.Infof("######@@@ setting basic auth %s:%s",bc.broker.Credentials.Basic.Username, bc.broker.Credentials.Basic.Password)
bc.addBasicAuth(req)
}else{
logger.Infof("######@@@ not setting basic auth")
}

if bc.tlsConfig != nil {
Expand Down

0 comments on commit a84a512

Please sign in to comment.