authdb

package
v0.0.0-...-217a8d3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package authdb contains methods to work with authdb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	rpcpb.UnimplementedAuthDBServer
}

Server implements AuthDB server.

func (*Server) CheckLegacyMembership

func (srv *Server) CheckLegacyMembership(ctx *router.Context) error

CheckLegacyMembership serves the legacy REST API GET request to check whether a given identity is a member of any of the given groups.

Example query:

"identity=user:someone@example.com&groups=group-a&groups=group-b"

Example response:

{
   "is_member": true
}

func (*Server) GetSnapshot

func (srv *Server) GetSnapshot(ctx context.Context, request *rpcpb.GetSnapshotRequest) (*rpcpb.Snapshot, error)

GetSnapshot implements the corresponding RPC method.

func (*Server) HandleLegacyAuthDBServing

func (srv *Server) HandleLegacyAuthDBServing(ctx *router.Context) error

HandleLegacyAuthDBServing handles the AuthDBSnapshot serving for legacy services. Writes the AuthDBSnapshot JSON to the router.Writer.

type SnapshotJSON

type SnapshotJSON struct {
	AuthDBRev      int64  `json:"auth_db_rev"`
	AuthDBDeflated []byte `json:"deflated_body,omitempty"`
	AuthDBSha256   string `json:"sha256"`
	CreatedTS      int64  `json:"created_ts"`
}

Jump to

Keyboard shortcuts

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