Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
go-sso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
id
go-sso
Commits
1acce89a
Commit
1acce89a
authored
7 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Automatically recompute integrity hashes in templates
Uses 'go generate' to invoke sri.py.
parent
85ff167e
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
server/bindata.go
+3
-3
3 additions, 3 deletions
server/bindata.go
server/http.go
+1
-0
1 addition, 0 deletions
server/http.go
server/sri.py
+8
-6
8 additions, 6 deletions
server/sri.py
server/templates/page.html
+2
-2
2 additions, 2 deletions
server/templates/page.html
with
14 additions
and
11 deletions
server/bindata.go
+
3
−
3
View file @
1acce89a
...
...
@@ -1239,7 +1239,7 @@ var _templatesPageHtml = []byte(`{{define "header"}}<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{if .U2FSignRequest}}<meta name="u2f_request" value="{{json .U2FSignRequest}}">{{end}}
<link rel="stylesheet" href="/static/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M">
<link rel="stylesheet" href="/static/css/signin.css" integrity="sha384-
zxlIX2SfN6SpDKbrkQNcrn07kaD/iSlYdEKRCab8ZAcTEvpWshVV4xqTpoQaeyPq
">
<link rel="stylesheet" href="/static/css/signin.css" integrity="sha384-
cd2kbbMX+cYhUlp/Xc7Mu9yBphBGNEvZpeIltWsgUMlkt1kNO3hytQQeTglDcMF/
">
<title>Sign In</title>
</head>
...
...
@@ -1255,7 +1255,7 @@ var _templatesPageHtml = []byte(`{{define "header"}}<!DOCTYPE html>
<script src="/static/js/bootstrap-4.0.0-beta.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1"></script>
{{if .U2FSignRequest}}
<script type="text/javascript" src="/static/js/u2f-api.js" integrity="sha384-9ChevE6pp8ArGK03HgolnFjZbF3webZQtYkwcabzbcI28Lx1/2x2j2fbaAWD4cgR"></script>
<script type="text/javascript" src="/static/js/u2f.js" integrity="sha384-
Aw1M0kx84dOGmcbSKwVf6MWXFfyF8YK7LFfpAPqBMG+843kqUeyHNUpEom8kSIiz
"></script>
<script type="text/javascript" src="/static/js/u2f.js" integrity="sha384-
vd6lytRvVm189G5gr34wlOvN672vVBceTZqV+lTSeec0DBLc0GlWLyKDHc6mrIZS
"></script>
{{end}}
</body>
</html>
...
...
@@ -1272,7 +1272,7 @@ func templatesPageHtml() (*asset, error) {
return
nil
,
err
}
info
:=
bindataFileInfo
{
name
:
"templates/page.html"
,
size
:
1493
,
mode
:
os
.
FileMode
(
436
),
modTime
:
time
.
Unix
(
151
0996183
,
0
)}
info
:=
bindataFileInfo
{
name
:
"templates/page.html"
,
size
:
1493
,
mode
:
os
.
FileMode
(
436
),
modTime
:
time
.
Unix
(
151
1203590
,
0
)}
a
:=
&
asset
{
bytes
:
bytes
,
info
:
info
}
return
a
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
server/http.go
+
1
−
0
View file @
1acce89a
package
server
//go:generate python sri.py templates/*.html
//go:generate go-bindata --nocompress --pkg server static/... templates/...
import
(
...
...
This diff is collapsed.
Click to expand it.
server/sri.py
+
8
−
6
View file @
1acce89a
...
...
@@ -3,9 +3,10 @@
# Automatically fix Subresource Integrity links in the HTML templates.
#
# Pass templates as command-line arguments. Expects to be run from the
# resource
s/
directory.
#
base
resource directory.
#
import
glob
import
re
import
sys
from
hashlib
import
sha384
...
...
@@ -44,9 +45,10 @@ def fix_sri(path):
if
__name__
==
'
__main__
'
:
for
path
in
sys
.
argv
[
1
:]:
try
:
fix_sri
(
path
)
except
Exception
as
e
:
print
>>
sys
.
stderr
,
"
Error fixing %s: %s
"
%
(
path
,
e
)
for
arg
in
sys
.
argv
[
1
:]:
for
path
in
glob
.
glob
(
arg
):
try
:
fix_sri
(
path
)
except
Exception
as
e
:
print
>>
sys
.
stderr
,
"
Error fixing %s: %s
"
%
(
path
,
e
)
This diff is collapsed.
Click to expand it.
server/templates/page.html
+
2
−
2
View file @
1acce89a
...
...
@@ -5,7 +5,7 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no"
>
{{if .U2FSignRequest}}
<meta
name=
"u2f_request"
value=
"{{json .U2FSignRequest}}"
>
{{end}}
<link
rel=
"stylesheet"
href=
"/static/css/bootstrap.min.css"
integrity=
"sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M"
>
<link
rel=
"stylesheet"
href=
"/static/css/signin.css"
integrity=
"sha384-
zxlIX2SfN6SpDKbrkQNcrn07kaD/iSlYdEKRCab8ZAcTEvpWshVV4xqTpoQaeyPq
"
>
<link
rel=
"stylesheet"
href=
"/static/css/signin.css"
integrity=
"sha384-
cd2kbbMX+cYhUlp/Xc7Mu9yBphBGNEvZpeIltWsgUMlkt1kNO3hytQQeTglDcMF/
"
>
<title>
Sign In
</title>
</head>
...
...
@@ -21,7 +21,7 @@
<script
src=
"/static/js/bootstrap-4.0.0-beta.min.js"
integrity=
"sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1"
></script>
{{if .U2FSignRequest}}
<script
type=
"text/javascript"
src=
"/static/js/u2f-api.js"
integrity=
"sha384-9ChevE6pp8ArGK03HgolnFjZbF3webZQtYkwcabzbcI28Lx1/2x2j2fbaAWD4cgR"
></script>
<script
type=
"text/javascript"
src=
"/static/js/u2f.js"
integrity=
"sha384-
Aw1M0kx84dOGmcbSKwVf6MWXFfyF8YK7LFfpAPqBMG+843kqUeyHNUpEom8kSIiz
"
></script>
<script
type=
"text/javascript"
src=
"/static/js/u2f.js"
integrity=
"sha384-
vd6lytRvVm189G5gr34wlOvN672vVBceTZqV+lTSeec0DBLc0GlWLyKDHc6mrIZS
"
></script>
{{end}}
</body>
</html>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment