login

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

README

dd-login

Go package to assist wth logging in to DefectDojo using go-rod

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DDLogin

type DDLogin struct {
	BaseURL  *url.URL     // The base URL for the DefectDojo install
	Username string       // The user to login with
	Password string       // The password for the user logging in
	BannerOn bool         // True for login banner being on, false when not
	Browser  *rod.Browser // Rod browser for this login session
	Page     *rod.Page    // Rod browser page
	Debug    bool         // True causes a 5 second delay before clicking the login button
}

func (*DDLogin) NewSession

func (l *DDLogin) NewSession() error

NewSession logs into DefectDojo and creates a new Rod session to use to 'browse' DefectDojo

func (*DDLogin) SetAndLogin

func (l *DDLogin) SetAndLogin(u, usr, p string, b, d bool) error

SetAndLogin is used to set the necessary values to login to DefectDojo using Rod. It takes three strings: a URL (u), a username (usr) and a password (p) and two booleans: b should be set to true if the login banner is on and d should be set to true if you want a 5 second delay before clicking the login button (for debug)

func (*DDLogin) SetBanner

func (l *DDLogin) SetBanner(b bool)

SetBanner takes a boolean (true/false) to set if the login banner is on (true) or off (false)

func (*DDLogin) SetDebug

func (l *DDLogin) SetDebug(d bool)

SetDebug takes a boolean. If set to true, it will pause for 5 seconds before it submits the provided credentials allowing you to see the login screen and optionally change the dev tools layout

func (*DDLogin) SetPassword

func (l *DDLogin) SetPassword(p string)

SetPassword takes a string and sets the password to use for logging into DefectDojo

func (*DDLogin) SetURL

func (l *DDLogin) SetURL(u string) error

SetURL takes a string and creates a url.URL struct returns an error if the URL provided cannot be parsed successfully String should be a URL like https://demo.defectdojo.org

func (*DDLogin) SetUsername

func (l *DDLogin) SetUsername(usr string)

SetUsername taks a string and sets the username to use for logging into DefectDojo

Jump to

Keyboard shortcuts

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