apitypes

package
v0.0.0-...-27ca0bd Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const UserRoleAdmin = "admin"
View Source
const UserRoleServiceAccount = "service_account"
View Source
const UserRoleStandard = "standard"

Variables

View Source
var UserSignupRoles = []string{UserRoleStandard, UserRoleAdmin}

Functions

This section is empty.

Types

type AccountChangePasswordRequestDTO

type AccountChangePasswordRequestDTO struct {
	NewPassword     string `json:"new_password" validate:"required,min=16,max=128"`
	CurrentPassword string `json:"current_password" validate:"required"`
}

type AdminAgentCreateRequestDTO

type AdminAgentCreateRequestDTO struct {
	Name string `json:"name" validate:"required,min=4,max=64,username"`
}

type AdminAgentCreateResponseDTO

type AdminAgentCreateResponseDTO struct {
	Name string `json:"name"`
	ID   string `json:"id"`
	Key  string `json:"key"`
}

type AdminAgentSetMaintanceRequestDTO

type AdminAgentSetMaintanceRequestDTO struct {
	IsMaintenanceMode bool `json:"is_maintenance_mode"`
}

type AdminConfigRequestDTO

type AdminConfigRequestDTO struct {
	Auth    *AuthConfigDTO    `json:"auth"`
	Agent   *AgentConfigDTO   `json:"agent"`
	General *GeneralConfigDTO `json:"general"`
}

type AdminConfigResponseDTO

type AdminConfigResponseDTO struct {
	Auth    AuthConfigDTO    `json:"auth"`
	Agent   AgentConfigDTO   `json:"agent"`
	General GeneralConfigDTO `json:"general"`
}

type AdminGetAllUsersResponseDTO

type AdminGetAllUsersResponseDTO struct {
	Users []UserDTO `json:"users"`
}

type AdminServiceAccountCreateRequestDTO

type AdminServiceAccountCreateRequestDTO struct {
	Username string   `json:"username" validate:"required,min=4,max=64,username"`
	Roles    []string `json:"roles" validate:"required,userroles"`
}

type AdminServiceAccountCreateResponseDTO

type AdminServiceAccountCreateResponseDTO struct {
	Username string   `json:"username"`
	ID       string   `json:"id"`
	Roles    []string `json:"roles"`
	APIKey   string   `json:"api_key"`
}

type AdminUserCreateRequestDTO

type AdminUserCreateRequestDTO struct {
	Username    string   `json:"username" validate:"required,min=4,max=64,username"`
	Password    string   `json:"password" validate:"max=128"`
	GenPassword bool     `json:"gen_password"`
	Roles       []string `json:"roles" validate:"required,userroles"`
}

type AdminUserCreateResponseDTO

type AdminUserCreateResponseDTO struct {
	Username          string   `json:"username"`
	ID                string   `json:"id"`
	Roles             []string `json:"roles"`
	GeneratedPassword string   `json:"generated_password"`
}

type AgentConfigDTO

type AgentConfigDTO struct {
	AutomaticallySyncListfiles bool `json:"auto_sync_listfiles"`
	SplitJobsPerAgent          int  `json:"split_jobs_per_agent"`
}

type AgentDTO

type AgentDTO struct {
	ID                string                             `json:"id"`
	Name              string                             `json:"name"`
	IsMaintenanceMode bool                               `json:"is_maintenance_mode"`
	AgentInfo         AgentInfoDTO                       `json:"agent_info"`
	AgentDevices      []hashcattypes.HashcatStatusDevice `json:"agent_devices"`
}

type AgentFileDTO

type AgentFileDTO struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
}

type AgentGetAllResponseDTO

type AgentGetAllResponseDTO struct {
	Agents []AgentDTO `json:"agents"`
}

type AgentInfoDTO

