auth

package
v0.0.0-...-6f97a4f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: MIT Imports: 8 Imported by: 0

README

Auth Package

This Go package provides functionality to migrate permission schemas to a SpiceDB instance. It retrieves schema files (with .zed extension) embedded in the application and writes them to a SpiceDB server using the Authzed API.

Usage

This package includes the Migrations function, which retrieves permission schemas and writes them to the SpiceDB server.

err := auth.Migrations(context.Background())
if err != nil {
    log.Fatalf("Failed to migrate permissions: %v", err)
}

This function reads configurations from environment variables:

Name Description Default Value
SPICE_DB_TIMEOUT The timeout for the SpiceDB API. "5s"
SPICE_DB_COMMON_KEY The shared key for the SpiceDB API. "secret-shortlink-preshared-key"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(log logger.Logger, tracer trace.TracerProvider, monitor *monitoring.Monitoring) (*authzed.Client, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL