auth

package
v0.24.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package auth provides the auth handlers (authenticate, login, ...) for the Vela API.

Usage:

import "github.com/go-vela/server/api/auth"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthRedirect

func GetAuthRedirect(c *gin.Context)

GetAuthRedirect handles cases where the OAuth callback was overridden by supplying a redirect_uri in the login process. It will send the user to the destination to handle the last leg in the auth flow - exchanging "code" and "state" for a token. This will only handle non-headless flows (ie. web or cli).

func GetAuthToken

func GetAuthToken(c *gin.Context)

GetAuthToken represents the API handler to process a user logging in to Vela from the API or UI.

func Login

func Login(c *gin.Context)

Login represents the API handler to process a user logging in to Vela.

func Logout

func Logout(c *gin.Context)

Logout represents the API handler to process a user logging out of Vela. Primarily, it deletes the current refresh token cookie.

func PostAuthToken

func PostAuthToken(c *gin.Context)

PostAuthToken represents the API handler to process a user logging in using PAT to Vela from the API.

func RefreshAccessToken

func RefreshAccessToken(c *gin.Context)

RefreshAccessToken will return a new access token if the provided refresh token via cookie is valid.

func ValidateOAuthToken added in v0.21.0

func ValidateOAuthToken(c *gin.Context)

ValidateOAuthToken represents the API handler to validate that a user oauth token was created by Vela.

func ValidateServerToken

func ValidateServerToken(c *gin.Context)

ValidateServerToken will validate if a token was issued by the server if it is provided in the auth header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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