playground: Add OverrideCaveatSetsValidator for use by wspr and jni.
Before this CL, we had two different mechanisms to override
caveat validation. Javascript (wspr) used a "hidden context key"
to pass a custom validator around, while Java (jni) used
security.SetCaveatValidator to set a custom function. The wspr
technique overrode the validation for all caveat sets in a
blessing, while the jni technique overrode the validation of each
individual caveat.
This CL reduces us back to a single mechanism
security.OverrideCaveatSetsValidator. This function is only
available if the "android", "nacl" or "wspr" build tags is set,
and will panic if called more than once. We restrict to these
build tags as a way to limit the exposure of the API.
MultiPart: 6/6
Change-Id: I27307345d534405466b615ad3cfedb5b3fda3ac3
diff --git a/client/lib/shell/pg_test_util.sh b/client/lib/shell/pg_test_util.sh
index ddfe837..8b9c4b4 100755
--- a/client/lib/shell/pg_test_util.sh
+++ b/client/lib/shell/pg_test_util.sh
@@ -38,10 +38,10 @@
# Installs various go binaries.
build_go_binaries() {
+ shell_test::build_go_binary 'v.io/x/ref/services/wspr/wsprd' -a -tags wspr
shell_test::build_go_binary 'v.io/x/ref/cmd/principal'
shell_test::build_go_binary 'v.io/x/ref/services/proxy/proxyd'
shell_test::build_go_binary 'v.io/x/ref/services/mounttable/mounttabled'
- shell_test::build_go_binary 'v.io/x/ref/services/wspr/wsprd'
shell_test::build_go_binary 'v.io/x/ref/cmd/vdl'
shell_test::build_go_binary 'v.io/x/playground/builder'
}
diff --git a/client/lib/shell/shell_test.sh b/client/lib/shell/shell_test.sh
index d444d68..9d8974e 100755
--- a/client/lib/shell/shell_test.sh
+++ b/client/lib/shell/shell_test.sh
@@ -136,13 +136,13 @@
shell_test::build_go_binary() {
pushd "${shell_test_BIN_DIR}" > /dev/null
local -r PACKAGE="$1"
- local OUTPUT="${2:-$(basename ${PACKAGE})}"
+ shift
+ local OUTPUT="$(basename ${PACKAGE})"
if [[ -f "${OUTPUT}" ]]; then
echo "${shell_test_BIN_DIR}/${OUTPUT}"
return
fi
-
- go build -o "${OUTPUT}" "${PACKAGE}" 2>/dev/null || shell_test::fail "line ${LINENO}: failed to build ${OUTPUT}"
+ go build -o "${OUTPUT}" "$@" "${PACKAGE}" 2>/dev/null || shell_test::fail "line ${LINENO}: failed to build ${OUTPUT}"
echo "${shell_test_BIN_DIR}/${OUTPUT}"
popd > /dev/null
}
diff --git a/go/src/v.io/x/playground/Makefile b/go/src/v.io/x/playground/Makefile
index fb27b6f..80ec7cb 100644
--- a/go/src/v.io/x/playground/Makefile
+++ b/go/src/v.io/x/playground/Makefile
@@ -16,11 +16,11 @@
# builder-deps target builds the binaries that the builder calls.
.PHONY: builder-deps
builder-deps:
+ v23 go install -a -tags wspr v.io/x/ref/services/wspr/wsprd
v23 go install v.io/x/ref/cmd/principal
v23 go install v.io/x/ref/services/identity/identityd
v23 go install v.io/x/ref/services/mounttable/mounttabled
v23 go install v.io/x/ref/services/proxy/proxyd
- v23 go install v.io/x/ref/services/wspr/wsprd
.PHONY: builder
builder: builder-deps
diff --git a/go/src/v.io/x/playground/playground_v23_test.go b/go/src/v.io/x/playground/playground_v23_test.go
index 3227b32..7b03d13 100644
--- a/go/src/v.io/x/playground/playground_v23_test.go
+++ b/go/src/v.io/x/playground/playground_v23_test.go
@@ -82,10 +82,10 @@
v23tests.RunRootMT(i, "--v23.tcp.address=127.0.0.1:0")
+ i.BuildGoPkg("v.io/x/ref/services/wspr/wsprd", "-a", "-tags", "wspr")
i.BuildGoPkg("v.io/x/ref/cmd/principal")
i.BuildGoPkg("v.io/x/ref/cmd/vdl")
i.BuildGoPkg("v.io/x/ref/services/proxy/proxyd")
- i.BuildGoPkg("v.io/x/ref/services/wspr/wsprd")
playgroundPkg := golist(i, "v.io/x/playground")
// strip last three directory components, much easier to read in