provider

package
v0.0.0-...-34e15cb Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright 2017 Tink AB

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateRequest

type AuthenticateRequest struct {
	SignRequests []u2f.SignRequest `json:"signRequests"`
}

U2F Authentication request.

type FilesystemU2FStore

type FilesystemU2FStore struct {
	// contains filtered or unexported fields
}

func NewFilesystemU2FStore

func NewFilesystemU2FStore(path string) *FilesystemU2FStore

func (*FilesystemU2FStore) IncreaseCounter

func (s *FilesystemU2FStore) IncreaseCounter(user string, i int, c uint32) error

func (*FilesystemU2FStore) Register

func (s *FilesystemU2FStore) Register(user string, reg u2f.Registration) error

func (*FilesystemU2FStore) Registrations

func (s *FilesystemU2FStore) Registrations(user string) ([]*u2f.Registration, error)

type NextURLCallback

type NextURLCallback func(*session.LoginSession) string

type OAuthProvider

type OAuthProvider struct {
	// contains filtered or unexported fields
}

func NewOAuth

func NewOAuth(sa ServiceAccount, oa OAuthSettings, successCallback SuccesCallback, nextURLCallback NextURLCallback) *OAuthProvider

func (*OAuthProvider) CallbackHandler

func (p *OAuthProvider) CallbackHandler(c context.Context, s *session.LoginSession)

func (*OAuthProvider) Login

type OAuthSettings

type OAuthSettings struct {
	ClientID     string
	ClientSecret string
	CallbackURL  string
}

type ServiceAccount

type ServiceAccount struct {
	Email            string
	PrivateKey       string
	ImpersonateAdmin string
}

type SuccesCallback

type SuccesCallback func(context.Context, *session.LoginSession)

type U2FFile

type U2FFile struct {
	Registrations []*u2f.Registration
	Counters      []uint32
}

type U2FProvider

type U2FProvider struct {
	// contains filtered or unexported fields
}

func NewU2F

func NewU2F(appID string, trustedFacets []string, store U2FStore, successCallback SuccesCallback, nextURLCallback NextURLCallback) *U2FProvider

func (*U2FProvider) Handler

func (p *U2FProvider) Handler(c context.Context, s *session.LoginSession)

func (*U2FProvider) RegisterRequestHandler

func (p *U2FProvider) RegisterRequestHandler(c context.Context, s *session.LoginSession)

func (*U2FProvider) RegisterResponseHandler

func (p *U2FProvider) RegisterResponseHandler(c context.Context, s *session.LoginSession)

func (*U2FProvider) SignRequestHandler

func (p *U2FProvider) SignRequestHandler(c context.Context, s *session.LoginSession)

func (*U2FProvider) SignResponseHandler

func (p *U2FProvider) SignResponseHandler(c context.Context, s *session.LoginSession)

type U2FStore

type U2FStore interface {
	Registrations(user string) ([]*u2f.Registration, error)
	Register(user string, reg u2f.Registration) error
	IncreaseCounter(user string, i int, counter uint32) error
}

type User

type User struct {
	Sub           string `json:"sub"`
	Name          string `json:"name"`
	GivenName     string `json:"given_name"`
	FamilyName    string `json:"family_name"`
	Profile       string `json:"profile"`
	Picture       string `json:"picture"`
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Gender        string `json:"gender"`
}

User is a retrieved and authentiacted user.

Jump to

Keyboard shortcuts

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