All Projects → zalando → Go Keyring

zalando / Go Keyring

Licence: mit
Cross-platform keyring interface for Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Keyring

Office Js Helpers
[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
Stars: ✭ 111 (-68.38%)
Mutual labels:  utilities, authentication
Bigquery Utils
Useful scripts, udfs, views, and other utilities for migration and data warehouse operations in BigQuery.
Stars: ✭ 338 (-3.7%)
Mutual labels:  utilities
Flask Appbuilder
Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
Stars: ✭ 3,603 (+926.5%)
Mutual labels:  authentication
Express Stormpath
Build simple, secure web applications with Stormpath and Express!
Stars: ✭ 327 (-6.84%)
Mutual labels:  authentication
Microsoft Identity Web
Helps creating protected web apps and web APIs with Microsoft identity platform and Azure AD B2C
Stars: ✭ 321 (-8.55%)
Mutual labels:  authentication
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (-4.27%)
Mutual labels:  authentication
T Vault
Simplified secrets management solution
Stars: ✭ 316 (-9.97%)
Mutual labels:  secret
Firebase Admin Java
Firebase Admin Java SDK
Stars: ✭ 345 (-1.71%)
Mutual labels:  authentication
Omniauth Identity
A simple login and password strategy for OmniAuth.
Stars: ✭ 339 (-3.42%)
Mutual labels:  authentication
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+5778.06%)
Mutual labels:  utilities
React Aad
A React wrapper for Azure AD using the Microsoft Authentication Library (MSAL). The easiest way to integrate AzureAD with your React for authentication.
Stars: ✭ 324 (-7.69%)
Mutual labels:  authentication
Django Oidc Provider
OpenID Connect and OAuth2 provider implementation for Djangonauts.
Stars: ✭ 320 (-8.83%)
Mutual labels:  authentication
Pode
Pode is a Cross-Platform PowerShell web framework for creating REST APIs, Web Sites, and TCP/SMTP servers
Stars: ✭ 329 (-6.27%)
Mutual labels:  authentication
React Router Util
Useful components and utilities for working with React Router
Stars: ✭ 320 (-8.83%)
Mutual labels:  utilities
Go Grpc Middleware
Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.
Stars: ✭ 4,170 (+1088.03%)
Mutual labels:  authentication
Grant
OAuth Proxy
Stars: ✭ 3,509 (+899.72%)
Mutual labels:  authentication
Stegano
A pure Python steganography module.
Stars: ✭ 324 (-7.69%)
Mutual labels:  secret
Simpleauth
Simple authentication for Python on Google App Engine supporting OAuth 2.0, OAuth 1.0(a) and OpenID
Stars: ✭ 331 (-5.7%)
Mutual labels:  authentication
Shinobi
👺 Simple and light-weight role-based permissions system for Laravel's built in Auth system.
Stars: ✭ 349 (-0.57%)
Mutual labels:  authentication
Restspringmvcdemo
RestSpringMVCDemo项目是一个基于Spring的符合REST风格的项目,具有MVC分层结构并实现前后端分离。该项目体现了一个具有REST风格项目的基本特征,即具有统一响应结构、 前后台数据流转机制(HTTP消息与Java对象的互相转化机制)、统一的异常处理机制、参数验证机制、Cors跨域请求机制以及鉴权机制。
Stars: ✭ 342 (-2.56%)
Mutual labels:  authentication

Go Keyring library

Build Status Build status Go Report Card GoDoc

go-keyring is an OS-agnostic library for setting, getting and deleting secrets from the system keyring. It supports OS X, Linux (dbus) and Windows.

go-keyring was created after its authors searched for, but couldn't find, a better alternative. It aims to simplify using statically linked binaries, which is cumbersome when relying on C bindings (as other keyring libraries do).

Potential Uses

If you're working with an application that needs to store user credentials locally on the user's machine, go-keyring might come in handy. For instance, if you are writing a CLI for an API that requires a username and password, you can store this information in the keyring instead of having the user type it on every invocation.

Dependencies

OS X

The OS X implementation depends on the /usr/bin/security binary for interfacing with the OS X keychain. It should be available by default.

Linux

The Linux implementation depends on the Secret Service dbus interface, which is provided by GNOME Keyring.

It's expected that the default collection login exists in the keyring, because it's the default in most distros. If it doesn't exist, you can create it through the keyring frontend program Seahorse:

  • Open seahorse
  • Go to File > New > Password Keyring
  • Click Continue
  • When asked for a name, use: login

Example Usage

How to set and get a secret from the keyring:

package main

import (
    "log"

    "github.com/zalando/go-keyring"
)

func main() {
    service := "my-app"
    user := "anon"
    password := "secret"

    // set password
    err := keyring.Set(service, user, password)
    if err != nil {
        log.Fatal(err)
    }

    // get password
    secret, err := keyring.Get(service, user)
    if err != nil {
        log.Fatal(err)
    }

    log.Println(secret)
}

Tests

Running tests

Running the tests is simple:

go test

Which OS you use does matter. If you're using Linux, it will test the implementation in keyring_linux.go. If running the tests on OS X, it will test the implementation in keyring_darwin.go.

Mocking

If you need to mock the keyring behavior for testing on systems without a keyring implementation you can call MockInit() which will replace the OS defined provider with an in-memory one.

package implementation

import (
    "testing"

    "github.com/zalando/go-keyring"
)

func TestMockedSetGet(t *testing.T) {
    keyring.MockInit()
    err := keyring.Set("service", "user", "password")
    if err != nil {
        t.Fatal(err)
    }

    p, err := keyring.Get("service", "user")
    if err != nil {
        t.Fatal(err)
    }

    if p != "password" {
        t.Error("password was not the expected string")
    }

}

Contributing/TODO

We welcome contributions from the community; please use CONTRIBUTING.md as your guidelines for getting started. Here are some items that we'd love help with:

  • The code base
  • Better test coverage

Please use GitHub issues as the starting point for contributions, new ideas and/or bug reports.

Contact

Contributors

Thanks to:

  • [your name here]

License

See LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].