Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod-shell
Commits
36c813a1a49b
Commit
36c813a1
authored
Aug 04, 2021
by
Georges Racinet
🦑
Browse files
Merged upstream v13.18.1 in heptapod-stable branch
parents
60de6f7c8570
1661e9f5cdc0
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
36c813a1
v13.18.1
- Modify regex to prevent partial matches
v13.18.0
- Fix thread-safety issues in gitlab-shell !463
...
...
VERSION
View file @
36c813a1
13.18.
0
13.18.
1
internal/command/commandargs/command_args_test.go
View file @
36c813a1
...
...
@@ -23,11 +23,10 @@
env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
},
arguments
:
[]
string
{},
expectedArgs
:
&
Shell
{
Arguments
:
[]
string
{},
SshArgs
:
[]
string
{},
CommandType
:
Discover
,
Env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
}},
},
{
},
{
desc
:
"It finds the key id in any passed arguments"
,
executable
:
&
executable
.
Executable
{
Name
:
executable
.
GitlabShell
},
env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
},
arguments
:
[]
string
{
"hello"
,
"key-123"
},
expectedArgs
:
&
Shell
{
Arguments
:
[]
string
{
"hello"
,
"key-123"
},
SshArgs
:
[]
string
{},
CommandType
:
Discover
,
GitlabKeyId
:
"123"
,
Env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
}},
},
{
...
...
@@ -28,9 +27,15 @@
desc
:
"It finds the key id in any passed arguments"
,
executable
:
&
executable
.
Executable
{
Name
:
executable
.
GitlabShell
},
env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
},
arguments
:
[]
string
{
"hello"
,
"key-123"
},
expectedArgs
:
&
Shell
{
Arguments
:
[]
string
{
"hello"
,
"key-123"
},
SshArgs
:
[]
string
{},
CommandType
:
Discover
,
GitlabKeyId
:
"123"
,
Env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
}},
},
{
desc
:
"It finds the key id only if the argument is of <key-id> format"
,
executable
:
&
executable
.
Executable
{
Name
:
executable
.
GitlabShell
},
env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
},
arguments
:
[]
string
{
"hello"
,
"username-key-123"
},
expectedArgs
:
&
Shell
{
Arguments
:
[]
string
{
"hello"
,
"username-key-123"
},
SshArgs
:
[]
string
{},
CommandType
:
Discover
,
GitlabUsername
:
"key-123"
,
Env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
}},
},
{
desc
:
"It finds the username in any passed arguments"
,
executable
:
&
executable
.
Executable
{
Name
:
executable
.
GitlabShell
},
env
:
sshenv
.
Env
{
IsSSHConnection
:
true
,
RemoteAddr
:
"1"
},
...
...
internal/command/commandargs/shell.go
View file @
36c813a1
...
...
@@ -21,8 +21,8 @@
)
var
(
whoKeyRegex
=
regexp
.
MustCompile
(
`\
b
key-(?P<keyid>\d+)\
b
`
)
whoUsernameRegex
=
regexp
.
MustCompile
(
`\
b
username-(?P<username>\S+)\
b
`
)
whoKeyRegex
=
regexp
.
MustCompile
(
`\
A
key-(?P<keyid>\d+)\
z
`
)
whoUsernameRegex
=
regexp
.
MustCompile
(
`\
A
username-(?P<username>\S+)\
z
`
)
)
type
Shell
struct
{
...
...
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