registry

package
v0.0.0-...-d2864de Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 39 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() error

func LaunchRegistryMetrics

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

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, siteName string) error

func NamespaceRegisterWithIdentity

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

func PeriodicTopologyReload

func PeriodicTopologyReload(ctx context.Context)

func PopulateTopology

func PopulateTopology(ctx context.Context) 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 ShutdownRegistryDB

func ShutdownRegistryDB() 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 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