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

cpe_remote auth headers #177

Closed
erikng opened this issue Jun 25, 2018 · 6 comments
Closed

cpe_remote auth headers #177

erikng opened this issue Jun 25, 2018 · 6 comments

Comments

@erikng
Copy link
Contributor

erikng commented Jun 25, 2018

the cpe_remote cookbook currently warns if auth headers are not passed, but there is no actual way for people using the cookbook to pass these as it's an internal feature to FB. Could this be generalized and added to the cookbook?

I would love to have auth header usage to protect the chef_remote repo urls

@clburlison
Copy link
Contributor

For what it's worth this can be accomplished right now by editing cpe_remote/libraries/helpers.rb file with the following:

    def auth_headers(url, method)
      #CPE::Distro.auth_headers(url, method)
      require 'base64'
      {'AUTHORIZATION' => "Basic #{
        Base64.strict_encode64('username:password')}",
        'Content-Type' => 'application/data'
      }
    rescue StandardError
      Chef::Log.warn('Building auth headers failed')
      {}
    end

I tried a few variations of creating a CPE::Distro.auth_headers function in a separate helper library file but came up unsucessful. I'm sure that was user error on my part 🤷‍♂️

As for Erik's comment I think this could solved in the README as a new "authorzation" section. It would be nice to document how to add the CPE::Distro.auth_headers format so we could keep this in a sepreate non-cpe_remote cookbook.

Cheers

@erikng
Copy link
Contributor Author

erikng commented Nov 5, 2018

@mikedodge04 @chilcote did you guys ever finish this? I thought you did.

@johnnyramos
Copy link
Contributor

+1 - would be useful deal with us cloud folks.

@DNSGeek DNSGeek closed this as completed Dec 21, 2020
@DNSGeek
Copy link

DNSGeek commented Dec 21, 2020

Don't think this is still needed.

@natewalck
Copy link
Contributor

Why is this no longer needed? Has cpe_remote been updated to have this functionality?

@erikng
Copy link
Contributor Author

erikng commented Dec 21, 2020

Definitely still needed if the support hasn't been added.

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

No branches or pull requests

5 participants