Skip to content
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

Deprcation warning from eduPersonAffiliation Script in the attribute_resolver.xml file #282

Open
trsau opened this issue May 16, 2019 · 0 comments

Comments

@trsau
Copy link
Contributor

trsau commented May 16, 2019

The BasicAttribute will be deprecated in the next major release and is causing a warning. The following new script remove the reference to BasicAttribute and thus the warning message...

<Script><![CDATA[
    var HashSet = Java.type("java.util.HashSet");
    var StringAttributeValue = Java.type("net.shibboleth.idp.attribute.StringAttributeValue");
    var newAffiliations = new HashSet();

    add_member = false;

    if (typeof eduPersonAffiliation != "undefined" && eduPersonAffiliation.getValues().size() >= 1) {
        for ( i = 0; i < eduPersonAffiliation.getValues().size(); i++){
            value = eduPersonAffiliation.getValues().get(i).toLowerCase();
            if ( value.equals("affiliate") ||
                value.equals("alum") ||
                value.equals("member") ||
                value.equals("library-walk-in")) {
                newAffiliations.add(new StringAttributeValue(value));
            }
            if (value.equals("student") ||
                value.equals("faculty") ||
                value.equals("staff") ||
                value.equals("employee")) {
                newAffiliations.add(new StringAttributeValue(value));
                add_member = true;
            }
        }
    }

    if (add_member) { newAffiliations.add(new StringAttributeValue("member")); }

    if (newAffiliations.size() < 1) {
        newAffiliations.add(new StringAttributeValue("affiliate"));
    }

    eduPersonAffiliation.getValues().clear();

    itr = newAffiliations.iterator();
    while(itr.hasNext()){
       eduPersonAffiliation.addValue(itr.next());
    }
]]></Script>
@trsau trsau mentioned this issue May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant