aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/google/safehtml/template/trustedtemplate.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-01-22 16:07:17 +0100
committerTaras Madan <tarasmadan@google.com>2025-01-23 10:42:36 +0000
commit7b4377ad9d8a7205416df8d6217ef2b010f89481 (patch)
treee6fec4fd12ff807a16d847923f501075bf71d16c /vendor/github.com/google/safehtml/template/trustedtemplate.go
parent475a4c203afb8b7d3af51c4fd32bb170ff32a45e (diff)
vendor: delete
Diffstat (limited to 'vendor/github.com/google/safehtml/template/trustedtemplate.go')
-rw-r--r--vendor/github.com/google/safehtml/template/trustedtemplate.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/github.com/google/safehtml/template/trustedtemplate.go b/vendor/github.com/google/safehtml/template/trustedtemplate.go
deleted file mode 100644
index bd3b1b46a..000000000
--- a/vendor/github.com/google/safehtml/template/trustedtemplate.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2017 The Go Authors. All rights reserved.
-//
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file or at
-// https://developers.google.com/open-source/licenses/bsd
-
-package template
-
-// A TrustedTemplate is an immutable string-like type containing a
-// safehtml/template template body. It can be safely loaded as template
-// text without the risk of untrusted template execution.
-//
-// In order to ensure that an attacker cannot influence the TrustedTemplate
-// value, a TrustedTemplate can be instantiated only from untyped string constants,
-// and never from arbitrary string values potentially representing untrusted user input.
-//
-type TrustedTemplate struct {
- // We declare a TrustedTemplate not as a string but as a struct wrapping a string
- // to prevent construction of TrustedTemplate values through string conversion.
- tmpl string
-}
-
-// MakeTrustedTemplate constructs a TrustedTemplate with its underlying
-// tmpl set to the given tmpl, which must be an untyped string constant.
-//
-// No runtime validation or sanitization is performed on tmpl; being under
-// application control, it is simply assumed to comply with the TrustedTemplate type
-// contract.
-func MakeTrustedTemplate(tmpl stringConstant) TrustedTemplate {
- return TrustedTemplate{string(tmpl)}
-}
-
-// String returns the string form of the TrustedTemplate.
-func (t TrustedTemplate) String() string {
- return t.tmpl
-}