almanack
dex
almanack | dex | |
---|---|---|
11 | 37 | |
22 | 9,145 | |
- | 1.3% | |
9.0 | 9.5 | |
2 days ago | 3 days ago | |
Go | Go | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
almanack
-
I think I'm going crazy refactoring my web app
You need to add the base template to the ParseFS call. The code here is more complicated than it needs to be. You don’t need to go through the FS yourself. The template parser can do that for you. Look at this example which doesn’t use a base template but could: https://github.com/spotlightpa/almanack/blob/master/layouts/layouts.go You would just change it to
-
Passing sql transactions when not needed
For me, GetBooks is a method on a query object and a query object has a DBTX interface struct field. So if I don’t need a transaction, I just use the normal DB as the DBTX but if I do, I call a method to open a TX first and use that. https://github.com/spotlightpa/almanack/blob/master/internal/db/db.go
- Is there a good example of an open source non-trivial (DB connection, authentication, authorization, data validation, tests, etc...) Go API?
-
ORM or no ORM (and which ones)?
Pagination is just an offset and a limit. There’s another package that handles the math for you: https://github.com/spotlightpa/almanack/blob/master/internal/paginate/paginate.go
- Help with lazy loading routes in Vue Router 3 with Vite
-
sqlc patterns in production
You can have methods on the SQLC structs. They just need to be in a separate file. See https://github.com/spotlightpa/almanack/blob/master/internal/db/page.go eg.
-
How are YOU using generics so far?
So far, just refactoring. I made a concurrency manager to simplify some stuff, and unified some pagination code. It’s like we said before generics: there are places you miss it, but not having it was never a total blocker. I think going working the x/slices x/maps packages will be the biggest time savers.
-
The HTML Data List Element
I ended up shipping this as a similar autocomplete field: https://github.com/spotlightpa/almanack/blob/master/src/comp...
It's a little different because I put the chosen selections on a row above the input row, but the principle is the same.
-
Testing a method which requires an API Key
https://github.com/spotlightpa/almanack/blob/master/internal/herokuapi/herokuapi_test.go#L14:L21
-
How to avoid duplicate code in gorilla/mux middleware
I’m using Chi not Gorilla, but you can see my JWT Auth middleware here: https://github.com/spotlightpa/almanack/blob/master/pkg/api/routes.go#L37
dex
-
Navigating Identity Authentication: From LDAP to Modern Protocols
Dex: https://dexidp.io
-
Keycloak SSO with Docker Compose and Nginx
Recently I looked into having a relatively simple SSO setup for my homelab. My main objective is that I could easily login with Google or GitHub auth. At my previous job I used both JetBrains Hub [1] and Keycloak but I found both of them a bit of a PITA to setup.
JetBrains Hub was really, really easy to get going. As was my previous experience with them. The only thing that annoyed me was the lack of a latest tag on their Docker registry. Don't get me wrong, pinned versions are great, but for my personal use I mostly just want to update all my Docker containers in one go.
On the other hand I found Keycloak very cumbersome to get going. It was pretty easy in dev mode, but I stumbled to get it going in production. AFAIK it had something to do with the wildcard Let's Encrypt cert that I tried to use. But after a couple of hours, I just gave up.
I finally went with Dex [2]. I had previously put it off because of the lack of documentation, but in the end it was extremely easy to setup. It just required some basic YAML, a SQLite database and a (sub)domain. I combined Dex with the excellent OAuth2 Proxy and a custom Nginx (Proxy Manager) template for an easy two line SSO configuration on all of my internal services.
In addition to this setup, I also added Cloudflare Access and WAF outside of my home to add some security. I only want to add some CrowdSec to get a little more insights.
1. https://www.jetbrains.com/hub/
2. https://dexidp.io/
3. https://github.com/oauth2-proxy/oauth2-proxy
3. https://github.com/alex3305/unraid-docker-templates
-
Sign in with GitHub in Go
Another great option is to use https://github.com/dexidp/dex in an authentication setup. In your app, you federate the authentication to dex using OAuth2. Dex then has a pluggable architecture with built-in connectors for many established identity providers using a variety of protocols: Among others OAuth2, SAML 2 but also GitHub, Google, Gitea and so forth.
- Show HN: Obligator – An OpenID Connect server for self-hosters
-
I made a small program that makes it easier to run commands inside containers
dex is well-known: https://github.com/dexidp/dex
-
Keycloak – Open-Source Identity and Access Management Interview
We used keycloak for openid identity provider as well. It is fine to setup keycloak once. But it is painful share the setup with other engineers.
For local development, we end up using dex (https://dexidp.io). When we need support group/role, we use dex and glauth(https://glauth.github.io). Both dex and glauth can be configured with yaml files. We just created a few yaml files and a docker compose file, every engineer can be brought up the whole environment in a few seconds.
Also https://www.authelia.com and https://github.com/goauthentik/authentik look pretty promising, if you need more advanced features from them.
-
dex VS boruta-server - a user suggested alternative
2 projects | 22 May 2023
-
Have you convinced anyone to use Nix or NixOS? Friends? Coworkers?
I added it as an available option (flake) in Dex: https://github.com/dexidp/dex
- Okta Access Gateway Alternatives
- Is there a good example of an open source non-trivial (DB connection, authentication, authorization, data validation, tests, etc...) Go API?
What are some alternatives?
bun - SQL-first Golang ORM
Keycloak - Open Source Identity and Access Management For Modern Applications and Services
tinykv - tiny in-memory single-app kv (cache) with explicit and sliding expiration
authelia - The Single Sign-On Multi-Factor portal for web apps
Listmonk - High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
Ory Hydra - OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Works with Hardware Security Modules. Compatible with MITREid.
Grafana - The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
OpenUnison - Unified Identity Management
jet - Type safe SQL builder with code generation and automatic query result data mapping
oauth2-proxy - A reverse proxy that provides authentication with Google, Azure, OpenID Connect and many more identity providers.
myapp - 🚀 How to build a Dockerized RESTful API application using Go.
caddy-auth-portal - Authentication Plugin for Caddy v2 implementing Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication. MFA with App Authenticators and Yubico.