github

package
v0.0.0-...-530d8eb Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package github provides you access to Github's OAuth2 infrastructure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth() gin.HandlerFunc

Auth initialize the authentication with Github

func CheckAuthenticatedUser

func CheckAuthenticatedUser() gin.HandlerFunc

CheckAuthenticatedUser will be implemented as a controller for authentication for every api in a group

func LoginHandler

func LoginHandler(ctx *gin.Context)

LoginHandler save in the cookie the state and return the url needed for authentication with Github

func Session

func Session(name string) gin.HandlerFunc

Session is the function needed by the handler github to initialize the session

func Setup

func Setup(credFile string, scopes []string, secret []byte, authRedirectURL, orgRequired string)

Setup setup the github oauth2 handler

Types

type AuthUser

type AuthUser struct {
	Login              string `json:"login"`
	Name               string `json:"name"`
	OrganizationNeeded bool   `json:"organization_needed"`
}

AuthUser rapresents datas of authenticated user

type Credentials

type Credentials struct {
	ClientID     string `json:"clientid"`
	ClientSecret string `json:"secret"`
}

Credentials stores google client-ids.

Jump to

Keyboard shortcuts

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