Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
9b0ba805
Commit
9b0ba805
authored
4 years ago
by
Nate Rini
Committed by
Tim Wickberg
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
auth/jwt - add jwt_key option to AuthAltParameters
Bug 10018.
parent
f55bc2ca
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/man/man5/slurm.conf.5
+7
-0
7 additions, 0 deletions
doc/man/man5/slurm.conf.5
doc/man/man5/slurmdbd.conf.5
+6
-0
6 additions, 0 deletions
doc/man/man5/slurmdbd.conf.5
src/plugins/auth/jwt/auth_jwt.c
+34
-6
34 additions, 6 deletions
src/plugins/auth/jwt/auth_jwt.c
with
47 additions
and
6 deletions
doc/man/man5/slurm.conf.5
+
7
−
0
View file @
9b0ba805
...
...
@@ -352,6 +352,13 @@ will permit for communication. Acceptable values at present include "auth/jwt".
\fBAuthAltParameters\fR
Used to define alternative authentication plugins options. Multiple options may
be comma separated.
.RS
.TP 15
\fBjwt_key=\fR
Absolute path to JWT key file. Key must be HS256, and should only be accessible
by SlurmUser. If not set, the default key file is jwt_hs256.key in
\fIStateSaveLocation\fR.
.RE
.TP
\fBAuthInfo\fR
...
...
This diff is collapsed.
Click to expand it.
doc/man/man5/slurmdbd.conf.5
+
6
−
0
View file @
9b0ba805
...
...
@@ -138,6 +138,12 @@ will permit for communication.
\fBAuthAltParameters\fR
Used to define alternative authentication plugins options. Multiple options may
be comma separated.
.RS
.TP 15
\fBjwt_key=\fR
Absolute path to JWT key file. Key must be HS256, and should only be accessible
by SlurmUser.
.RE
.TP
\fBAuthType\fR
...
...
This diff is collapsed.
Click to expand it.
src/plugins/auth/jwt/auth_jwt.c
+
34
−
6
View file @
9b0ba805
...
...
@@ -115,17 +115,45 @@ __thread char *thread_username = NULL;
static
int
_init_key
(
void
)
{
char
*
key_file
=
xstrdup
(
slurm_conf
.
state_save_location
);
xstrcat
(
key_file
,
"/jwt_hs256.key"
);
key
=
create_mmap_buf
(
key_file
);
if
(
!
key
)
{
char
*
key_file
=
NULL
;
if
(
slurm_conf
.
authalt_params
&&
slurm_conf
.
authalt_params
[
0
])
{
const
char
*
jwt_key_field
=
"jwt_key="
;
char
*
begin
=
xstrcasestr
(
slurm_conf
.
authalt_params
,
jwt_key_field
);
/* find the begin and ending offsets of the jwt_key */
if
(
begin
)
{
char
*
start
=
begin
+
sizeof
(
jwt_key_field
);
char
*
end
=
NULL
;
if
((
end
=
xstrstr
(
start
,
","
)))
key_file
=
xstrndup
(
start
,
(
end
-
start
));
else
key_file
=
xstrdup
(
start
);
}
}
if
(
!
key_file
&&
slurm_conf
.
state_save_location
)
{
const
char
*
default_key
=
"jwt_hs256.key"
;
/* default to state_save_location for slurmctld */
xstrfmtcat
(
key_file
,
"%s/%s"
,
slurm_conf
.
state_save_location
,
default_key
);
}
if
(
!
key_file
)
return
ESLURM_AUTH_SKIP
;
debug
(
"%s: Loading key: %s"
,
__func__
,
key_file
);
if
(
!
(
key
=
create_mmap_buf
(
key_file
)))
{
error
(
"%s: Could not load key file (%s)"
,
plugin_type
,
key_file
);
xfree
(
key_file
);
return
SLURM_ERROR
;
return
E
SLURM_
AUTH_FOPEN_
ERROR
;
}
xfree
(
key_file
);
xfree
(
key_file
);
return
SLURM_SUCCESS
;
}
...
...
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