-
Notifications
You must be signed in to change notification settings - Fork 250
New credentials dialog #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 91 commits
852e45a
b633bf9
27276a3
10b4636
8d9e091
9302a64
2f8f1dd
e30d6ed
a06256d
08fd291
600c93d
1a1805b
4a94613
4bcb15b
b6353cd
850049f
2947831
ce2e83f
a5ed6be
a41d5cf
3b0cb04
02d734e
0123378
f9b420a
18109b0
8df7aa8
21f5196
b8944f9
4645df8
0ccee24
d3a89e3
04ff0d9
245d836
a44f0f3
e1858f3
c89f3bd
84650ef
afdf656
fba7ea0
c642caa
56fc28e
38491b1
26bee01
17775bf
8db3ac8
b2e16f1
0fcbe92
f2ad90f
3ef9688
04dad00
8482a8c
3587fb2
662de8e
a7c87bf
2db0e2d
2cbd2b6
d7c1500
eb8ec31
f9f5d5d
1336234
6a068f6
bc6cea6
02ba7e3
6737634
6608c61
e6908be
7c86666
8498ed0
951099e
88156c8
e75bf3e
763ccf2
81a7f5b
c93c995
c1510d4
9a64610
ce76505
d4fc4d8
658fbbf
0474461
fff6ff2
b126aa8
28c48d6
4352625
b9065c9
14d1765
d409620
2b9f561
e33fa7b
c07aa45
179773d
997bfa0
4fe9e4e
172b32e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,13 +43,17 @@ | |
| import java.util.ArrayList; | ||
| import java.util.Collection; | ||
| import java.util.HashSet; | ||
| import java.util.LinkedHashMap; | ||
| import java.util.List; | ||
| import java.util.Locale; | ||
| import java.util.Map; | ||
| import java.util.Objects; | ||
| import java.util.Set; | ||
| import java.util.TreeMap; | ||
| import java.util.logging.Level; | ||
| import java.util.logging.Logger; | ||
| import java.util.stream.Collectors; | ||
| import java.util.stream.StreamSupport; | ||
|
|
||
| import jakarta.servlet.ServletException; | ||
| import jenkins.model.Jenkins; | ||
|
|
@@ -121,6 +125,26 @@ | |
| return context instanceof ModelObject mo ? mo : CredentialsDescriptor.findContextInPath(ModelObject.class); | ||
| } | ||
|
|
||
| /** | ||
| * @return modifiable store actions for the context provided. | ||
| */ | ||
| @Restricted(NoExternalUse.class) | ||
| public Map<String, List<CredentialsStoreAction.DomainWrapper>> getModifiableStoreActions(ModelObject context) { | ||
| return StreamSupport.stream(CredentialsProvider.lookupStores(context).spliterator(), false) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| .filter(s -> s.hasPermission(CredentialsProvider.CREATE)) | ||
| .map(CredentialsStore::getStoreAction) | ||
timja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .filter(Objects::nonNull) | ||
| .collect(Collectors.toMap( | ||
| CredentialsStoreAction::getDisplayName, | ||
| store -> new ArrayList<>(store.getDomains().values()), | ||
| (left, right) -> { | ||
| left.addAll(right); | ||
| return left; | ||
| }, | ||
| LinkedHashMap::new | ||
| )); | ||
| } | ||
|
|
||
| /** | ||
| * Returns the {@link StoreItem} instances for the current Stapler request. | ||
| * | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
| ~ The MIT License | ||
| ~ | ||
| ~ Copyright (c) 2011-2016, CloudBees, Inc., Stephen Connolly. | ||
| ~ | ||
| ~ Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| ~ of this software and associated documentation files (the "Software"), to deal | ||
| ~ in the Software without restriction, including without limitation the rights | ||
| ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| ~ copies of the Software, and to permit persons to whom the Software is | ||
| ~ furnished to do so, subject to the following conditions: | ||
| ~ | ||
| ~ The above copyright notice and this permission notice shall be included in | ||
| ~ all copies or substantial portions of the Software. | ||
| ~ | ||
| ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| ~ THE SOFTWARE. | ||
| --> | ||
| <?jelly escape-by-default='true'?> | ||
| <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:f="/lib/form"> | ||
| <st:setHeader name="X-Wizard-Title" value="${%Add Credentials}" /> | ||
|
|
||
| <l:ajax> | ||
|
|
||
| <j:set var="relativePath" value="${request2.getParameter('relativePath')}"/> | ||
|
|
||
| <j:choose> | ||
| <j:when test="${request2.getParameter('refill') == 'true'}"> | ||
| <j:set var="query" value="?refill=true&relativePath=${relativePath}"/> | ||
| </j:when> | ||
| <j:otherwise> | ||
| <j:set var="query" value="?relativePath=${relativePath}"/> | ||
| </j:otherwise> | ||
| </j:choose> | ||
|
|
||
| <form action="${relativePath}dialog2${query}" method="GET" name="dialog"> | ||
| <fieldset class="jenkins-!-display-contents"> | ||
| <div> | ||
| <legend class="jenkins-form-label">${%Select a type of credential}</legend> | ||
| <div class="jenkins-choice-list"> | ||
| <j:forEach var="kind" items="${it.store.credentialsDescriptors}"> | ||
| <div class="jenkins-choice-list__item"> | ||
| <label> | ||
| <div class="jenkins-choice-list__item__icon"> | ||
| <l:icon src="${kind.iconClassName}" /> | ||
| </div> | ||
| <input type="radio" name="kind" value="${kind.id}" /> | ||
| <div class="jenkins-choice-list__item__label"> | ||
| ${kind.displayName} | ||
| </div> | ||
| <j:if test="${kind.description != null}"> | ||
| <div class="jenkins-choice-list__item__description">${kind.description}</div> | ||
| </j:if> | ||
| </label> | ||
| </div> | ||
| </j:forEach> | ||
| </div> | ||
| </div> | ||
| </fieldset> | ||
|
|
||
| <f:bottomButtonBar borderless="true"> | ||
| <button id="cr-dialog-next" class="jenkins-button jenkins-button--primary cr-bottom-button" disabled="true">${%Next}</button> | ||
| </f:bottomButtonBar> | ||
| </form> | ||
| </l:ajax> | ||
| </j:jelly> |

Uh oh!
There was an error while loading. Please reload this page.