lib

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 10 Imported by: 5

README

taubyte/domain-validation

Release License Go Report Card GoDoc Discord

Used to validate ownership of DNS domains

Generate Keys

To use this package you need to generate a symetric pair for keys:

openssl ecparam -name prime256v1 -genkey -noout -out private.key
openssl ec -in private.key -pubout -out public.pem

NOTE: the private key need to be kept safe.

Maintainers

  • Samy Fodil @samyfodil
  • Tafseer Khan @tafseer-khan
  • Aron Jalbuena @arontaubyte

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Address

func Address(project *cid.Cid, fqdn string) string

func FromDNS

func FromDNS(ctx context.Context, project *cid.Cid, fqdn string, options ...Option) error

func TXTEntry

func TXTEntry(project *cid.Cid, fqdn string) string

Types

type Claims

type Claims struct {
	Address string `json:"address"` // address is hash(fqdn+projectID)
	// contains filtered or unexported fields
}

func FromToken

func FromToken(token Token, options ...Option) (*Claims, error)

func New

func New(options ...Option) (*Claims, error)

func (*Claims) Calculate

func (claims *Claims) Calculate()

func (*Claims) Sign

func (claims *Claims) Sign() (Token, error)

func (*Claims) Valid

func (claims *Claims) Valid() error

type Option

type Option func(*Claims) error

func FQDN

func FQDN(fqdn string) Option

func PrivateKey

func PrivateKey(data []byte) Option

func Project

func Project(project cid.Cid) Option

func PublicKey

func PublicKey(data []byte) Option

type Repository

type Repository struct {
	Id string `json:"id"`
}

type Resolver

type Resolver interface {
	LookupTXT(context.Context, string) ([]string, error)
}

func UseResolver

func UseResolver(r Resolver) Resolver

type Token

type Token string

func (Token) Bytes

func (t Token) Bytes() ([]byte, error)

Jump to

Keyboard shortcuts

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