aliases

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package aliases implements the validation and signing features of https://ssb-ngi-pointer.github.io/rooms2/#alias

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValid

func IsValid(alias string) bool

IsValid decides whether an alias is okay for use or not. The room spec defines it as _labels valid under RFC 1035_ ( https://ssb-ngi-pointer.github.io/rooms2/#alias-string ) but that can be mostly any string since DNS is a 8bit binary protocol, as long as it's shorter then 63 charachters.

Right now it's pretty basic set of characters (a-z, 0-9). In theory we could be more liberal but there is a bunch of stuff to figure out, like homograph attacks (https://en.wikipedia.org/wiki/IDN_homograph_attack), if we would decide to allow full utf8 unicode.

Types

type Confirmation

type Confirmation struct {
	Registration

	Signature []byte
}

Confirmation combines a registration with the corresponding signature

func (Confirmation) Verify

func (c Confirmation) Verify() bool

Verify checks that the confirmation is for the expected room and from the expected feed

type Registration

type Registration struct {
	Alias  string
	UserID refs.FeedRef
	RoomID refs.FeedRef
}

Registration ties an alias to the ID of the user and the RoomID it should be registered on

func (Registration) Sign

func (r Registration) Sign(privKey ed25519.PrivateKey) Confirmation

Sign takes the public key (belonging to UserID) and returns the signed confirmation

Jump to

Keyboard shortcuts

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