package core

import "github.com/cloudflare/redoctober/core"

Package core handles the main operations of the Red October server.

Copyright (c) 2013 CloudFlare, Inc.

Index

Functions

func Create

func Create(jsonIn []byte) ([]byte, error)

Create processes a create request.

func CreateUser

func CreateUser(jsonIn []byte) ([]byte, error)

CreateUser processes a create-user request.

func Decrypt

func Decrypt(jsonIn []byte) ([]byte, error)

Decrypt processes a decrypt request.

func Delegate

func Delegate(jsonIn []byte) ([]byte, error)

Delegate processes a delegation request.

func Encrypt

func Encrypt(jsonIn []byte) ([]byte, error)

Encrypt processes an encrypt request.

func Export

func Export(jsonIn []byte) ([]byte, error)

Export returns a backed up vault.

func Init

func Init(path string, config *config.Config) error

Init reads the records from disk from a given path

func Modify

func Modify(jsonIn []byte) ([]byte, error)

Modify processes a modify request.

func Order

func Order(jsonIn []byte) (out []byte, err error)

Order will request delegations from other users.

func OrderCancel

func OrderCancel(jsonIn []byte) (out []byte, err error)

OrderCancel will cancel an order given an order num

func OrderInfo

func OrderInfo(jsonIn []byte) (out []byte, err error)

OrderInfo will return a list of currently outstanding order numbers.

func OrdersOutstanding

func OrdersOutstanding(jsonIn []byte) (out []byte, err error)

OrdersOutstanding will return a list of currently outstanding orders.

func Owners

func Owners(jsonIn []byte) ([]byte, error)

Owners processes a owners request.

func Password

func Password(jsonIn []byte) ([]byte, error)

Password processes a password change request.

func Purge

func Purge(jsonIn []byte) ([]byte, error)

Purge processes a delegation purge request.

func ReEncrypt

func ReEncrypt(jsonIn []byte) ([]byte, error)

ReEncrypt processes an Re-encrypt request.

func ResetPersisted

func ResetPersisted(jsonIn []byte) (out []byte, err error)

ResetPersisted clears the persisted user data from the server. This request requires an admin.

func Restore

func Restore(jsonIn []byte) (out []byte, err error)

Restore attempts a restoration of the persistence store.

func SSHSignWith

func SSHSignWith(jsonIn []byte) ([]byte, error)

SSHSignWith signs a message with an SSH key

func Status

func Status(jsonIn []byte) (out []byte, err error)

Status returns the current delegation persistence state. In the future, this may return more data.

func Summary

func Summary(jsonIn []byte) ([]byte, error)

Summary processes a summary request.

Types

type ActiveUser

type ActiveUser struct {
	keycache.Usage
	AltNames map[string]string
	Admin    bool
	Type     string
}

type CreateRequest

type CreateRequest struct {
	Name     string
	Password string
}

type CreateUserRequest

type CreateUserRequest struct {
	Name        string
	Password    string
	UserType    string
	HipchatName string
}

type DecryptRequest

type DecryptRequest struct {
	Name     string
	Password string

	Data []byte
}

type DecryptWithDelegates

type DecryptWithDelegates struct {
	Data      []byte
	Secure    bool
	Delegates []string
}

type DelegateRequest

type DelegateRequest struct {
	Name     string
	Password string

	Uses   int
	Time   string
	Slot   string
	Users  []string
	Labels []string
}

type EncryptRequest

type EncryptRequest struct {
	Name     string
	Password string

	Minimum     int
	Owners      []string
	LeftOwners  []string
	RightOwners []string
	Predicate   string

	Data []byte

	Labels []string
	Usages []string
}

type ExportRequest

type ExportRequest struct {
	Name     string
	Password string
}

type ModifyRequest

type ModifyRequest struct {
	Name     string
	Password string

	ToModify string
	Command  string
}

type OrderCancelRequest

type OrderCancelRequest struct {
	Name     string
	Password string

	OrderNum string
}

type OrderInfoRequest

type OrderInfoRequest struct {
	Name     string
	Password string

	OrderNum string
}

type OrderOutstandingRequest

type OrderOutstandingRequest struct {
	Name     string
	Password string
}

type OrderRequest

type OrderRequest struct {
	Name          string
	Password      string
	Duration      string
	Uses          int
	Users         []string
	EncryptedData []byte
	Labels        []string
}

type OwnersData

type OwnersData struct {
	Status    string
	Owners    []string
	Labels    []string
	Predicate string
}

type OwnersRequest

type OwnersRequest struct {
	Data []byte
}

type PasswordRequest

type PasswordRequest struct {
	Name     string
	Password string

	NewPassword string
	HipchatName string
}

type PurgeRequest

type PurgeRequest struct {
	Name     string
	Password string
}

type ReEncryptRequest

type ReEncryptRequest EncryptRequest

type ResponseData

type ResponseData struct {
	Status   string
	Response []byte `json:",omitempty"`
}

type SSHSignWithRequest

type SSHSignWithRequest struct {
	Name     string
	Password string

	Data    []byte
	TBSData []byte
}

type SSHSignatureWithDelegates

type SSHSignatureWithDelegates struct {
	SignatureFormat string
	Signature       []byte
	Secure          bool
	Delegates       []string
}

type StatusData

type StatusData struct {
	Status string
}

type StatusRequest

type StatusRequest struct {
	Name     string
	Password string
}

type SummaryData

type SummaryData struct {
	Status string
	State  string
	Live   map[string]ActiveUser
	All    map[string]passvault.Summary
}

type SummaryRequest

type SummaryRequest struct {
	Name     string
	Password string
}

Source Files

core.go

Version
v0.0.0-20241112165158-ce2ad370627b (latest)
Published
Nov 12, 2024
Platform
linux/amd64
Imports
18 packages
Last checked
1 day ago

Tools for package owners.