github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/pgwire/hba/testdata/parse (about) 1 subtest line_too_short 2 3 line 4 local 5 ---- 6 error: end-of-line before database specification 7 8 line 9 local a 10 ---- 11 error: end-of-line before role specification 12 13 line 14 local a b 15 ---- 16 error: end-of-line before authentication method 17 18 line 19 host a b c 20 ---- 21 error: end-of-line before authentication method 22 23 line 24 host a b 25 ---- 26 error: end-of-line before IP address specification 27 28 line 29 host a b 1.1.1.1 30 ---- 31 error: end-of-line before netmask specification 32 33 subtest end 34 35 subtest unknown_formats 36 37 line 38 unknown a b c 39 ---- 40 error: unknown connection type: "unknown" 41 42 line 43 local a b c d 44 ---- 45 error: authentication option not in name=value format: d 46 47 subtest end 48 49 subtest quoted_columns 50 51 line 52 "local" a b c 53 ---- 54 # Original configuration: 55 # "local" a b c 56 # 57 # Interpreted configuration: 58 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 59 local a b c 60 61 line 62 local a b "method" 63 ---- 64 # Original configuration: 65 # local a b "method" 66 # 67 # Interpreted configuration: 68 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 69 local a b "method" 70 71 line 72 host all all all gss k=v " someopt = withspaces " 73 ---- 74 # Original configuration: 75 # host all all all gss k=v " someopt = withspaces " 76 # 77 # Interpreted configuration: 78 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 79 host all all all gss k=v " someopt = withspaces " 80 81 subtest end 82 83 subtest keyword_all 84 85 line 86 host all b c d 87 ---- 88 # Original configuration: 89 # host all b c d 90 # 91 # Interpreted configuration: 92 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 93 host all b c d 94 95 line 96 host "all" b c d 97 ---- 98 # Original configuration: 99 # host "all" b c d 100 # 101 # Interpreted configuration: 102 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 103 host "all" b c d 104 105 line 106 host a all c d 107 ---- 108 # Original configuration: 109 # host a all c d 110 # 111 # Interpreted configuration: 112 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 113 host a all c d 114 115 line 116 host a "all" c d 117 ---- 118 # Original configuration: 119 # host a "all" c d 120 # 121 # Interpreted configuration: 122 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 123 host a "all" c d 124 125 line 126 host a b all d 127 ---- 128 # Original configuration: 129 # host a b all d 130 # 131 # Interpreted configuration: 132 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 133 host a b all d 134 135 subtest end 136 137 subtest samehost_samenet 138 139 line 140 host a b samehost d 141 ---- 142 error: unimplemented: address specification samehost is not yet supported 143 144 line 145 host a b samenet d 146 ---- 147 error: unimplemented: address specification samenet is not yet supported 148 149 subtest end 150 151 subtest addr 152 153 154 line 155 host a b 1.1.1.1,2.2.2.2 156 ---- 157 error: multiple values specified for host address 158 159 line 160 local a b 1.1.1.1 161 ---- 162 # Original configuration: 163 # local a b 1.1.1.1 164 # 165 # Interpreted configuration: 166 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 167 local a b 1.1.1.1 168 169 170 line 171 host a b 0.0.0.0/0 d 172 ---- 173 # Original configuration: 174 # host a b 0.0.0.0/0 d 175 # 176 # Interpreted configuration: 177 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 178 host a b 0.0.0.0/0 d 179 180 parse 181 host all all 0.0/0 trust 182 ---- 183 unknown directive: parse 184 185 line 186 host a b ::1/0 d 187 ---- 188 # Original configuration: 189 # host a b ::1/0 d 190 # 191 # Interpreted configuration: 192 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 193 host a b ::/0 d 194 195 line 196 host a b 2.3.4.5/8 d 197 ---- 198 # Original configuration: 199 # host a b 2.3.4.5/8 d 200 # 201 # Interpreted configuration: 202 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 203 host a b 2.0.0.0/8 d 204 205 line 206 host all all fe80::7a31:c1ff:0000:0000/96 cert 207 ---- 208 # Original configuration: 209 # host all all fe80::7a31:c1ff:0000:0000/96 cert 210 # 211 # Interpreted configuration: 212 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 213 host all all fe80::7a31:c1ff:0:0/96 cert 214 215 line 216 host a b 1.1.1.1 255.0.0.0,255.255.0.0 d 217 ---- 218 error: multiple values specified for netmask 219 220 221 line 222 host a b 2.3.4.5 255.255.0.0 d 223 ---- 224 # Original configuration: 225 # host a b 2.3.4.5 255.255.0.0 d 226 # 227 # Interpreted configuration: 228 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 229 host a b 2.3.0.0/16 d 230 231 line 232 host a b fe80:7a31:c1ff:: ffff:fff0:: d 233 ---- 234 # Original configuration: 235 # host a b fe80:7a31:c1ff:: ffff:fff0:: d 236 # 237 # Interpreted configuration: 238 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 239 host a b fe80:7a30::/28 d 240 241 line 242 host a b 1.1.1.1 abc d 243 ---- 244 error: invalid IP mask "abc": netmask not in IP numeric format 245 246 line 247 host a b 1.1.1.1 8.0.0.8 d 248 ---- 249 error: invalid IP mask "8.0.0.8": address is not a mask 250 251 line 252 host a b myhost d 253 ---- 254 # Original configuration: 255 # host a b myhost d 256 # 257 # Interpreted configuration: 258 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 259 host a b myhost d 260 261 subtest end 262 263 subtest multiline_entries 264 265 multiline 266 host all all 0.0.0.0/0 trust 267 # comment 268 269 local all all here trust 270 host all all ::1 0 reject # ip and cidr with space 271 host all all fe80::7a31:c1ff:0000:0000/96 cert 272 host all all all trust 273 host all all hostname trust 274 host all all 1.1.1.1 1 trust 275 ---- 276 error: line 4: authentication option not in name=value format: trust 277 278 subtest end 279 280 subtest comma_separated_lists 281 282 multiline 283 host a,b,c all all trust 284 host all a,b,c all trust 285 host a,b,c d,e,f all trust 286 host all testuser,"all" 0.0.0.0/0 cert 287 ---- 288 # String render check: 289 # Original configuration: 290 # host a,b,c all all trust 291 # host all a,b,c all trust 292 # host a,b,c d,e,f all trust 293 # host all testuser,"all" 0.0.0.0/0 cert 294 # 295 # Interpreted configuration: 296 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 297 host a,b,c all all trust 298 host all a,b,c all trust 299 host a,b,c d,e,f all trust 300 host all testuser,"all" 0.0.0.0/0 cert 301 # Detail: 302 &hba.Conf{ 303 Entries: { 304 { 305 ConnType: 6, 306 Database: { 307 {Value:"a", Quoted:false}, 308 {Value:"b", Quoted:false}, 309 {Value:"c", Quoted:false}, 310 }, 311 User: { 312 {Value:"all", Quoted:false}, 313 }, 314 Address: hba.String{Value:"all", Quoted:false}, 315 Method: hba.String{Value:"trust", Quoted:false}, 316 MethodFn: nil, 317 Options: nil, 318 OptionQuotes: nil, 319 Input: "host a,b,c all all trust", 320 Generated: false, 321 }, 322 { 323 ConnType: 6, 324 Database: { 325 {Value:"all", Quoted:false}, 326 }, 327 User: { 328 {Value:"a", Quoted:false}, 329 {Value:"b", Quoted:false}, 330 {Value:"c", Quoted:false}, 331 }, 332 Address: hba.String{Value:"all", Quoted:false}, 333 Method: hba.String{Value:"trust", Quoted:false}, 334 MethodFn: nil, 335 Options: nil, 336 OptionQuotes: nil, 337 Input: "host all a,b,c all trust", 338 Generated: false, 339 }, 340 { 341 ConnType: 6, 342 Database: { 343 {Value:"a", Quoted:false}, 344 {Value:"b", Quoted:false}, 345 {Value:"c", Quoted:false}, 346 }, 347 User: { 348 {Value:"d", Quoted:false}, 349 {Value:"e", Quoted:false}, 350 {Value:"f", Quoted:false}, 351 }, 352 Address: hba.String{Value:"all", Quoted:false}, 353 Method: hba.String{Value:"trust", Quoted:false}, 354 MethodFn: nil, 355 Options: nil, 356 OptionQuotes: nil, 357 Input: "host a,b,c d,e,f all trust", 358 Generated: false, 359 }, 360 { 361 ConnType: 6, 362 Database: { 363 {Value:"all", Quoted:false}, 364 }, 365 User: { 366 {Value:"testuser", Quoted:false}, 367 {Value:"all", Quoted:true}, 368 }, 369 Address: &net.IPNet{ 370 IP: {0x0, 0x0, 0x0, 0x0}, 371 Mask: {0x0, 0x0, 0x0, 0x0}, 372 }, 373 Method: hba.String{Value:"cert", Quoted:false}, 374 MethodFn: nil, 375 Options: nil, 376 OptionQuotes: nil, 377 Input: "host all testuser,\"all\" 0.0.0.0/0 cert", 378 Generated: false, 379 }, 380 }, 381 } 382 383 384 multiline 385 host "all","test space",something some,"us ers" all cert 386 ---- 387 # String render check: 388 # Original configuration: 389 # host "all","test space",something some,"us ers" all cert 390 # 391 # Interpreted configuration: 392 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 393 host "all","test space",something some,"us ers" all cert 394 # Detail: 395 &hba.Conf{ 396 Entries: { 397 { 398 ConnType: 6, 399 Database: { 400 {Value:"all", Quoted:true}, 401 {Value:"test space", Quoted:true}, 402 {Value:"something", Quoted:false}, 403 }, 404 User: { 405 {Value:"some", Quoted:false}, 406 {Value:"us ers", Quoted:true}, 407 }, 408 Address: hba.String{Value:"all", Quoted:false}, 409 Method: hba.String{Value:"cert", Quoted:false}, 410 MethodFn: nil, 411 Options: nil, 412 OptionQuotes: nil, 413 Input: "host \"all\",\"test space\",something some,\"us ers\" all cert", 414 Generated: false, 415 }, 416 }, 417 } 418 419 subtest end 420 421 subtest empty_strings 422 423 multiline 424 "" all all all trust 425 ---- 426 error: line 1: unknown connection type: "" 427 428 multiline 429 host all all all "" 430 ---- 431 error: line 1: cannot use empty string as authentication method 432 433 multiline 434 host all all "" cert 435 ---- 436 error: line 1: cannot use empty string as address 437 438 subtest end 439 440 subtest quoted_options 441 442 multiline 443 host all all all gss k=v " someopt = withspaces " 444 ---- 445 # String render check: 446 # Original configuration: 447 # host all all all gss k=v " someopt = withspaces " 448 # 449 # Interpreted configuration: 450 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 451 host all all all gss k=v " someopt = withspaces " 452 # Detail: 453 &hba.Conf{ 454 Entries: { 455 { 456 ConnType: 6, 457 Database: { 458 {Value:"all", Quoted:false}, 459 }, 460 User: { 461 {Value:"all", Quoted:false}, 462 }, 463 Address: hba.String{Value:"all", Quoted:false}, 464 Method: hba.String{Value:"gss", Quoted:false}, 465 MethodFn: nil, 466 Options: { 467 {"k", "v"}, 468 {" someopt ", " withspaces "}, 469 }, 470 OptionQuotes: {false, true}, 471 Input: "host all all all gss k=v \" someopt = withspaces \"", 472 Generated: false, 473 }, 474 }, 475 } 476 477 subtest end 478 479 subtest invalid_string 480 481 multiline 482 host "all all 0.0.0.0/0 trust 483 ---- 484 error: line 1: unterminated quoted string 485 486 subtest end 487 488 subtest empty_conf 489 490 multiline 491 # no line 492 493 # to be found here 494 ---- 495 # String render check: 496 # (empty configuration) 497 # Detail: 498 &hba.Conf{} 499 500 subtest end 501 502 subtest error_lineno 503 504 multiline 505 local all all cert 506 host invalid 507 ---- 508 error: line 2: end-of-line before role specification 509 510 subtest end 511 512 subtest options 513 514 multiline 515 host all all root cert-password ignored=value 516 host all all all gss krb_realm=other include_realm=0 krb_realm=te-st12.COM 517 ---- 518 # String render check: 519 # Original configuration: 520 # host all all root cert-password ignored=value 521 # host all all all gss krb_realm=other include_realm=0 krb_realm=te-st12.COM 522 # 523 # Interpreted configuration: 524 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 525 host all all root cert-password ignored=value 526 host all all all gss krb_realm=other include_realm=0 krb_realm=te-st12.COM 527 # Detail: 528 &hba.Conf{ 529 Entries: { 530 { 531 ConnType: 6, 532 Database: { 533 {Value:"all", Quoted:false}, 534 }, 535 User: { 536 {Value:"all", Quoted:false}, 537 }, 538 Address: hba.String{Value:"root", Quoted:false}, 539 Method: hba.String{Value:"cert-password", Quoted:false}, 540 MethodFn: nil, 541 Options: { 542 {"ignored", "value"}, 543 }, 544 OptionQuotes: {false}, 545 Input: "host all all root cert-password ignored=value", 546 Generated: false, 547 }, 548 { 549 ConnType: 6, 550 Database: { 551 {Value:"all", Quoted:false}, 552 }, 553 User: { 554 {Value:"all", Quoted:false}, 555 }, 556 Address: hba.String{Value:"all", Quoted:false}, 557 Method: hba.String{Value:"gss", Quoted:false}, 558 MethodFn: nil, 559 Options: { 560 {"krb_realm", "other"}, 561 {"include_realm", "0"}, 562 {"krb_realm", "te-st12.COM"}, 563 }, 564 OptionQuotes: {false, false, false}, 565 Input: "host all all all gss krb_realm=other include_realm=0 krb_realm=te-st12.COM", 566 Generated: false, 567 }, 568 }, 569 } 570 571 subtest end 572 573 subtest more_all_tests 574 575 multiline 576 host db all 0.0.0.0/0 cert 577 host "all" "all" 0.0.0.0/0 cert 578 ---- 579 # String render check: 580 # Original configuration: 581 # host db all 0.0.0.0/0 cert 582 # host "all" "all" 0.0.0.0/0 cert 583 # 584 # Interpreted configuration: 585 # TYPE DATABASE USER ADDRESS METHOD OPTIONS 586 host db all 0.0.0.0/0 cert 587 host "all" "all" 0.0.0.0/0 cert 588 # Detail: 589 &hba.Conf{ 590 Entries: { 591 { 592 ConnType: 6, 593 Database: { 594 {Value:"db", Quoted:false}, 595 }, 596 User: { 597 {Value:"all", Quoted:false}, 598 }, 599 Address: &net.IPNet{ 600 IP: {0x0, 0x0, 0x0, 0x0}, 601 Mask: {0x0, 0x0, 0x0, 0x0}, 602 }, 603 Method: hba.String{Value:"cert", Quoted:false}, 604 MethodFn: nil, 605 Options: nil, 606 OptionQuotes: nil, 607 Input: "host db all 0.0.0.0/0 cert", 608 Generated: false, 609 }, 610 { 611 ConnType: 6, 612 Database: { 613 {Value:"all", Quoted:true}, 614 }, 615 User: { 616 {Value:"all", Quoted:true}, 617 }, 618 Address: &net.IPNet{ 619 IP: {0x0, 0x0, 0x0, 0x0}, 620 Mask: {0x0, 0x0, 0x0, 0x0}, 621 }, 622 Method: hba.String{Value:"cert", Quoted:false}, 623 MethodFn: nil, 624 Options: nil, 625 OptionQuotes: nil, 626 Input: "host \"all\" \"all\" 0.0.0.0/0 cert", 627 Generated: false, 628 }, 629 }, 630 } 631 632 subtest end