// Everything within this file is deprecated and related to the original ACL
// implementation. Once support for v1 ACLs are removed this whole file can
// be deleted.
packagestructs
import(
"errors"
"fmt"
"time"
"github.com/hashicorp/consul/acl"
)
const(
// ACLBootstrapInit is used to perform a scan for existing tokens which
// will decide whether bootstrapping is allowed for a cluster. This is
// initiated by the leader when it steps up, if necessary.
ACLBootstrapInitACLOp="bootstrap-init"
// ACLBootstrapNow is used to perform a one-time ACL bootstrap operation on
// a cluster to get the first management token.
ACLBootstrapNowACLOp="bootstrap-now"
// ACLForceSet is deprecated, but left for backwards compatibility.
ACLForceSetACLOp="force-set"
)
// ACLBootstrapNotInitializedErr is returned when a bootstrap is attempted but
// we haven't yet initialized ACL bootstrap. It provides some guidance to
// operators on how to proceed.
varACLBootstrapNotInitializedErr=errors.New("ACL bootstrap not initialized, need to force a leader election and ensure all Consul servers support this feature")
const(
// ACLTokenTypeClient tokens have rules applied
ACLTokenTypeClient="client"
// ACLTokenTypeManagement tokens have an always allow policy, so they can
// make other tokens and can access all resources.
ACLTokenTypeManagement="management"
// ACLTokenTypeNone
ACLTokenTypeNone=""
)
// ACL is used to represent a token and its rules
typeACLstruct{
IDstring
Namestring
Typestring
Rulesstring
RaftIndex
}
// ACLs is a slice of ACLs.
typeACLs[]*ACL
// Convert does a 1-1 mapping of the ACLCompat structure to its ACLToken
// equivalent. This will NOT fill in the other ACLToken fields or perform any other