#@ load("@ytt:url", "url")

url_value:
  #@ testURL1 = url.parse("http://admin:password@url.domain:8080")
  #@ testURL2 = testURL1.without_user()
  #@ testURL3 = url.parse("http://admin@url.domain:8080")
  test1: #@ testURL1.string()
  test2: #@ testURL1.user.string()
  test3: #@ testURL1.user.name
  test4: #@ testURL1.user.password
  test5: #@ testURL2.string()
  test6: #@ testURL2.user
  test7: #@ testURL3.string()
  test8: #@ testURL3.user.string()
  test9: #@ testURL3.user.name
  test10: #@ testURL3.user.password
hostname:
  name: #@ url.parse("http://admin:password@url.domain:8080").hostname()
  ipv4: #@ url.parse("http://admin:password@192.168.2.1:8080").hostname()
  ipv6: #@ url.parse("https://[2001:db8::1]:17000").hostname()

+++

url_value:
  test1: http://admin:password@url.domain:8080
  test2: admin:password
  test3: admin
  test4: password
  test5: http://url.domain:8080
  test6: null
  test7: http://admin@url.domain:8080
  test8: admin
  test9: admin
  test10: null
hostname:
  name: url.domain
  ipv4: 192.168.2.1
  ipv6: 2001:db8::1
