/** * Returns the credentials provided by this provider which are available to the specified {@link Authentication} * for the specified {@link Item} * * @param type the type of credentials to return. * @param item the item. * @param authentication the authentication (if {@code null} assume {@link hudson.security.ACL#SYSTEM}. * @param <C> the credentials type. * @return the list of credentials. */ @NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication) { item.getClass(); return getCredentials(type, item.getParent(), authentication); }
/** * Returns the credentials provided by this provider which are available to the specified {@link Authentication} * for the specified {@link Item} * * @param type the type of credentials to return. * @param item the item. * @param authentication the authentication (if {@code null} assume {@link hudson.security.ACL#SYSTEM}. * @param <C> the credentials type. * @return the list of credentials. */ @NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication) { item.getClass(); return getCredentials(type, item.getParent(), authentication); }
/** * {@inheritDoc} */ @NonNull @Override public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { if (item instanceof AbstractFolder) { // credentials defined in the folder should be available in the context of the folder return getCredentials(type, (ItemGroup) item, authentication, domainRequirements); } return super.getCredentials(type, item, authentication, domainRequirements); }
if (provider.isEnabled(itemGroup) && provider.isApplicable(type)) { try { for (C c : provider.getCredentials(type, itemGroup, authentication, domainRequirements)) { if (!(c instanceof IdCredentials) || ids.add(((IdCredentials) c).getId())) {
/** * {@inheritDoc} */ @NonNull @Override public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { if (item instanceof AbstractFolder) { // credentials defined in the folder should be available in the context of the folder return getCredentials(type, (ItemGroup) item, authentication, domainRequirements); } return super.getCredentials(type, item, authentication, domainRequirements); }
/** * Returns the credentials provided by this provider which are available to the specified {@link Authentication} * for items in the specified {@link ItemGroup} and are appropriate for the specified {@link com.cloudbees * .plugins.credentials.domains.DomainRequirement}s. * * @param type the type of credentials to return. * @param itemGroup the item group (if {@code null} assume {@link hudson.model.Hudson#getInstance()}. * @param authentication the authentication (if {@code null} assume {@link hudson.security.ACL#SYSTEM}. * @param domainRequirements the credential domains to match (if the {@link CredentialsProvider} does not support * {@link DomainRequirement}s then it should * assume the match is true). * @param <C> the credentials type. * @return the list of credentials. * @since 1.5 */ @NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { return getCredentials(type, itemGroup, authentication); }
if (provider.isEnabled(itemGroup) && provider.isApplicable(type)) { try { for (C c : provider.getCredentials(type, itemGroup, authentication, domainRequirements)) { if (!(c instanceof IdCredentials) || ids.add(((IdCredentials) c).getId())) {
/** * Returns the credentials provided by this provider which are available to the specified {@link Authentication} * for items in the specified {@link ItemGroup} and are appropriate for the specified {@link com.cloudbees * .plugins.credentials.domains.DomainRequirement}s. * * @param type the type of credentials to return. * @param itemGroup the item group (if {@code null} assume {@link hudson.model.Hudson#getInstance()}. * @param authentication the authentication (if {@code null} assume {@link hudson.security.ACL#SYSTEM}. * @param domainRequirements the credential domains to match (if the {@link CredentialsProvider} does not support * {@link DomainRequirement}s then it should * assume the match is true). * @param <C> the credentials type. * @return the list of credentials. * @since 1.5 */ @NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { return getCredentials(type, itemGroup, authentication); }
if (provider.isEnabled(item) && provider.isApplicable(type)) { try { for (C c: provider.getCredentials(type, item, authentication, domainRequirements)) { if (!(c instanceof IdCredentials) || ids.add(((IdCredentials) c).getId())) {
if (provider.isEnabled(item) && provider.isApplicable(type)) { try { for (C c: provider.getCredentials(type, item, authentication, domainRequirements)) { if (!(c instanceof IdCredentials) || ids.add(((IdCredentials) c).getId())) {
/** * Returns the credentials provided by this provider which are available to the specified {@link Authentication} * for the specified {@link Item} and are appropriate for the specified {@link DomainRequirement}s. * * @param type the type of credentials to return. * @param item the item. * @param authentication the authentication (if {@code null} assume {@link hudson.security.ACL#SYSTEM}. * @param domainRequirements the credential domain to match. * @param <C> the credentials type. * @return the list of credentials. * @since 1.5 */ @NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { return getCredentials(type, item instanceof ItemGroup ? (ItemGroup) item : item.getParent(), authentication, domainRequirements); }
/** * Returns the credentials provided by this provider which are available to the specified {@link Authentication} * for the specified {@link Item} and are appropriate for the specified {@link DomainRequirement}s. * * @param type the type of credentials to return. * @param item the item. * @param authentication the authentication (if {@code null} assume {@link hudson.security.ACL#SYSTEM}. * @param domainRequirements the credential domain to match. * @param <C> the credentials type. * @return the list of credentials. * @since 1.5 */ @NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { return getCredentials(type, item instanceof ItemGroup ? (ItemGroup) item : item.getParent(), authentication, domainRequirements); }
@NonNull CredentialsMatcher matcher) { ListBoxModel result = new ListBoxModel(); for (IdCredentials c : getCredentials(type, itemGroup, authentication, domainRequirements)) { if (matcher.matches(c)) { result.add(CredentialsNameProvider.name(c), c.getId());
@NonNull CredentialsMatcher matcher) { ListBoxModel result = new ListBoxModel(); for (IdCredentials c : getCredentials(type, itemGroup, authentication, domainRequirements)) { if (matcher.matches(c)) { result.add(CredentialsNameProvider.name(c), c.getId());
for (IdCredentials c : getCredentials(type, item, authentication, domainRequirements)) { if (matcher.matches(c)) { result.add(CredentialsNameProvider.name(c), c.getId());
for (IdCredentials c : getCredentials(type, item, authentication, domainRequirements)) { if (matcher.matches(c)) { result.add(CredentialsNameProvider.name(c), c.getId());