Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabor-boros/go-oauth2-arangodb
ArangoDB storage for OAuth 2.0.
https://github.com/gabor-boros/go-oauth2-arangodb
golang oauth2
Last synced: 25 days ago
JSON representation
ArangoDB storage for OAuth 2.0.
- Host: GitHub
- URL: https://github.com/gabor-boros/go-oauth2-arangodb
- Owner: gabor-boros
- License: mit
- Created: 2023-02-23T14:26:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-06T08:51:35.000Z (about 1 year ago)
- Last Synced: 2024-06-20T17:52:36.640Z (5 months ago)
- Topics: golang, oauth2
- Language: Go
- Homepage:
- Size: 65.4 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# go-oauth2-arangodb
[![GoDoc](https://godoc.org/github.com/gabor-boros/go-oauth2-arangodb?status.svg)](https://godoc.org/github.com/gabor-boros/go-oauth2-arangodb)
[![Go Report Card](https://goreportcard.com/badge/github.com/gabor-boros/go-oauth2-arangodb)](https://goreportcard.com/report/github.com/gabor-boros/go-oauth2-arangodb)
[![Maintainability](https://api.codeclimate.com/v1/badges/fc29b0acda61b0ec6689/maintainability)](https://codeclimate.com/github/gabor-boros/go-oauth2-arangodb/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/fc29b0acda61b0ec6689/test_coverage)](https://codeclimate.com/github/gabor-boros/go-oauth2-arangodb/test_coverage)This package is an [ArangoDB] storage implementation for [go-oauth2] using
ArangoDB's official [go-driver].The package is following semantic versioning and is not tied to the versioning
of [go-oauth2].[ArangoDB]: https://www.arangodb.com/
[go-oauth2]: https://github.com/go-oauth2/oauth2
[go-driver]: https://github.com/arangodb/go-driver## Installation
```bash
go get github.com/gabor-boros/go-oauth2-arangodb
```## Example usage
```go
package mainimport (
"context"
"os"arangoDriver "github.com/arangodb/go-driver"
arangoHTTP "github.com/arangodb/go-driver/http""github.com/go-oauth2/oauth2/v4/manage"
arangostore "github.com/gabor-boros/go-oauth2-arangodb"
)func main() {
conn, _ := arangoHTTP.NewConnection(arangoHTTP.ConnectionConfig{
Endpoints: []string{os.Getenv("ARANGO_URL")},
})client, _ := arangoDriver.NewClient(arangoDriver.ClientConfig{
Connection: conn,
Authentication: arangoDriver.BasicAuthentication(os.Getenv("ARANGO_USER"), os.Getenv("ARANGO_PASSWORD")),
})db, _ := client.Database(context.Background(), os.Getenv("ARANGO_DB"))
clientStore, _ := arangostore.NewClientStore(
arangostore.WithClientStoreDatabase(db),
arangostore.WithClientStoreCollection("oauth2_clients"),
)tokenStore, _ := arangostore.NewTokenStore(
arangostore.WithTokenStoreDatabase(db),
arangostore.WithTokenStoreCollection("oauth2_tokens"),
)manager := manage.NewDefaultManager()
manager.MapTokenStorage(tokenStore)
manager.MapClientStorage(clientStore)// ...
}
```## Contributing
Contributions are welcome! Please open an issue or a pull request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
for details.