final ExtensionList<CredentialsProvider> providers = all(); return new Iterable<CredentialsStore>() { public Iterator<CredentialsStore> iterator() {
final ExtensionList<CredentialsProvider> providers = all(); return new Iterable<CredentialsStore>() { public Iterator<CredentialsStore> iterator() {
/** * Tests if the supplied context has any credentials stores associated with it. * * @param context the context object. * @return {@code true} if and only if the supplied context has at least one {@link CredentialsStore} associated * with it. * @since 2.1.5 */ public static boolean hasStores(final ModelObject context) { for (CredentialsProvider p : all()) { if (p.isEnabled(context) && p.getStore(context) != null) { return true; } } return false; }
/** * Tests if the supplied context has any credentials stores associated with it. * * @param context the context object. * @return {@code true} if and only if the supplied context has at least one {@link CredentialsStore} associated * with it. * @since 2.1.5 */ public static boolean hasStores(final ModelObject context) { for (CredentialsProvider p : all()) { if (p.isEnabled(context) && p.getStore(context) != null) { return true; } } return false; }
/** * Returns the scopes allowed for credentials stored within the specified object or {@code null} if the * object is not relevant for scopes and the object's container should be considered instead. * * @param object the object. * @return the set of scopes that are relevant for the object or {@code null} if the object is not a credentials * container. */ @CheckForNull public static Set<CredentialsScope> lookupScopes(ModelObject object) { object = CredentialsDescriptor.unwrapContext(object); Set<CredentialsScope> result = null; for (CredentialsProvider provider : all()) { if (provider.isEnabled(object)) { try { Set<CredentialsScope> scopes = provider.getScopes(object); if (scopes != null) { // if multiple providers for the same object, then combine scopes if (result == null) { result = new LinkedHashSet<CredentialsScope>(); } result.addAll(scopes); } } catch (NoClassDefFoundError e) { // ignore optional dependency } } } return result; }
/** * Returns the scopes allowed for credentials stored within the specified object or {@code null} if the * object is not relevant for scopes and the object's container should be considered instead. * * @param object the object. * @return the set of scopes that are relevant for the object or {@code null} if the object is not a credentials * container. */ @CheckForNull public static Set<CredentialsScope> lookupScopes(ModelObject object) { object = CredentialsDescriptor.unwrapContext(object); Set<CredentialsScope> result = null; for (CredentialsProvider provider : all()) { if (provider.isEnabled(object)) { try { Set<CredentialsScope> scopes = provider.getScopes(object); if (scopes != null) { // if multiple providers for the same object, then combine scopes if (result == null) { result = new LinkedHashSet<CredentialsScope>(); } result.addAll(scopes); } } catch (NoClassDefFoundError e) { // ignore optional dependency } } } return result; }
for (CredentialsProvider provider : all()) { if (provider.isEnabled(itemGroup) && provider.isApplicable(type)) { try {
for (CredentialsProvider provider : all()) { if (provider.isEnabled(itemGroup) && provider.isApplicable(type)) { try {
for (CredentialsProvider provider : all()) { if (provider.isEnabled(item) && provider.isApplicable(type)) { try {
for (CredentialsProvider provider : all()) { if (provider.isEnabled(item) && provider.isApplicable(type)) { try {
for (CredentialsProvider provider : all()) { if (provider.isEnabled(itemGroup) && provider.isApplicable(type)) { try {
for (CredentialsProvider provider : all()) { if (provider.isEnabled(itemGroup) && provider.isApplicable(type)) { try {
for (CredentialsProvider provider : all()) { if (provider.isEnabled(item) && provider.isApplicable(type)) { try {
for (CredentialsProvider provider : all()) { if (provider.isEnabled(item) && provider.isApplicable(type)) { try {