type AgentInfoDTO struct {
	Status             string         `json:"status"`
	Version            string         `json:"version"`
	LastCheckInTime    int64          `json:"last_checkin,omitempty"`
	AvailableListfiles []AgentFileDTO `json:"available_listfiles,omitempty"`
	ActiveJobIDs       []string       `json:"active_job_ids,omitempty"`
}

type AttackCreateRequestDTO

type AttackCreateRequestDTO struct {
	HashlistID    string                     `json:"hashlist_id" validate:"required,uuid"`
	HashcatParams hashcattypes.HashcatParams `json:"hashcat_params" validate:"required"`
	IsDistributed bool                       `json:"is_distributed"`
}

type AttackDTO

type AttackDTO struct {
	ID             string                     `json:"id"`
	HashlistID     string                     `json:"hashlist_id"`
	HashcatParams  hashcattypes.HashcatParams `json:"hashcat_params"`
	IsDistributed  bool                       `json:"is_distributed"`
	ProgressString string                     `json:"progress_string"`
}

type AttackIDTreeDTO

type AttackIDTreeDTO struct {
	ProjectID  string `json:"project_id"`
	HashlistID string `json:"hashlist_id"`
	AttackID   string `json:"attack_id"`
}

type AttackIDTreeMultipleDTO

type AttackIDTreeMultipleDTO struct {
	Attacks []AttackIDTreeDTO `json:"attacks"`
}

type AttackMultipleDTO

type AttackMultipleDTO struct {
	Attacks []AttackDTO `json:"attacks"`
}

type AttackStartResponseDTO

type AttackStartResponseDTO struct {
	JobIDs          []string `json:"new_job_ids"`
	StillProcessing bool     `json:"still_processing"`
}

type AttackWithJobsDTO

type AttackWithJobsDTO struct {
	AttackDTO
	Jobs []JobDTO `json:"jobs"`
}

type AttackWithJobsMultipleDTO

type AttackWithJobsMultipleDTO struct {
	Attacks []AttackWithJobsDTO `json:"attacks"`
}

type AuthChangePasswordRequestDTO

type AuthChangePasswordRequestDTO struct {
	OldPassword string `json:"old_password" validate:"required"`
	NewPassword string `json:"new_password" validate:"required,min=16,max=128"`
}

type AuthConfigDTO

type AuthConfigDTO struct {
	General *GeneralAuthConfigDTO `json:"general"`
	OIDC    *AuthOIDCConfigDTO    `json:"oidc"`
}

type AuthCurrentUserDTO

type AuthCurrentUserDTO struct {
	ID               string   `json:"id"`
	Username         string   `json:"username"`
	Roles            []string `json:"roles"`
	IsPasswordLocked bool     `json:"is_password_locked"`
}

type AuthLoginRequestDTO

type AuthLoginRequestDTO struct {
	Username string `json:"username" validate:"required,min=4,max=64,username"`
	Password string `json:"password" validate:"required"`
}

type AuthLoginResponseDTO

type AuthLoginResponseDTO struct {
	User                   AuthCurrentUserDTO `json:"user"`
	IsAwaitingMFA          bool               `json:"is_awaiting_mfa"`
	RequiresPasswordChange bool               `json:"requires_password_change"`
	RequiresMFAEnrollment  bool               `json:"requires_mfa_enrollment"`
}

type AuthOIDCConfigDTO

