{"id":16829281,"url":"https://github.com/bwmarrin/go-alone","last_synced_at":"2025-03-17T04:31:57.411Z","repository":{"id":57481576,"uuid":"61078272","full_name":"bwmarrin/go-alone","owner":"bwmarrin","description":"A simple to use, high-performance, Go (golang) MAC signer.","archived":false,"fork":false,"pushed_at":"2019-08-06T01:54:24.000Z","size":51,"stargazers_count":110,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-16T08:11:23.384Z","etag":null,"topics":["authentication","blake2b","hmac","hmac-signer","itsdangerous","jwt","mac","message-authentication-code","signing","token","token-authetication"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bwmarrin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-14T00:13:09.000Z","updated_at":"2025-03-04T18:14:27.000Z","dependencies_parsed_at":"2022-08-27T11:12:27.885Z","dependency_job_id":null,"html_url":"https://github.com/bwmarrin/go-alone","commit_stats":null,"previous_names":["bwmarrin/togoalone","bwmarrin/authtoken"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwmarrin%2Fgo-alone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwmarrin%2Fgo-alone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwmarrin%2Fgo-alone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwmarrin%2Fgo-alone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwmarrin","download_url":"https://codeload.github.com/bwmarrin/go-alone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243974395,"owners_count":20377357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","blake2b","hmac","hmac-signer","itsdangerous","jwt","mac","message-authentication-code","signing","token","token-authetication"],"created_at":"2024-10-13T11:32:17.624Z","updated_at":"2025-03-17T04:31:57.174Z","avatar_url":"https://github.com/bwmarrin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"It's dangerous to go-alone! Take this.\n==========================================\n[![GoDoc](https://godoc.org/github.com/bwmarrin/go-alone?status.svg)](https://godoc.org/github.com/bwmarrin/go-alone) [![Go report](http://goreportcard.com/badge/bwmarrin/go-alone)](http://goreportcard.com/report/bwmarrin/go-alone) [![Build Status](https://travis-ci.org/bwmarrin/go-alone.svg?branch=master)](https://travis-ci.org/bwmarrin/go-alone) [![Coverage](http://gocover.io/_badge/github.com/bwmarrin/go-alone)](https://gocover.io/github.com/bwmarrin/go-alone) [![Discord Gophers](https://img.shields.io/badge/Discord%20Gophers-%23info-blue.svg)](https://discord.gg/0f1SbxBZjYq9jLBk)\n\n\u003cimg align=\"right\" src=\"https://raw.githubusercontent.com/wiki/bwmarrin/go-alone/8bitsword.png\"\u003e\n\ngo-alone is a [Go](https://golang.org/) package that provides\n* Methods to create and verify [MAC](https://en.wikipedia.org/wiki/Message_authentication_code) signatures of data\n* Ability to add timestamps to signed tokens and use custom epoch if needed.\n* BLAKE2b signatures and Base58 time encoding provides outstanding performance and security.\n* A very simple to use API with good documentation and 100% test coverage.\n* Various helper methods for parsing tokens\n\n**For more information, please read the [wiki](https://github.com/bwmarrin/go-alone/wiki)**\n\n**For help with this package or general Go discussion, please join the [Discord \nGophers](https://discord.gg/0f1SbxBZjYq9jLBk) chat server.**\n\n**For a fast and easy to use snowflake ID library, check out [this](https://github.com/bwmarrin/snowflake)**\n\n## Getting Started\nThis assumes you already have a working Go environment, if not please see\n[this page](https://golang.org/doc/install) first.\n\n### Installing\n\n\n```sh\ngo get github.com/bwmarrin/go-alone\n```\n\n### Usage\n\nHere's a basic example below.  There is also an example program in the [example](https://github.com/bwmarrin/go-alone/tree/master/example)\nfolder that demonstrates a few more ways of using Go-Alone. You can read the API\ndocumentation on [GoDoc](https://godoc.org/github.com/bwmarrin/go-alone).\n\n```go\npackage main\n\nimport (\n\t\"github.com/bwmarrin/go-alone\"\n)\n\nfunc main() {\n\n\t// This secret is used as the hash key for the signer.\n\tvar secret = []byte(\"It's a secret to everybody\")\n\n\t// This data is what we will be signing below.\n\tvar data = []byte(\"It's dangerous to go alone! Take this.\")\n\n\t// Create a new Signer using our secret\n\ts := goalone.New(secret)\n\n\t// Sign and return a token in the form of `data.signature`\n\ttoken := s.Sign(data)\n\n\t// Unsign the token to verify it - if successful the data portion of the\n\t// token is returned.  If unsuccessful then d will be nil, and an error\n\t// is returned.\n\td, err := s.Unsign(token)\n\tif err != nil {\n\t\t// signature is not valid. Token was tampered with, forged, or maybe it's\n\t\t// not even a token at all! Either way, it's not safe to use it.\n\t} else {\n\t\t// signature is valid, it is safe to use the data\n\t\tprintln(string(d))\n\t}\n}\n```\n\n\n### Performance / Testing\n\nTo run the tests and benchmarks, use the following command.\n\n```sh\ngo test -bench=. -v\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwmarrin%2Fgo-alone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwmarrin%2Fgo-alone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwmarrin%2Fgo-alone/lists"}