@@ -77,7 +77,6 @@ type (
|
||||
SignedAt *time.Time
|
||||
State coredata.DocumentVersionSignatureState
|
||||
RequestedAt time.Time
|
||||
RequestedBy string
|
||||
}
|
||||
)
|
||||
|
||||
@@ -95,7 +94,6 @@ func RenderHTML(data DocumentData) ([]byte, error) {
|
||||
|
||||
for i := range data.Signatures {
|
||||
data.Signatures[i].SignedBy = html.EscapeString(data.Signatures[i].SignedBy)
|
||||
data.Signatures[i].RequestedBy = html.EscapeString(data.Signatures[i].RequestedBy)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
|
||||
@@ -50,7 +50,6 @@ func TestRenderHTML(t *testing.T) {
|
||||
SignedAt: &now,
|
||||
State: coredata.DocumentVersionSignatureStateSigned,
|
||||
RequestedAt: now,
|
||||
RequestedBy: "Bob Johnson",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -64,7 +63,6 @@ func TestRenderHTML(t *testing.T) {
|
||||
"John Doe",
|
||||
"Test document description",
|
||||
"Alice Smith",
|
||||
"Bob Johnson",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -76,9 +74,8 @@ func TestRenderHTML(t *testing.T) {
|
||||
Description: "Description with & symbols and <tags>",
|
||||
Signatures: []SignatureData{
|
||||
{
|
||||
SignedBy: "Alice & <Bob>",
|
||||
RequestedBy: "Carol <script>",
|
||||
State: coredata.DocumentVersionSignatureStateRequested,
|
||||
SignedBy: "Alice & <Bob>",
|
||||
State: coredata.DocumentVersionSignatureStateRequested,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -87,7 +84,6 @@ func TestRenderHTML(t *testing.T) {
|
||||
"John &lt;script&gt;alert(&#39;xss&#39;)&lt;/script&gt; Doe",
|
||||
"Description with &amp; symbols and &lt;tags&gt;",
|
||||
"Alice &amp; &lt;Bob&gt;",
|
||||
"Carol &lt;script&gt;",
|
||||
},
|
||||
wantNotContains: []string{
|
||||
"<script>alert('xss')</script>",
|
||||
@@ -138,21 +134,17 @@ func TestRenderHTML(t *testing.T) {
|
||||
SignedAt: &now,
|
||||
State: coredata.DocumentVersionSignatureStateSigned,
|
||||
RequestedAt: now,
|
||||
RequestedBy: "Requester 1",
|
||||
},
|
||||
{
|
||||
SignedBy: "Signer 2",
|
||||
State: coredata.DocumentVersionSignatureStateRequested,
|
||||
RequestedAt: now,
|
||||
RequestedBy: "Requester 2",
|
||||
},
|
||||
},
|
||||
},
|
||||
wantContains: []string{
|
||||
"Signer 1",
|
||||
"Signer 2",
|
||||
"Requester 1",
|
||||
"Requester 2",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -268,9 +260,8 @@ func TestHTMLEscaping(t *testing.T) {
|
||||
Description: "Text with 'quotes' & \"double quotes\"",
|
||||
Signatures: []SignatureData{
|
||||
{
|
||||
SignedBy: "<malicious>tag",
|
||||
RequestedBy: "User & Company",
|
||||
State: coredata.DocumentVersionSignatureStateRequested,
|
||||
SignedBy: "<malicious>tag",
|
||||
State: coredata.DocumentVersionSignatureStateRequested,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -357,7 +348,6 @@ func TestDocumentVersionSignatureStates(t *testing.T) {
|
||||
SignedBy: "Test User",
|
||||
State: state,
|
||||
RequestedAt: now,
|
||||
RequestedBy: "Requester",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -407,7 +397,6 @@ func BenchmarkGenerateHTML(b *testing.B) {
|
||||
SignedAt: &now,
|
||||
State: coredata.DocumentVersionSignatureStateSigned,
|
||||
RequestedAt: now,
|
||||
RequestedBy: "Bob Johnson",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -358,7 +358,6 @@
|
||||
<th>Status</th>
|
||||
<th>Requested Date</th>
|
||||
<th>Signed Date</th>
|
||||
<th>Requested By</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -380,7 +379,6 @@
|
||||
-
|
||||
{{- end}}
|
||||
</td>
|
||||
<td>{{.RequestedBy}}</td>
|
||||
</tr>
|
||||
{{- end}}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user