schema

package
v0.0.0-...-4d10510 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgeKey

type AgeKey struct {
	ent.Schema
}

AgeKey holds the schema definition for the AgeKey entity.

func (AgeKey) Edges

func (AgeKey) Edges() []ent.Edge

Edges of the AgeKey.

func (AgeKey) Fields

func (AgeKey) Fields() []ent.Field

Fields of the AgeKey.

type Data

type Data struct {
	Usernames *DataUsernames
	Emails    *DataEmails
	Hashes    *DataHashes
	Passwords *DataPasswords
}

type DataEmails

type DataEmails []string

type DataHashes

type DataHashes []string

type DataPasswords

type DataPasswords []string

type DataUsernames

type DataUsernames []string

type HIBP

type HIBP struct {
	ent.Schema
}

HIBP holds the schema definition for the HIBP entity.

func (HIBP) Edges

func (HIBP) Edges() []ent.Edge

Edges of the HIBP.

func (HIBP) Fields

func (HIBP) Fields() []ent.Field

Fields of the HIBP that model the HIBP API v3, ref: https://haveibeenpwned.com/API/v3.

type HIBPSchema

type HIBPSchema struct {
	// A Pascal-cased name representing the breach which is unique across all other breaches. This value never changes and may be used to name dependent assets (such as images) but should not be shown directly to end users (see the "Title" attribute instead).
	Name string `json:"Name" validate:"required,Name"`
	// A Pascal-cased name representing the breach which is unique across all other breaches. This value never changes and may be used to name dependent assets (such as images) but should not be shown directly to end users (see the "Title" attribute instead).
	Title string `json:"Title"`
	// The domain of the primary website the breach occurred on. This may be used for identifying other assets external systems may have for the site.
	Domain string `json:"Domain"`
	// The date (with no time) the breach originally occurred on in ISO 8601 format. This is not always accurate — frequently breaches are discovered and reported long after the original incident. Use this attribute as a guide only.
	// YY-MM-DD -> marshal to string, convert to proper time later.
	BreachDate string `json:"BreachDate"`
	// The date and time (precision to the minute) the breach was added to the system in ISO 8601 format.
	AddedDate time.Time `json:"AddedDate"`
	// The date and time (precision to the minute) the breach was modified in ISO 8601 format. This will only differ from the AddedDate attribute if other attributes represented here are changed or data in the breach itself is changed (i.e. additional data is identified and loaded). It is always either equal to or greater then the AddedDate attribute, never less than.
	ModifiedDate time.Time `json:"ModifiedDate"`
	// The total number of accounts loaded into the system. This is usually less than the total number reported by the media due to duplication or other data integrity issues in the source data.
	PwnCount int `json:"PwnCount"`
	// Contains an overview of the breach represented in HTML markup. The description may include markup such as emphasis and strong tags as well as hyperlinks.
	Description string `json:"Description"`
	// This attribute describes the nature of the data compromised in the breach and contains an alphabetically ordered string array of impacted data classes.
	DataClasses []string `json:"DataClasses"`
	// Indicates that the breach is considered unverified. An unverified breach may not have been hacked from the indicated website. An unverified breach is still loaded into HIBP when there's sufficient confidence that a significant portion of the data is legitimate.
	IsVerified bool `json:"IsVerified"`
	// Indicates that the breach is considered fabricated. A fabricated breach is unlikely to have been hacked from the indicated website and usually contains a large amount of manufactured data. However, it still contains legitimate email addresses and asserts that the account owners were compromised in the alleged breach.
	IsFabricated bool `json:"IsFabricated"`
	// Indicates if the breach is considered sensitive. The public API will not return any accounts for a breach flagged as sensitive.
	IsSensitive bool `json:"IsSensitive"`
	// Indicates if the breach has been retired. This data has been permanently removed and will not be returned by the API.
	IsRetired bool `json:"IsRetired"`
	// Indicates if the breach is considered a spam list. This flag has no impact on any other attributes but it means that the data has not come as a result of a security compromise.
	IsSpamList bool `json:"IsSpamList"`
	// Indicates if the breach is sourced from malware. This flag has no impact on any other attributes, it merely flags that the data was sourced from a malware campaign rather than a security compromise of an online service.
	IsMalware bool `json:"IsMalware"`
	// A URI that specifies where a logo for the breached service can be found. Logos are always in PNG format.
	LogoPath string `json:"LogoPath"`
}

HIBPSchema is modeled after the HIBP model (ref: https://haveibeenpwned.com/API/v3#BreachModel).

type ImportSchema

type ImportSchema struct {
	Name              string    `yaml:"name" validate:"required,name"`
	Description       string    `yaml:"description"`
	CreatedAt         time.Time `yaml:"createdAt"`
	Date              time.Time `yaml:"time"`
	IsVerified        bool      `yaml:"isVerified"`
	ContainsUsernames bool      `yaml:"containsUsernames"`
	ContainsEmails    bool      `yaml:"containsEmails"`
	ContainsPasswords bool      `yaml:"containsPasswds"`
	ContainsHashes    bool      `yaml:"containsHashes"`
	HashType          string    `yaml:"hashType"`
	HashSalted        bool      `yaml:"hashSalted"`
	HashPeppered      bool      `yaml:"hashPeppered"`
	Data              Data      `yaml:"data"`
}

ImportSchema is the LocalBreach model.

type LocalBreach

type LocalBreach struct {
	ent.Schema
}

LocalBreach holds the schema definition for the LocalBreach entity.

func (LocalBreach) Edges

func (LocalBreach) Edges() []ent.Edge

Edges of the LocalBreach.

func (LocalBreach) Fields

func (LocalBreach) Fields() []ent.Field

Fields of the LocalBreach.

type SearchQuery

type SearchQuery struct {
	ent.Schema
}

SearchQuery holds the schema definition for the SearchQuery entity.

func (SearchQuery) Edges

func (SearchQuery) Edges() []ent.Edge

Edges of the SearchQuery.

func (SearchQuery) Fields

func (SearchQuery) Fields() []ent.Field

Fields of the SearchQuery.

type Settings

type Settings struct {
	ent.Schema
}

Settings holds the schema definition for the Settings entity.

func (Settings) Edges

func (Settings) Edges() []ent.Edge

Edges of the Settings.

func (Settings) Fields

func (Settings) Fields() []ent.Field

Fields of the Settings.

type Setup

type Setup struct {
	ent.Schema
}

Setup holds the schema definition for the Setup entity.

func (Setup) Edges

func (Setup) Edges() []ent.Edge

Edges of the Setup.

func (Setup) Fields

func (Setup) Fields() []ent.Field

Fields of the Setup.

type TrackedBreaches

type TrackedBreaches struct {
	ent.Schema
}

TrackedBreaches holds the schema definition for the TrackedBreaches entity.

func (TrackedBreaches) Edges

func (TrackedBreaches) Edges() []ent.Edge

Edges of the TrackedBreaches.

func (TrackedBreaches) Fields

func (TrackedBreaches) Fields() []ent.Field

Fields of the TrackedBreaches.

type User

type User struct {
	ent.Schema
}

User holds the schema definition for the User entity.

func (User) Edges

func (User) Edges() []ent.Edge

Edges of the User.

func (User) Fields

func (User) Fields() []ent.Field

Fields of the User.

Jump to

Keyboard shortcuts

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