Giter Club home page Giter Club logo

go-netrc's Introduction

go-netrc GoDoc CircleCI

A netrc parser for Go.

Usage

Getting credentials for a host.

usr, err := user.Current()
n, err := netrc.Parse(filepath.Join(usr.HomeDir, ".netrc"))
fmt.Println(n.Machine("api.heroku.com").Get("password"))

Setting credentials on a host.

usr, err := user.Current()
n, err := netrc.Parse(filepath.Join(usr.HomeDir, ".netrc"))
n.Machine("api.heroku.com").Set("password", "newapikey")
n.Save()

go-netrc's People

Contributors

jdx avatar bigkevmcd avatar akumria avatar djgilcrease avatar mikejholly avatar

Stargazers

Tor E Hagemann avatar Colin O'Dell avatar Aproc avatar Sandalots avatar  avatar Luna avatar Matt Schreiber avatar Ryota Sakai avatar  avatar [riftlab] ErgoZ avatar Mike Art avatar Shiming Zhang avatar Nicolas Descamps avatar Eliah Rusin avatar Yashwanth Lakkaraju avatar Nick Van Rymenant avatar Jonathan Woodlief avatar Sergei Lavrentev avatar Aleksei avatar Koichi Shiraishi avatar Ben Sarah Golightly avatar tg-z avatar Matt Ma avatar Dana Woodman avatar elvuel avatar  avatar Montana Flynn avatar Alejandro Lazaro avatar Kyle 'Essobi' Stone avatar Denis Denisov avatar Ernad Halilović avatar ⌐■_■ avatar Stefan VanBuren avatar Mikhail Porokhovnichenko avatar Brandon Brown avatar Mitsutaka Mimura avatar Kyle Terry avatar Xe Iaso avatar Dan Sosedoff avatar Robert Ross avatar

Watchers

James Cloos avatar Ben Sarah Golightly avatar  avatar

go-netrc's Issues

Shell-unsafe characters in .netrc file are not escaped

Originally reported as https://github.com/gondor/docker-volume-netshare/issues/18:

If I have a password with characters such as $ or % in my .netrc file, docker-volume-netshare does not correctly provide the password to mount.cifs command. I've found that I need to backslash-escape the characters in the .netrc file so that they are safe in the mount command.

docker-volume-netshare uses netrc, and the author responded:

Do you mind filing this with the maintainer of the netrc library? If they are inactive about fixing this I will bring in something else or write our own. Let me know.

Spaces in passwords?

Does the library support spaces in passwords? I haven't figured out how to quote it properly if so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.