Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
a701d8c6
Commit
a701d8c6
authored
Jul 16, 2023
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove client-side support for protocol version 1.
parent
a845e9f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
27 deletions
+11
-27
static/galene.js
static/galene.js
+5
-13
static/protocol.js
static/protocol.js
+6
-14
No files found.
static/galene.js
View file @
a701d8c6
...
...
@@ -3164,23 +3164,15 @@ function parseExpiration(s) {
return
d
;
}
function
protocol2Predicate
()
{
if
(
serverConnection
.
version
===
"
1
"
)
return
"
This server is too old
"
;
return
null
;
}
function
makeTokenPredicate
()
{
return
protocol2Predicate
()
||
(
serverConnection
.
permissions
.
indexOf
(
'
token
'
)
<
0
?
"
You don't have permission to create tokens
"
:
null
);
return
(
serverConnection
.
permissions
.
indexOf
(
'
token
'
)
<
0
?
"
You don't have permission to create tokens
"
:
null
);
}
function
editTokenPredicate
()
{
return
protocol2Predicate
()
||
(
serverConnection
.
permissions
.
indexOf
(
'
token
'
)
<
0
||
serverConnection
.
permissions
.
indexOf
(
'
op
'
)
<
0
?
"
You don't have permission to edit or list tokens
"
:
null
);
return
(
serverConnection
.
permissions
.
indexOf
(
'
token
'
)
<
0
||
serverConnection
.
permissions
.
indexOf
(
'
op
'
)
<
0
?
"
You don't have permission to edit or list tokens
"
:
null
);
}
/**
...
...
static/protocol.js
View file @
a701d8c6
...
...
@@ -298,7 +298,7 @@ ServerConnection.prototype.connect = async function(url) {
this
.
socket
.
onopen
=
function
(
e
)
{
sc
.
send
({
type
:
'
handshake
'
,
version
:
[
"
2
"
,
"
1
"
],
version
:
[
"
2
"
],
id
:
sc
.
id
,
});
if
(
sc
.
onconnected
)
...
...
@@ -332,19 +332,11 @@ ServerConnection.prototype.connect = async function(url) {
let
m
=
JSON
.
parse
(
e
.
data
);
switch
(
m
.
type
)
{
case
'
handshake
'
:
{
/** @type {string} */
let
v
;
if
(
!
m
.
version
||
!
(
m
.
version
instanceof
Array
)
||
m
.
version
.
length
<
1
||
typeof
(
m
.
version
[
0
])
!==
'
string
'
)
{
v
=
null
;
}
else
{
v
=
m
.
version
[
0
];
}
if
(
v
===
"
1
"
||
v
===
"
2
"
)
{
sc
.
version
=
v
;
}
else
{
console
.
warn
(
`Unknown protocol version
${
v
||
m
.
version
}
`
);
sc
.
version
=
"
1
"
if
(
m
.
version
===
"
2
"
)
sc
.
version
=
m
.
version
;
else
{
console
.
error
(
`Unknown protocol version
${
m
.
version
}
`
);
throw
new
Error
(
`Unknown protocol version
${
m
.
version
}
`
);
}
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment