@@ -40,7 +40,6 @@ import (
4040 "github.com/hashicorp/consul/agent/local"
4141 "github.com/hashicorp/consul/agent/structs"
4242 "github.com/hashicorp/consul/agent/token"
43- tokenStore "github.com/hashicorp/consul/agent/token"
4443 "github.com/hashicorp/consul/api"
4544 "github.com/hashicorp/consul/envoyextensions/xdscommon"
4645 "github.com/hashicorp/consul/lib"
@@ -1728,7 +1727,7 @@ func newDefaultBaseDeps(t *testing.T) BaseDeps {
17281727func TestHTTPHandlers_AgentMetricsStream_ACLDeny (t * testing.T ) {
17291728 t .Skip ("this test panics without a license manager in enterprise" )
17301729 bd := newDefaultBaseDeps (t )
1731- bd .Tokens = new (tokenStore .Store )
1730+ bd .Tokens = new (token .Store )
17321731 sink := metrics .NewInmemSink (30 * time .Millisecond , time .Second )
17331732 bd .MetricsConfig = & lib.MetricsConfig {
17341733 Handler : sink ,
@@ -1760,7 +1759,7 @@ func TestHTTPHandlers_AgentMetricsStream_ACLDeny(t *testing.T) {
17601759func TestHTTPHandlers_AgentMetricsStream (t * testing.T ) {
17611760 t .Skip ("this test panics without a license manager in enterprise" )
17621761 bd := newDefaultBaseDeps (t )
1763- bd .Tokens = new (tokenStore .Store )
1762+ bd .Tokens = new (token .Store )
17641763 sink := metrics .NewInmemSink (20 * time .Millisecond , time .Second )
17651764 bd .MetricsConfig = & lib.MetricsConfig {
17661765 Handler : sink ,
@@ -6479,15 +6478,15 @@ func TestAgent_Token(t *testing.T) {
64796478
64806479 type tokens struct {
64816480 user string
6482- userSource tokenStore .TokenSource
6481+ userSource token .TokenSource
64836482 agent string
6484- agentSource tokenStore .TokenSource
6483+ agentSource token .TokenSource
64856484 agentRecovery string
6486- agentRecoverySource tokenStore .TokenSource
6485+ agentRecoverySource token .TokenSource
64876486 repl string
6488- replSource tokenStore .TokenSource
6487+ replSource token .TokenSource
64896488 registration string
6490- registrationSource tokenStore .TokenSource
6489+ registrationSource token .TokenSource
64916490 }
64926491
64936492 resetTokens := func (init tokens ) {
@@ -6538,7 +6537,7 @@ func TestAgent_Token(t *testing.T) {
65386537 url : "acl_token" ,
65396538 body : body ("U" ),
65406539 code : http .StatusOK ,
6541- raw : tokens {user : "U" , userSource : tokenStore .TokenSourceAPI },
6540+ raw : tokens {user : "U" , userSource : token .TokenSourceAPI },
65426541 effective : tokens {user : "U" , agent : "U" },
65436542 },
65446543 {
@@ -6547,7 +6546,7 @@ func TestAgent_Token(t *testing.T) {
65476546 url : "default" ,
65486547 body : body ("U" ),
65496548 code : http .StatusOK ,
6550- raw : tokens {user : "U" , userSource : tokenStore .TokenSourceAPI },
6549+ raw : tokens {user : "U" , userSource : token .TokenSourceAPI },
65516550 effective : tokens {user : "U" , agent : "U" },
65526551 },
65536552 {
@@ -6557,7 +6556,7 @@ func TestAgent_Token(t *testing.T) {
65576556 body : body ("A" ),
65586557 code : http .StatusOK ,
65596558 init : tokens {user : "U" , agent : "U" },
6560- raw : tokens {user : "U" , agent : "A" , agentSource : tokenStore .TokenSourceAPI },
6559+ raw : tokens {user : "U" , agent : "A" , agentSource : token .TokenSourceAPI },
65616560 effective : tokens {user : "U" , agent : "A" },
65626561 },
65636562 {
@@ -6567,7 +6566,7 @@ func TestAgent_Token(t *testing.T) {
65676566 body : body ("A" ),
65686567 code : http .StatusOK ,
65696568 init : tokens {user : "U" , agent : "U" },
6570- raw : tokens {user : "U" , agent : "A" , agentSource : tokenStore .TokenSourceAPI },
6569+ raw : tokens {user : "U" , agent : "A" , agentSource : token .TokenSourceAPI },
65716570 effective : tokens {user : "U" , agent : "A" },
65726571 },
65736572 {
@@ -6576,7 +6575,7 @@ func TestAgent_Token(t *testing.T) {
65766575 url : "acl_agent_master_token" ,
65776576 body : body ("M" ),
65786577 code : http .StatusOK ,
6579- raw : tokens {agentRecovery : "M" , agentRecoverySource : tokenStore .TokenSourceAPI },
6578+ raw : tokens {agentRecovery : "M" , agentRecoverySource : token .TokenSourceAPI },
65806579 effective : tokens {agentRecovery : "M" },
65816580 },
65826581 {
@@ -6585,7 +6584,7 @@ func TestAgent_Token(t *testing.T) {
65856584 url : "agent_master" ,
65866585 body : body ("M" ),
65876586 code : http .StatusOK ,
6588- raw : tokens {agentRecovery : "M" , agentRecoverySource : tokenStore .TokenSourceAPI },
6587+ raw : tokens {agentRecovery : "M" , agentRecoverySource : token .TokenSourceAPI },
65896588 effective : tokens {agentRecovery : "M" },
65906589 },
65916590 {
@@ -6594,16 +6593,16 @@ func TestAgent_Token(t *testing.T) {
65946593 url : "agent_recovery" ,
65956594 body : body ("R" ),
65966595 code : http .StatusOK ,
6597- raw : tokens {agentRecovery : "R" , agentRecoverySource : tokenStore .TokenSourceAPI },
6598- effective : tokens {agentRecovery : "R" , agentRecoverySource : tokenStore .TokenSourceAPI },
6596+ raw : tokens {agentRecovery : "R" , agentRecoverySource : token .TokenSourceAPI },
6597+ effective : tokens {agentRecovery : "R" , agentRecoverySource : token .TokenSourceAPI },
65996598 },
66006599 {
66016600 name : "set repl legacy" ,
66026601 method : "PUT" ,
66036602 url : "acl_replication_token" ,
66046603 body : body ("R" ),
66056604 code : http .StatusOK ,
6606- raw : tokens {repl : "R" , replSource : tokenStore .TokenSourceAPI },
6605+ raw : tokens {repl : "R" , replSource : token .TokenSourceAPI },
66076606 effective : tokens {repl : "R" },
66086607 },
66096608 {
@@ -6612,7 +6611,7 @@ func TestAgent_Token(t *testing.T) {
66126611 url : "replication" ,
66136612 body : body ("R" ),
66146613 code : http .StatusOK ,
6615- raw : tokens {repl : "R" , replSource : tokenStore .TokenSourceAPI },
6614+ raw : tokens {repl : "R" , replSource : token .TokenSourceAPI },
66166615 effective : tokens {repl : "R" },
66176616 },
66186617 {
@@ -6621,7 +6620,7 @@ func TestAgent_Token(t *testing.T) {
66216620 url : "config_file_service_registration" ,
66226621 body : body ("G" ),
66236622 code : http .StatusOK ,
6624- raw : tokens {registration : "G" , registrationSource : tokenStore .TokenSourceAPI },
6623+ raw : tokens {registration : "G" , registrationSource : token .TokenSourceAPI },
66256624 effective : tokens {registration : "G" },
66266625 },
66276626 {
@@ -6631,7 +6630,7 @@ func TestAgent_Token(t *testing.T) {
66316630 body : body ("" ),
66326631 code : http .StatusOK ,
66336632 init : tokens {user : "U" },
6634- raw : tokens {userSource : tokenStore .TokenSourceAPI },
6633+ raw : tokens {userSource : token .TokenSourceAPI },
66356634 },
66366635 {
66376636 name : "clear default" ,
@@ -6640,7 +6639,7 @@ func TestAgent_Token(t *testing.T) {
66406639 body : body ("" ),
66416640 code : http .StatusOK ,
66426641 init : tokens {user : "U" },
6643- raw : tokens {userSource : tokenStore .TokenSourceAPI },
6642+ raw : tokens {userSource : token .TokenSourceAPI },
66446643 },
66456644 {
66466645 name : "clear agent legacy" ,
@@ -6649,7 +6648,7 @@ func TestAgent_Token(t *testing.T) {
66496648 body : body ("" ),
66506649 code : http .StatusOK ,
66516650 init : tokens {agent : "A" },
6652- raw : tokens {agentSource : tokenStore .TokenSourceAPI },
6651+ raw : tokens {agentSource : token .TokenSourceAPI },
66536652 },
66546653 {
66556654 name : "clear agent" ,
@@ -6658,7 +6657,7 @@ func TestAgent_Token(t *testing.T) {
66586657 body : body ("" ),
66596658 code : http .StatusOK ,
66606659 init : tokens {agent : "A" },
6661- raw : tokens {agentSource : tokenStore .TokenSourceAPI },
6660+ raw : tokens {agentSource : token .TokenSourceAPI },
66626661 },
66636662 {
66646663 name : "clear master legacy" ,
@@ -6667,7 +6666,7 @@ func TestAgent_Token(t *testing.T) {
66676666 body : body ("" ),
66686667 code : http .StatusOK ,
66696668 init : tokens {agentRecovery : "M" },
6670- raw : tokens {agentRecoverySource : tokenStore .TokenSourceAPI },
6669+ raw : tokens {agentRecoverySource : token .TokenSourceAPI },
66716670 },
66726671 {
66736672 name : "clear master" ,
@@ -6676,7 +6675,7 @@ func TestAgent_Token(t *testing.T) {
66766675 body : body ("" ),
66776676 code : http .StatusOK ,
66786677 init : tokens {agentRecovery : "M" },
6679- raw : tokens {agentRecoverySource : tokenStore .TokenSourceAPI },
6678+ raw : tokens {agentRecoverySource : token .TokenSourceAPI },
66806679 },
66816680 {
66826681 name : "clear recovery" ,
@@ -6685,7 +6684,7 @@ func TestAgent_Token(t *testing.T) {
66856684 body : body ("" ),
66866685 code : http .StatusOK ,
66876686 init : tokens {agentRecovery : "R" },
6688- raw : tokens {agentRecoverySource : tokenStore .TokenSourceAPI },
6687+ raw : tokens {agentRecoverySource : token .TokenSourceAPI },
66896688 },
66906689 {
66916690 name : "clear repl legacy" ,
@@ -6694,7 +6693,7 @@ func TestAgent_Token(t *testing.T) {
66946693 body : body ("" ),
66956694 code : http .StatusOK ,
66966695 init : tokens {repl : "R" },
6697- raw : tokens {replSource : tokenStore .TokenSourceAPI },
6696+ raw : tokens {replSource : token .TokenSourceAPI },
66986697 },
66996698 {
67006699 name : "clear repl" ,
@@ -6703,7 +6702,7 @@ func TestAgent_Token(t *testing.T) {
67036702 body : body ("" ),
67046703 code : http .StatusOK ,
67056704 init : tokens {repl : "R" },
6706- raw : tokens {replSource : tokenStore .TokenSourceAPI },
6705+ raw : tokens {replSource : token .TokenSourceAPI },
67076706 },
67086707 {
67096708 name : "clear registration" ,
@@ -6712,7 +6711,7 @@ func TestAgent_Token(t *testing.T) {
67126711 body : body ("" ),
67136712 code : http .StatusOK ,
67146713 init : tokens {registration : "G" },
6715- raw : tokens {registrationSource : tokenStore .TokenSourceAPI },
6714+ raw : tokens {registrationSource : token .TokenSourceAPI },
67166715 },
67176716 }
67186717 for _ , tt := range tests {
0 commit comments