github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/apiserver/authentication/interfaces.go (about) 1 // Copyright 2014 Canonical Ltd. All rights reserved. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package authentication 5 6 import ( 7 "github.com/juju/names" 8 9 "github.com/juju/juju/apiserver/params" 10 "github.com/juju/juju/state" 11 ) 12 13 // EntityAuthenticator is the interface all entity authenticators need to implement 14 // to authenticate juju entities. 15 type EntityAuthenticator interface { 16 // Authenticate authenticates the given entity 17 Authenticate(entityFinder EntityFinder, tag names.Tag, req params.LoginRequest) (state.Entity, error) 18 } 19 20 // EntityFinder finds the entity described by the tag. 21 type EntityFinder interface { 22 FindEntity(tag names.Tag) (state.Entity, error) 23 }