Skip to main content

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.

  • resolvergen hook will override the default generated resolver functions with the templates for CRUD operations
  • bulkgen hook creates resolvers that do bulk operations for a schema, for both bulk input and csv file upload input
  • searchgen hook 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
  • enthistory extension for generating history tables using ent. The plugin adds on to your existing entc usage 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:

  • auth subpackage for managing our Caller identity (who's making the request, and under what context), impersonation, and other helpers
  • fgax, a wrapper for the OpenFGA go-sdk and client libraries
  • entfga, an ent extension that creates relationship tuples using ent Hooks
  • providers which helps wrap 3d party social login providers
  • sessions, responsible for issuing and managing user sessions
  • tokens providing JWT token creation, signing, and validation; responsible for loading and issuing our signing keys, API token generation and validation
  • totp supports 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).