load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "packagelock",
    srcs = [
        "inspect.go",
        "packagelock.go",
    ],
    embedsrcs = ["package-lock-rules.cue"],
    importpath = "edge-infra.dev/pkg/f8n/warehouse/packagelock",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/edge/yamlfmt",
        "//pkg/f8n/warehouse",
        "//pkg/f8n/warehouse/oci",
        "//pkg/f8n/warehouse/oci/remote",
        "//pkg/lib/build/bazel",
        "@com_github_go_logr_logr//:logr",
        "@com_github_google_go_containerregistry//pkg/authn",
        "@com_github_google_go_containerregistry//pkg/name",
        "@com_github_google_go_containerregistry//pkg/v1/google",
        "@com_github_google_go_containerregistry//pkg/v1/remote",
        "@org_cuelang_go//cue",
        "@org_cuelang_go//cue/cuecontext",
        "@org_cuelang_go//encoding/gocode/gocodec",
        "@org_cuelang_go//encoding/yaml",
        "@org_uber_go_multierr//:multierr",
    ],
)

go_test(
    name = "packagelock_test",
    srcs = ["packagelock_test.go"],
    data = glob(["testdata/**"]),
    embed = [":packagelock"],
    tags = ["requires-network"],
)