metact

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 10 Imported by: 1

README

meta-ct

Go Go Reference

This is a library to monitor CT(Certificate Transparency) monitor library via Meta's service.

This library supports:

To use this library, you must create a Meta App and then obtain the App Id and Access Token.

Documentation

Index

Constants

View Source
const (
	SUBSCRIBED_DOMAINS_API = API_BASE + "/%v/subscribed_domains"
	CERTFICATES_API        = API_BASE + "/certificates"
)
View Source
const API_BASE = "https://graph.facebook.com"

Variables

View Source
var ALL_CERTIFICATE_FIELDS = []string{
	"authority_key_identifier",
	"basic_constraints",
	"cert_hash_md5",
	"cert_hash_sha1",
	"cert_hash_sha256",
	"certificate_pem",
	"domains",
	"extended_key_usage",
	"extensions",
	"issuer_name",
	"key_usage",
	"not_valid_after",
	"not_valid_before",
	"public_key_algorithm",
	"public_key_hash_sha256",
	"public_key_pem",
	"public_key_size",
	"public_key_values",
	"serial_number",
	"signature_algorithm",
	"signature_value",
	"subject_key_identifier",
	"subject_name",
	"version",
}

Functions

func ChallengeAPIFlow added in v0.0.6

func ChallengeAPIFlow(c echo.Context) error

Types

type Certificates added in v0.0.4

type Certificates struct {
	Data   []MetaCert `json:"data"`
	Paging `json:"paging"`
}

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type MetaCT

type MetaCT struct {
	AppId       string
	AccessToken string
}

func NewCT

func NewCT(appId string, accessToken string) *MetaCT

func (*MetaCT) Certificates

func (ct *MetaCT) Certificates(query string, fields []string) (*Certificates, error)

func (*MetaCT) Subscribe

func (ct *MetaCT) Subscribe(domain string) error

func (*MetaCT) SubscribeList

func (ct *MetaCT) SubscribeList() (*SubscribeList, error)

func (*MetaCT) Unsubscribe

func (ct *MetaCT) Unsubscribe(domain string) error

func (*MetaCT) WebHookCertificates added in v0.0.2

func (ct *MetaCT) WebHookCertificates(c echo.Context) ([]MetaCert, error)

type MetaCert added in v0.0.4

type MetaCert struct {
	CertificatePem string `json:"certificate_pem,omitempty"`
}

func (*MetaCert) Certificate added in v0.0.4

func (c *MetaCert) Certificate() (*x509.Certificate, error)

type Notification added in v0.0.2

type Notification struct {
	Entry []struct {
		ID      string `json:"id"`
		Time    int    `json:"time"`
		Changes []struct {
			Field string   `json:"field"`
			Value MetaCert `json:"value"`
		} `json:"changes"`
	} `json:"entry"`
	Object string `json:"object"`
}

type Paging

type Paging struct {
	Cursors struct {
		Before string `json:"before"`
		After  string `json:"after"`
	} `json:"causers"`
}

type Subscribe added in v0.0.4

type Subscribe struct {
	Success bool `json:"success"`
}

type SubscribeList added in v0.0.4

type SubscribeList struct {
	Data []struct {
		Id     string `json:"id"`
		Domain string `json:"domain"`
	} `json:"data"`
	Paging `json:"paging"`
}

Directories

Path Synopsis
example module

Jump to

Keyboard shortcuts

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