Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RegApp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Janis Streib
RegApp
Commits
93d2681f
Commit
93d2681f
authored
9 months ago
by
Michael Simon
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/ISSUE-205_ssh-key-deletion-bugged-2' into 'main'
Resolve "SSH key deletion bugged" Closes
#205
See merge request
!82
parents
71de4f5c
97e4f79c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bwreg-webapp/src/main/java/edu/kit/scc/webreg/bean/UserSshKeyManagementBean.java
+10
-1
10 additions, 1 deletion
...ava/edu/kit/scc/webreg/bean/UserSshKeyManagementBean.java
with
10 additions
and
1 deletion
bwreg-webapp/src/main/java/edu/kit/scc/webreg/bean/UserSshKeyManagementBean.java
+
10
−
1
View file @
93d2681f
...
...
@@ -30,6 +30,10 @@ import edu.kit.scc.webreg.service.identity.IdentityService;
import
edu.kit.scc.webreg.service.ssh.SshPubKeyService
;
import
edu.kit.scc.webreg.session.SessionManager
;
import
edu.kit.scc.webreg.util.FacesMessageGenerator
;
import
java.io.IOException
;
import
jakarta.faces.context.ExternalContext
;
import
jakarta.faces.context.FacesContext
;
import
jakarta.servlet.http.HttpServletRequest
;
@Named
@ViewScoped
...
...
@@ -92,7 +96,7 @@ public class UserSshKeyManagementBean implements Serializable {
keyList
.
remove
(
k
);
sshPubKeyService
.
deleteKey
(
k
.
getPubKeyEntity
(),
"identity-"
+
identity
.
getId
());
});
messageGenerator
.
addResolvedInfoMessage
(
"info"
,
"ssh_keys.key_deleted"
,
fals
e
);
messageGenerator
.
addResolvedInfoMessage
(
"info"
,
"ssh_keys.key_deleted"
,
tru
e
);
}
public
void
deployKey
()
{
...
...
@@ -125,12 +129,17 @@ public class UserSshKeyManagementBean implements Serializable {
newKey
=
""
;
newName
=
""
;
messageGenerator
.
addResolvedInfoMessage
(
"info"
,
"ssh_key_deployed"
,
true
);
ExternalContext
ec
=
FacesContext
.
getCurrentInstance
().
getExternalContext
();
ec
.
redirect
(((
HttpServletRequest
)
ec
.
getRequest
()).
getRequestURI
());
}
catch
(
UnsupportedKeyTypeException
e
)
{
logger
.
warn
(
"An error occured whilst deploying key: "
+
e
.
getMessage
());
messageGenerator
.
addResolvedErrorMessage
(
"sshKeyMessage"
,
"error_msg"
,
e
.
toString
(),
false
);
}
catch
(
SshPubKeyBlacklistedException
e
)
{
logger
.
warn
(
"User {} tried to deploy blacklisted key"
,
identity
.
getId
());
messageGenerator
.
addResolvedErrorMessage
(
"sshKeyMessage"
,
"error"
,
"key_blacklisted"
,
true
);
}
catch
(
IOException
e
)
{
logger
.
warn
(
"An error occured trying to reload page after deploying key: "
+
e
.
getMessage
());
messageGenerator
.
addResolvedErrorMessage
(
"sshKeyMessage"
,
"error_msg"
,
e
.
toString
(),
false
);
}
}
...
...
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