From d0e1a89db72ed1bc66049be3e8459a07cb640cdb Mon Sep 17 00:00:00 2001 From: Juerg Wullschleger Date: Wed, 11 Sep 2024 05:04:18 -0700 Subject: [PATCH] Add public testonly package that returns a insecuresecretdataaccess.Token. #tinkApiChange PiperOrigin-RevId: 673345298 Change-Id: Id49763c1ca0b2b72b0fafd9ab6256af89adae838 --- .../insecuresecretdataaccesstest/BUILD.bazel | 20 ++++++++++++++++ .../insecuresecretdataaccesstest.go | 24 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 testing/insecuresecretdataaccesstest/BUILD.bazel create mode 100644 testing/insecuresecretdataaccesstest/insecuresecretdataaccesstest.go diff --git a/testing/insecuresecretdataaccesstest/BUILD.bazel b/testing/insecuresecretdataaccesstest/BUILD.bazel new file mode 100644 index 0000000..531a2b1 --- /dev/null +++ b/testing/insecuresecretdataaccesstest/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +package(default_visibility = ["//:__subpackages__"]) # keep + +licenses(["notice"]) # keep + +go_library( + name = "insecuresecretdataaccesstest", + testonly = 1, + srcs = ["insecuresecretdataaccesstest.go"], + importpath = "github.com/tink-crypto/tink-go/v2/testing/insecuresecretdataaccesstest", + visibility = ["//visibility:public"], + deps = ["//insecuresecretdataaccess"], +) + +alias( + name = "go_default_library", + actual = ":insecuresecretdataaccesstest", + visibility = ["//visibility:public"], +) diff --git a/testing/insecuresecretdataaccesstest/insecuresecretdataaccesstest.go b/testing/insecuresecretdataaccesstest/insecuresecretdataaccesstest.go new file mode 100644 index 0000000..d8f39ac --- /dev/null +++ b/testing/insecuresecretdataaccesstest/insecuresecretdataaccesstest.go @@ -0,0 +1,24 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package insecuresecretdataaccesstest provides a utility function to obtain a +// [insecuresecretdataaccess.Token] value to use in tests. +package insecuresecretdataaccesstest + +import "github.com/tink-crypto/tink-go/v2/insecuresecretdataaccess" + +// Token returns a [insecuresecretdataaccess.Token] for use in tests. +func Token() insecuresecretdataaccess.Token { + return insecuresecretdataaccess.Token{} +}