registry

package
v0.0.0-...-c116fac Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package registry handles namespace registration in Pelican ecosystem.

  • It handles the logic to spin up a "registry" server for namespace management, including a web UI for interactive namespace registration, approval, and browsing.
  • It provides a CLI tool `./pelican namespace <command> <args>` to list, register, and delete a namespace

To register a namespace, first spin up registry server by `./pelican registry serve -p <your-port-number>`, and then use either the CLI tool or go to registry web UI at `https://localhost:<your-port-number>/view/`, and follow instructions for next steps.

Index

Constants

View Source
const (
	String   registrationFieldType = "string"
	Int      registrationFieldType = "int"
	Boolean  registrationFieldType = "bool"
	Enum     registrationFieldType = "enum"
	DateTime registrationFieldType = "datetime"
)

Variables

View Source
var OIDC struct {
	ClientID           string
	ClientSecret       string
	Scope              string
	DeviceAuthEndpoint string
	TokenEndpoint      string
	UserInfoEndpoint   string
	GrantType          string
}

Functions

func AddNamespace

func AddNamespace(ns *server_structs.Namespace) error

func GetTopoPrefixString

func GetTopoPrefixString(topoNss []Topology) (result string)

func InitCustomRegistrationFields

func InitCustomRegistrationFields() error

Initialize custom registration fields provided via Registry.CustomRegistrationFields

func InitInstConfig

func InitInstConfig(ctx context.Context, egrp *errgroup.Group) error

Initialize institutions list

func InitOptionsCache

func InitOptionsCache(ctx context.Context, egrp *errgroup.Group)

func InitializeDB

func InitializeDB(ctx context.Context) error

func MigrateDB

func MigrateDB(sqldb *sql.DB) error

Update database schema based on migration files under /migrations folder

func NamespaceDelete

func NamespaceDelete(endpoint string, prefix string) error

func NamespaceGet

func NamespaceGet(endpoint string) error

func NamespaceList

func NamespaceList(endpoint string) error

func NamespaceRegister

func NamespaceRegister(privateKey jwk.Key, namespaceRegistryEndpoint string, accessToken string, prefix string) error

func NamespaceRegisterWithIdentity

func NamespaceRegisterWithIdentity(privateKey jwk.Key, namespaceRegistryEndpoint string, prefix string) error

func PeriodicTopologyReload

func PeriodicTopologyReload()

func PopulateTopology

func PopulateTopology() error

Create a table in the registry to store namespace prefixes from topology

func RegisterRegistryAPI

func RegisterRegistryAPI(router *gin.RouterGroup)

func RegisterRegistryWebAPI

func RegisterRegistryWebAPI(router *gin.RouterGroup) error

Define Gin APIs for registry Web UI. All endpoints are user-facing

func ShutdownDB

func ShutdownDB() error

Types

type NamespaceConfig

type NamespaceConfig struct {
	JwksUri string `json:"jwks_uri"`
}

Various auxiliary functions used for client-server security handshakes

type NamespaceWOPubkey

type NamespaceWOPubkey struct {
	ID            int                          `json:"id"`
	Prefix        string                       `json:"prefix"`
	Pubkey        string                       `json:"-"` // Don't include pubkey in this case
	Identity      string                       `json:"identity"`
	AdminMetadata server_structs.AdminMetadata `json:"admin_metadata"`
}

type Response

type Response struct {
	VerificationURLComplete string `json:"verification_uri_complete"`
	DeviceCode              string `json:"device_code"`
}

type ServerType

type ServerType string
const (
	OriginType ServerType = "origin"
	CacheType  ServerType = "cache"
)

func (ServerType) String

func (st ServerType) String() string

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	Error       string `json:"error"`
}

type Topology

type Topology struct {
	ID     int    `json:"id" gorm:"primaryKey;autoIncrement"`
	Prefix string `json:"prefix" gorm:"unique;not null"`
}

func (Topology) TableName

func (Topology) TableName() string

Jump to

Keyboard shortcuts

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