types

package
v0.0.0-...-54a0447 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAuthToken = "X-AuthToken"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	// Key is the authentication key of the client. This key should have
	// only a length of 64, and should be alpha-numeric.
	Key string `json:"key"`
}

AuthRequest is the request the Oomph client sends when it wants to authenticate with the API.

type AuthResponse

type AuthResponse struct {
	// Token is the authentication token the Oomph client must use for all other
	Token string `json:"token"`
	// RefreshAt is the time where the client should attempt to refresh this JWT token
	// at. This is because the token we send is only valid for a short amount of time.
	RefreshAt int64 `json:"refreshAt"`
}

AuthResponse is the reponse to an authentication request when it is successful.

type DBAuthData

type DBAuthData struct {
	// ID is the identifier for this particular authentication data in the database.
	// This is usually used to update this particular auth data from the database.
	ID string `json:"id"`
	// Admin is a boolean that is true if the specified user related to this
	// authentication key is able to run administrator actions on the API.
	Admin bool `json:"admin"`
	// Expiration is the Unix timestamp of when this authentication key expires.
	Expiration int64 `json:"expiration"`
	// IPList is a list of IP addresses allowed to use this authentication key.
	// If a user attempts to authenticate with this IP address, and the list is
	// empty, the address will automatically be added to the IP list.
	IPList []string `json:"ip_list"`
	// Key is the actual authentication key related to this authentication data.
	Key string `json:"key"`
	// Owner is the name or Discord tag of the owner of this authentication key.
	Owner string `json:"owner"`
}

DBAuthData is the structure of the Oomph authentication data retrieved from the database.

type DBProxyBinaryResponse

type DBProxyBinaryResponse struct {
	// Data is the raw data of the Oomph proxy to be sent back to the Oomph client.
	Data string `json:"data"`
}

DBProxyResponse is the database response for a binary request.

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

func NewErrorResponse

func NewErrorResponse(msg string) ErrorResponse

type ProxyDownloadRequest

type ProxyDownloadRequest struct {
	// OS is the operating system for the client requesting the Oomph binary.
	OS string `json:"os"`
	// Arch is the architecture type for the client requesting the Oomph binary.
	Arch string `json:"arch"`
	// Branch is the branch that Oomph's binary should be downloaded from (e.g - stable, beta, dev, etc.)
	Branch string `json:"branch"`
}

ProxyDownloadRequest is the request the Oomph authenticator makes when it wants to download the binary, or check if there are updates for it's current binary.

type ProxyDownloadResponse

type ProxyDownloadResponse struct {
	// Data contains the data of the Oomph proxy binary.
	Data string `json:"data"`
}

ProxyDownloadResponse is the response for a request to download the Oomph proxy.

type ProxyUploadRequest

type ProxyUploadRequest struct {
	// OS is the operating system of this binary.
	OS string `json:"os"`
	// Arch is the architecture type for the client requesting the Oomph binary
	Arch string `json:"arch"`
	// Branch is the branch of the binary that should be updated (e.g - stable, beta, dev, etc.)
	Branch string `json:"branch"`
	// Data is the raw data of the Oomph binary that should be uploaded.
	Data string `json:"data"`
}

ProxyUploadRequest is the request made by an internal Oomph tool makes when it wants to update a binary.

Jump to

Keyboard shortcuts

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