Helper Repositories
The core service depends on shared libraries that we maintain in their own repositories. Knowing which library owns which behavior tells you where to look when you are tracing code that lives outside the core repo.
riverboat
riverboat is the job queue used in Openlane based on the riverqueue project.
gqlgen-plugins
gqlgen-plugins provides a way to hook into the gqlgen code generation lifecycle. This repo contains several hooks that are used within the core repo gqlgen generation process.
resolvergenhook will override the default generated resolver functions with the templates for CRUD operationsbulkgenhook creates resolvers that do bulk operations for a schema, for both bulk input and csv file upload inputsearchgenhook creates search resolvers to search on fields within the ent schema. Fields in the schema that should be searchable by non-admins should include the annotation
entx
entx is a helper package for working with ent, which includes the following high-level utilities:
- mixins used for assigning a different ID type than the one generated by
ent(we use ULIDs), some default columns (created_at,created_by) - Soft-delete extension with cascade delete functionality added in
enthistoryextension for generating history tables using ent. The plugin adds on to your existingentcusage and enumerates over your current schemas to create new "history" schemas containing an inventory of the changes related to the existing tables.
iam
iam is our main authentication + authorization library; it has several subparts, including:
authsubpackage for managing ourCalleridentity (who's making the request, and under what context), impersonation, and other helpersfgax, a wrapper for the OpenFGA go-sdk and client librariesentfga, an ent extension that creates relationship tuples using ent Hooksproviderswhich helps wrap 3d party social login providerssessions, responsible for issuing and managing user sessionstokensproviding JWT token creation, signing, and validation; responsible for loading and issuing our signing keys, API token generation and validationtotpsupports generating QR code images and code validation
httpsling
httpsling library simplifies the way you make HTTP requests. It's intended to provide an easy-to-use interface for sending requests and handling responses, reducing the boilerplate code typically associated with the net/http package.
newman
newman is a package that allows you to send emails using different email providers. We use the Resend provider actively within Openlane projects.
utils
utils collects small shared libraries used across Openlane services, including ULID generation (ulids), password hashing and verification (passwd), and typed context key/value helpers (contextx).