@@ -23,7 +23,7 @@ func makeRegistrationToken() string {
2323func TestRegistrationToken (t * testing.T ) {
2424 validRegistrationToken := makeRegistrationToken ()
2525
26- result , err := ctrl .NewRegistration (validRegistrationToken , "toaster" , "" , "" , 1 , "" )
26+ result , err := ctrl .NewRegistration (validRegistrationToken , "toaster" , "" , "" , 1 , 0 , "" )
2727 if err != nil {
2828 t .Fatal ("failed to create registration token: " , err )
2929 }
@@ -70,7 +70,7 @@ func TestRegistrationTokenMultipleUses(t *testing.T) {
7070 validRegistrationToken := makeRegistrationToken ()
7171 maxUses := 3
7272
73- _ , err := ctrl .NewRegistration (validRegistrationToken , "multiusedevice" , "" , "" , maxUses , "" )
73+ _ , err := ctrl .NewRegistration (validRegistrationToken , "multiusedevice" , "" , "" , maxUses , 0 , "" )
7474 if err != nil {
7575 t .Fatalf ("failed to create registration token: %v" , err )
7676 }
@@ -116,7 +116,7 @@ func TestRegistrationTokenWithGroups(t *testing.T) {
116116 validRegistrationToken := makeRegistrationToken ()
117117 groups := []string {"group:nerds" }
118118
119- result , err := ctrl .NewRegistration (validRegistrationToken , "groupeddevice" , "" , "" , 1 , "" , groups ... )
119+ result , err := ctrl .NewRegistration (validRegistrationToken , "groupeddevice" , "" , "" , 1 , 0 , "" , groups ... )
120120 if err != nil {
121121 t .Fatalf ("failed to create registration token with groups: %v" , err )
122122 }
@@ -134,7 +134,7 @@ func TestRegistrationTokenWithGroups(t *testing.T) {
134134func TestRegistrationTokenDelete (t * testing.T ) {
135135 validRegistrationToken := makeRegistrationToken ()
136136
137- result , err := ctrl .NewRegistration (validRegistrationToken , "toaster2" , "" , "" , 1 , "" )
137+ result , err := ctrl .NewRegistration (validRegistrationToken , "toaster2" , "" , "" , 1 , 0 , "" )
138138 if err != nil {
139139 t .Fatal ("failed to create registration token: " , err )
140140 }
@@ -180,7 +180,7 @@ func TestInvalidTokenLength(t *testing.T) {
180180
181181 for _ , tc := range testCases {
182182 t .Run (tc .name , func (t * testing.T ) {
183- resp , err := ctrl .NewRegistration (tc .token , "unnniiuquueee" + tc .name , "" , "" , 1 , "" )
183+ resp , err := ctrl .NewRegistration (tc .token , "unnniiuquueee" + tc .name , "" , "" , 1 , 0 , "" )
184184 if err == nil {
185185 t .Fatal ("expected failure to create token with invalid length: " , tc .name , resp )
186186 }
@@ -191,7 +191,7 @@ func TestInvalidTokenLength(t *testing.T) {
191191func TestRegistrationTokenConcurrency (t * testing.T ) {
192192 validRegistrationToken := makeRegistrationToken ()
193193
194- _ , err := ctrl .NewRegistration (validRegistrationToken , "concurrentuser" , "" , "" , 1 , "" )
194+ _ , err := ctrl .NewRegistration (validRegistrationToken , "concurrentuser" , "" , "" , 1 , 0 , "" )
195195 if err != nil {
196196 t .Fatalf ("failed to create registration token: %v" , err )
197197 }
@@ -252,7 +252,7 @@ func TestRegistrationTokenSpecialCharacters(t *testing.T) {
252252 for token , expectError := range specialTokens {
253253 t .Run (fmt .Sprintf ("token_%s" , token ), func (t * testing.T ) {
254254 // Try to create token (may or may not be valid depending on your validation)
255- _ , err := ctrl .NewRegistration (token , "specialdevice" , "" , "" , 1 , "" )
255+ _ , err := ctrl .NewRegistration (token , "specialdevice" , "" , "" , 1 , 0 , "" )
256256 if expectError {
257257 if err == nil {
258258 t .Fatal ("expected to get error from token creation: " , token , "but didnt" )
@@ -282,13 +282,13 @@ func TestRegistrationTokenDuplicates(t *testing.T) {
282282 validRegistrationToken := makeRegistrationToken ()
283283
284284 // Create first token
285- _ , err := ctrl .NewRegistration (validRegistrationToken , "device1" , "" , "" , 1 , "" )
285+ _ , err := ctrl .NewRegistration (validRegistrationToken , "device1" , "" , "" , 1 , 0 , "" )
286286 if err != nil {
287287 t .Fatalf ("failed to create first registration token: %v" , err )
288288 }
289289
290290 // Try to create duplicate token
291- _ , err = ctrl .NewRegistration (validRegistrationToken , "device2" , "" , "" , 1 , "" )
291+ _ , err = ctrl .NewRegistration (validRegistrationToken , "device2" , "" , "" , 1 , 0 , "" )
292292 if err == nil {
293293 t .Fatal ("should not be able to create duplicate registration tokens" )
294294 }
@@ -297,7 +297,7 @@ func TestRegistrationTokenDuplicates(t *testing.T) {
297297func TestRegistrationTokenInvalidHTTPMethods (t * testing.T ) {
298298 validRegistrationToken := makeRegistrationToken ()
299299
300- _ , err := ctrl .NewRegistration (validRegistrationToken , "methodtestdevice" , "" , "" , 1 , "" )
300+ _ , err := ctrl .NewRegistration (validRegistrationToken , "methodtestdevice" , "" , "" , 1 , 0 , "" )
301301 if err != nil {
302302 t .Fatalf ("failed to create registration token: %v" , err )
303303 }
0 commit comments