/** * Get all classes of custom endpoint configuration object registered. * * @return classes that are keys in the custom object store */ public Collection<Class<?>> instanceKeys() { return customObjects.keys(); }
/** * Will add all principals and credentials from another subject to this subject, will not replace {@link #principals()}. * * @param another the other subject to combine with this subject * @return a new subject that is a combination of this subject and the other subject, this subject is more significant */ public Subject combine(Subject another) { Builder builder = Subject.builder() .addPrincipal(this.principal); // add this subject principals.forEach(builder::addPrincipal); privateCredentials.keys().forEach(key -> builder.addPrivateCredential(key, privateCredentials.getInstance(key))); publicCredentials.keys().forEach(key -> builder.addPublicCredential(key, publicCredentials.getInstance(key))); grants.forEach(builder::addGrant); attributes.abacAttributeNames().forEach(key -> builder.addAttribute(key, attributes.abacAttribute(key))); // add the other subject another.principals.forEach(builder::addPrincipal); another.privateCredentials.keys() .forEach(key -> builder.addPrivateCredential(key, another.privateCredentials.getInstance(key))); another.publicCredentials.keys() .forEach(key -> builder.addPublicCredential(key, another.publicCredentials.getInstance(key))); another.grants.forEach(builder::addGrant); another.attributes.abacAttributeNames().forEach(key -> builder.addAttribute(key, another.attributes.abacAttribute(key))); return builder.build(); }