Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bundler-push-host-key

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bundler-push-host-key

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

bundle-push-host-key

This gem adds support for multiple keys when pushing gems using the bundler rake tasks

Usage

  • In the Rakefile, replace require 'bundler/gem_tasks' with require 'bundler/gem_tasks/push_host_key'

  • In .gem/credentials add a new credential with your gemserver's hostname (only the hostname!) as key:

    ---
    # Official rubygems API key entry 
    :rubygems_api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    # Your custom API key for gemserver.example.net
    :gemserver.example.net: <API Key>
    
    # Basic Authentication instead of API key 
    :gemserver.example.net: "Basic dXNlcjpwYXNzCg=="
    
  • In your gemspecs, set the allowed_push_host:

    Gem::Specification.new do |gem|
      # ...
      gem.metadata = {
        'allowed_push_host' => 'https://gemserver.example.com',
      }
      # ...
    end
    

Notes

This gem uses the --key feature of the gem command. When pushing with the gem command directly, you can specify --key gemserver.example.net

Afaik, the gem command has no official way to authenticate when loading gems. In Bundler you can set the basic auth credentials with this command: bundle config gemserver.example.net user:pass

If there is a better, official way to have multiple private gemserver with individual credentials and not only push-authentication, I will happily drop this gem.

FAQs

Package last updated on 03 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc