Add MFA functionality

This commit is contained in:
JoramWilander
2016-03-30 12:49:29 -04:00
parent 2aa0d9b8fc
commit f9a3a4b394
49 changed files with 5845 additions and 361 deletions

25
einterfaces/mfa.go Normal file
View File

@@ -0,0 +1,25 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package einterfaces
import (
"github.com/mattermost/platform/model"
)
type MfaInterface interface {
GenerateQrCode(team *model.Team, user *model.User) ([]byte, *model.AppError)
Activate(user *model.User, token string) *model.AppError
Deactivate(userId string) *model.AppError
ValidateToken(secret, token string) (bool, *model.AppError)
}
var theMfaInterface MfaInterface
func RegisterMfaInterface(newInterface MfaInterface) {
theMfaInterface = newInterface
}
func GetMfaInterface() MfaInterface {
return theMfaInterface
}