type AuthOIDCConfigDTO struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`

	IssuerURL   string `json:"issuer_url"`
	RedirectURL string `json:"redirect_url"`

	Prompt string `json:"prompt"`

	AutomaticUserCreation bool   `json:"automatic_user_creation"`
	UsernameClaim         string `json:"username_claim"`

	RolesClaim   string `json:"role_field"`
	RequiredRole string `json:"required_role"`

	AdditionalScopes []string `json:"scopes"`
}

type AuthRefreshResponseDTO

type AuthRefreshResponseDTO struct {
	User                   AuthCurrentUserDTO `json:"user"`
	IsAwaitingMFA          bool               `json:"is_awaiting_mfa"`
	RequiresPasswordChange bool               `json:"requires_password_change"`
	RequiresMFAEnrollment  bool               `json:"requires_mfa_enrollment"`
}

type AuthWebAuthnStartChallengeResponseDTO

type AuthWebAuthnStartChallengeResponseDTO struct {
	protocol.CredentialAssertion
}

type AuthWebAuthnStartEnrollmentResponseDTO

type AuthWebAuthnStartEnrollmentResponseDTO struct {
	protocol.CredentialCreation
}

type AuthWhoamiResponseDTO

type AuthWhoamiResponseDTO struct {
	User                   AuthCurrentUserDTO `json:"user"`
	IsAwaitingMFA          bool               `json:"is_awaiting_mfa"`
	RequiresPasswordChange bool               `json:"requires_password_change"`
	RequiresMFAEnrollment  bool               `json:"requires_mfa_enrollment"`
}

type DetectHashTypeRequestDTO

type DetectHashTypeRequestDTO struct {
	TestHash    string `json:"test_hash" validate:"required,min=4"`
	HasUsername bool   `json:"has_username"`
}

type DetectHashTypeResponseDTO

type DetectHashTypeResponseDTO struct {
	PossibleTypes []int `json:"possible_types"`
}

type GeneralAuthConfigDTO

type GeneralAuthConfigDTO struct {
	EnabledMethods []string `json:"enabled_methods"`

	IsMFARequired                     bool `json:"is_mfa_required"`
	RequirePasswordChangeOnFirstLogin bool `json:"require_password_change_on_first_login"`
}

type GeneralConfigDTO

type GeneralConfigDTO struct {
	IsMaintenanceMode               bool  `json:"is_maintenance_mode"`
	MaximumUploadedFileSize         int64 `json:"maximum_uploaded_file_size"`
	MaximumUploadedFileLineScanSize int64 `json:"maximum_uploaded_file_line_scan_size"`
}

type GetAllRuleFilesDTO

type GetAllRuleFilesDTO struct {
	RuleFiles []ListfileDTO `json:"rulefiles"`
}

type GetAllWordlistsDTO

type GetAllWordlistsDTO struct {
	Wordlists []ListfileDTO `json:"wordlists"`
}

type HashTypesDTO

type HashTypesDTO struct {
	HashTypes hashcattypes.HashTypeMap `json:"hashtypes"`
}

type HashlistCreateRequestDTO

type HashlistCreateRequestDTO struct {
	ProjectID    string   `json:"project_id" validate:"required,uuid"`
	Name         string   `json:"name" validate:"required,standardname,min=5,max=30"`
	HashType     int      `json:"hash_type" validate:"hashtype"`
	InputHashes  []string `json:"input_hashes" validate:"required,min=1,dive,required,min=4"`
	HasUsernames bool     `json:"has_usernames"`
}

type HashlistCreateResponseDTO

type HashlistCreateResponseDTO struct {
	ID                      string `json:"id"`
	NumPopulatedFromPotfile int64  `json:"num_populated_from_potfile"`
}

type HashlistDTO

type HashlistDTO struct {
	ID          string            `json:"id"`
	ProjectID   string            `json:"project_id"`
	Name        string            `json:"name"`
	TimeCreated int64             `json:"time_created"`
	HashType    int               `json:"hash_type"`
	Hashes      []HashlistHashDTO `json:"hashes"`
	Version     uint              `json:"version"`
}

type HashlistHashDTO

type HashlistHashDTO struct {
	ID             string `json:"id"`
	InputHash      string `json:"input_hash"`
	NormalizedHash string `json:"normalized_hash"`
	IsCracked      bool   `json:"is_cracked"`
	PlaintextHex   string `json:"plaintext_hex"`
}

type HashlistResponseMultipleDTO

type HashlistResponseMultipleDTO struct {
	Hashlists []HashlistDTO `json:"hashlists"`
}

type JobCrackedHashDTO

type JobCrackedHashDTO struct {
	Hash         string `json:"hash"`
	PlaintextHex string `json:"plaintext_hex"`
}

type JobCreateRequestDTO

type JobCreateRequestDTO struct {
	HashcatParams    hashcattypes.HashcatParams `json:"hashcat_params" validate:"required"`
	Hashes           []string                   `json:"hashes" validate:"required,min=1,dive,min=4,required"`
	StartImmediately bool                       `json:"start_immediately"`
	Name             string                     `json:"name" validate:"required,standardname,min=5,max=30"`
	Description      string                     `json:"description" validate:"printascii,max=1000"`
}

type JobCreateResponseDTO

type JobCreateResponseDTO struct {
	ID string `json:"id"`
}

type JobDTO

type JobDTO struct {
	ID              string                     `json:"id"`
	HashlistVersion uint                       `json:"hashlist_version"`
	AttackID        string                     `json:"attack_id"`
	HashcatParams   hashcattypes.HashcatParams `json:"hashcat_params"`
	TargetHashes    []string                   `json:"target_hashes"`
	HashType        int                        `json:"hash_type"`
	RuntimeData     JobRuntimeDataDTO          `json:"runtime_data"`
	RuntimeSummary  JobRuntimeSummaryDTO       `json:"runtime_summary"`
	AssignedAgentID string                     `json:"assigned_agent_id"`
}

type JobMultipleDTO

type JobMultipleDTO struct {
	Jobs []JobSimpleDTO `json:"jobs"`
}

type JobRuntimeDataDTO

type JobRuntimeDataDTO struct {
	StartRequestTime time.Time `json:"start_request_time"`
	StartedTime      time.Time `json:"started_time"`
	StoppedTime      time.Time `json:"stopped_time"`
	Status           string    `json:"status"`
	StopReason       string    `json:"stop_reason"`
	ErrorString      string    `json:"error_string"`
	CmdLine          string    `json:"cmd_line"`

	OutputLines   []JobRuntimeOutputLineDTO    `json:"output_lines"`
	StatusUpdates []hashcattypes.HashcatStatus `json:"status_updates"`
	CrackedHashes []JobCrackedHashDTO          `json:"cracked_hashes"`
}

type JobRuntimeOutputLineDTO

type JobRuntimeOutputLineDTO struct {
	Stream string `json:"stream"`
	Line   string `json:"line"`
}

type JobRuntimeSummaryDTO

type JobRuntimeSummaryDTO struct {
	Hashrate               int     `json:"hashrate"`
	EstimatedTimeRemaining int64   `json:"estimated_time_remaining"`
	PercentComplete        float32 `json:"percent_complete"`
	StartedTime            int64   `json:"started_time"`
	StoppedTime            int64   `json:"stopped_time"`
	CmdLine                string  `json:"cmd_line"`
}

type JobSimpleDTO

type JobSimpleDTO struct {
	ID              string `json:"id"`
	HashlistVersion uint   `json:"hashlist_version"`
	AttackID        string `json:"attack_id"`
	HashType        int    `json:"hash_type"`
	AssignedAgentID string `json:"assigned_agent_id"`
}

type JobStartResponseDTO

type JobStartResponseDTO struct {
	AgentID string `json:"agent_id"`
}

type ListfileDTO

type ListfileDTO struct {
	ID              string `json:"id"`
	FileType        string `json:"file_type"`
	Name            string `json:"name"`
	SizeInBytes     uint64 `json:"size_in_bytes"`
	Lines           uint64 `json:"lines"`
	AvailableForUse bool   `json:"available_for_use"`
	PendingDelete   bool   `json:"pending_delete"`
	CreatedByUserID string `json:"created_by_user_id"`
}

type ListfileUploadResponseDTO

type ListfileUploadResponseDTO struct {
	Listfile ListfileDTO `json:"listfile"`
}

type NormalizeHashesRequestDTO

type NormalizeHashesRequestDTO = VerifyHashesRequestDTO

type NormalizeHashesResponseDTO

type NormalizeHashesResponseDTO struct {
	Valid            bool     `json:"valid"`
	NormalizedHashes []string `json:"normalized_hashes"`
}

type PotfileSearchRequestDTO

type PotfileSearchRequestDTO struct {
	Hashes []string `json:"hashes"`
}

type PotfileSearchResponseDTO

type PotfileSearchResponseDTO struct {
	Results []PotfileSearchResultDTO `json:"results"`
}

type PotfileSearchResultDTO

type PotfileSearchResultDTO struct {
	Hash         string `json:"hash"`
	HashType     uint   `json:"hash_type"`
	PlaintextHex string `json:"plaintext_hex"`
	Found        bool   `json:"found"`
}

type ProjectAddShareRequestDTO

type ProjectAddShareRequestDTO struct {
	UserID string `json:"user_id" validate:"required,uuid"`
}

type ProjectCreateRequestDTO

type ProjectCreateRequestDTO struct {
	Name        string `json:"name" validate:"required,standardname,min=4,max=64"`
	Description string `json:"description" validate:"printascii,max=1000"`
}

type ProjectCreateResponseDTO

type ProjectCreateResponseDTO = ProjectDTO

type ProjectDTO

type ProjectDTO struct {
	ID          string `json:"id"`
	TimeCreated int64  `json:"time_created"`
	Name        string `json:"name"`
	Description string `json:"description"`
	OwnerUserID string `json:"owner_user_id"`
}

type ProjectResponseMultipleDTO

type ProjectResponseMultipleDTO struct {
	Projects []ProjectDTO `json:"projects"`
}

type ProjectSharesDTO

type ProjectSharesDTO struct {
	UserIDs []string `json:"user_ids"`
}

type PublicAuthConfigDTO

type PublicAuthConfigDTO struct {
	EnabledMethods []string            `json:"enabled_methods"`
	OIDC           PublicOIDCConfigDTO `json:"oidc"`
}

type PublicConfigDTO

type PublicConfigDTO struct {
	Auth    PublicAuthConfigDTO    `json:"auth"`
	General PublicGeneralConfigDTO `json:"general"`
}

type PublicGeneralConfigDTO

type PublicGeneralConfigDTO struct {
	IsMaintenanceMode               bool  `json:"is_maintenance_mode"`
	MaximumUploadedFileSize         int64 `json:"maximum_uploaded_file_size"`
	MaximumUploadedFileLineScanSize int64 `json:"maximum_uploaded_file_line_scan_size"`
}

type PublicOIDCConfigDTO

type PublicOIDCConfigDTO struct {
	Prompt string `json:"prompt"`
}

type RunningJobForUserDTO

type RunningJobForUserDTO struct {
	ProjectID  string `json:"project_id"`
	HashlistID string `json:"hashlist_id"`
	AttackID   string `json:"attack_id"`
	JobID      string `json:"job_id"`
}

type RunningJobsForUserResponseDTO

type RunningJobsForUserResponseDTO struct {
	Jobs []RunningJobForUserDTO `json:"jobs"`
}

type UserDTO

type UserDTO struct {
	ID       string   `json:"id"`
	Username string   `json:"username"`
	Roles    []string `json:"roles"`
}

type UserMinimalDTO

type UserMinimalDTO struct {
	ID       string `json:"id"`
	Username string `json:"username"`
}

type UsersGetAllResponseDTO

type UsersGetAllResponseDTO struct {
	Users []UserMinimalDTO `json:"users"`
}

type VerifyHashesRequestDTO

type VerifyHashesRequestDTO struct {
	Hashes       []string `json:"hashes" validate:"required,min=1,dive,required,min=4"`
	HashType     int      `json:"hash_type" validate:"hashtype"`
	HasUsernames bool     `json:"has_usernames"`
}

type VerifyHashesResponseDTO

type VerifyHashesResponseDTO struct {
	Valid bool `json:"valid"`
}

Jump to

Keyboard shortcuts

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