github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/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  	"gopkg.in/juju/names.v2"
     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  }