Documentation ¶
Index ¶
- Variables
- type Service
- func (s *Service) AddCT(ctx context.Context, userContext am.UserContext, etld string, ...) error
- func (s *Service) AddCTSubdomains(ctx context.Context, userContext am.UserContext, etld string, ...) error
- func (s *Service) DeleteCT(ctx context.Context, userContext am.UserContext, etld string) error
- func (s *Service) DeleteCTSubdomains(ctx context.Context, userContext am.UserContext, etld string) error
- func (s *Service) GetCT(ctx context.Context, userContext am.UserContext, etld string) (time.Time, map[string]*am.CTRecord, error)
- func (s *Service) GetCTSubdomains(ctx context.Context, userContext am.UserContext, etld string) (time.Time, map[string]*am.CTSubdomain, error)
- func (s *Service) GetETLDs(ctx context.Context, userContext am.UserContext) ([]*am.CTETLD, error)
- func (s *Service) Init(config []byte) error
- func (s *Service) IsAuthorized(ctx context.Context, userContext am.UserContext, resource, action string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoCTRecords = errors.New("no ct records found") ErrETLDInvalid = errors.New("etld was empty or did not match") ErrCopyCount = errors.New("count of records copied did not match expected") ErrEmptyCommonName = errors.New("common name was empty") )
View Source
var ( // Subdomain table data AddCTSubDomainTempTableKey = "cert_subdomain_temp" AddCTSubDomainTempTableColumns = []string{"inserted_timestamp", "etld_id", "common_name"} AddCTSubDomainTempTable = `` /* 142-byte string literal not displayed */ AddTempSubDomainToCTSubDomain = `` /* 233-byte string literal not displayed */ // Full CT data AddCTTempTableKey = "cert_add_temp" AddCTTempTableColumns = []string{"inserted_timestamp", "server_name", "server_index", "etld", "cert_hash", "serial_number", "not_before", "not_after", "country", "organization", "organizational_unit", "common_name", "verified_dns_names", "unverified_dns_names", "ip_addresses", "email_addresses"} AddCTTempTable = `` /* 514-byte string literal not displayed */ AddTempToCT = fmt.Sprintf(`insert into am.certificates as cert ( %s ) select temp.inserted_timestamp, temp.server_name, temp.server_index, temp.etld, temp.cert_hash, temp.serial_number, temp.not_before, temp.not_after, temp.country, temp.organization, temp.organizational_unit, temp.common_name, temp.verified_dns_names, temp.unverified_dns_names, temp.ip_addresses, temp.email_addresses from cert_add_temp as temp on conflict do nothing`, commonColumns) )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service for interfacing with postgresql/rds
func (*Service) AddCT ¶
func (s *Service) AddCT(ctx context.Context, userContext am.UserContext, etld string, queryTime time.Time, ctRecords map[string]*am.CTRecord) error
AddCT adds certificate transparency records
func (*Service) AddCTSubdomains ¶
func (s *Service) AddCTSubdomains(ctx context.Context, userContext am.UserContext, etld string, queryTime time.Time, subdomains map[string]*am.CTSubdomain) error
AddCTSubdomains adds cert transparency subdomains to our database for the specified etld. Also creates an entry for the queryTime of this particular ETLD so we don't have to scan the entire cert transparency db every time.
func (*Service) DeleteCTSubdomains ¶
func (s *Service) DeleteCTSubdomains(ctx context.Context, userContext am.UserContext, etld string) error
DeleteCTSubdomains (only really used in tests)
func (*Service) GetCT ¶
func (s *Service) GetCT(ctx context.Context, userContext am.UserContext, etld string) (time.Time, map[string]*am.CTRecord, error)
GetCT returns locally cached certificate transparency records that match the etld.
func (*Service) GetCTSubdomains ¶
func (s *Service) GetCTSubdomains(ctx context.Context, userContext am.UserContext, etld string) (time.Time, map[string]*am.CTSubdomain, error)
GetCTSubdomains returns subdomains extracted from certificate transparency's common name field of certificates for the specified etld.
func (*Service) IsAuthorized ¶
func (s *Service) IsAuthorized(ctx context.Context, userContext am.UserContext, resource, action string) bool
IsAuthorized checks if an action is allowed by a particular user
Click to show internal directories.
Click to hide internal directories.