summaryrefslogtreecommitdiff
path: root/src/saml2/entity_category/swamid.py
blob: 1d4085e48e18fab4d0e1a0cb3e8ef6e889554903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
__author__ = "rolandh"

NAME = [
    "givenName",
    "displayName",
    "sn",
    "cn",
]

STATIC_ORG_INFO = [
    "c",
    "o",
    "co",
    "norEduOrgAcronym",
    "schacHomeOrganization",
    "schacHomeOrganizationType",
]

OTHER = ["eduPersonPrincipalName", "eduPersonScopedAffiliation", "mail", "eduPersonAssurance"]

R_AND_S = [
    "eduPersonPrincipalName",
    "eduPersonUniqueID",
    "mail",
    "displayName",
    "givenName",
    "sn",
    "eduPersonAssurance",
    "eduPersonScopedAffiliation",
]

GEANT_COCO = [
    "pairwise-id",
    "subject-id",
    "eduPersonTargetedID",
    "eduPersonPrincipalName",
    "eduPersonOrcid",
    "norEduPersonNIN",
    "personalIdentityNumber",
    "schacDateOfBirth",
    "mail",
    "mailLocalAddress",
    "displayName",
    "cn",
    "givenName",
    "sn",
    "eduPersonAssurance",
    "eduPersonScopedAffiliation",
    "eduPersonAffiliation",
    "o",
    "norEduOrgAcronym",
    "c",
    "co",
    "schacHomeOrganization",
    "schacHomeOrganizationType",
]

REFEDS_COCO = GEANT_COCO  # for now these two are identical

MYACADEMICID_ESI = ["schacPersonalUniqueCode"]

REFEDS_PERSONALIZED_ACCESS = [
    "subject-id",
    "mail",
    "displayName",
    "givenName",
    "sn",
    "eduPersonScopedAffiliation",
    "eduPersonAssurance",
    "schacHomeOrganization",
]

REFEDS_PSEUDONYMOUS_ACCESS = [
    "pairwise-id",
    "eduPersonScopedAffiliation",
    "eduPersonAssurance",
    "schacHomeOrganization",
]

REFEDS_ANONYMOUS_ACCESS = [
    "eduPersonScopedAffiliation",
    "schacHomeOrganization",
]


# These give you access to information
RESEARCH_AND_EDUCATION = "http://www.swamid.se/category/research-and-education"  # Deprecated from 2021-03-31
SFS_1993_1153 = "http://www.swamid.se/category/sfs-1993-1153"  # Deprecated from 2021-03-31
RESEARCH_AND_SCHOLARSHIP = "http://refeds.org/category/research-and-scholarship"
COCOv1 = "http://www.geant.net/uri/dataprotection-code-of-conduct/v1"
COCOv2 = "https://refeds.org/category/code-of-conduct/v2"
ESI = "https://myacademicid.org/entity-categories/esi"
PERSONALIZED = "https://refeds.org/category/personalized"
PSEUDONYMOUS = "https://refeds.org/category/pseudonymous"
ANONYMOUS = "https://refeds.org/category/anonymous"

# presently these don't by themselves
EU = "http://www.swamid.se/category/eu-adequate-protection"  # Deprecated from 2021-03-31
NREN = "http://www.swamid.se/category/nren-service"  # Deprecated from 2021-03-31
HEI = "http://www.swamid.se/category/hei-service"  # Deprecated from 2021-03-31

RELEASE = {
    # NOTICE: order is important
    # no aggregation categories needs to come last and in order of least to most restrictive
    "": [],
    SFS_1993_1153: ["norEduPersonNIN", "eduPersonAssurance"],
    (RESEARCH_AND_EDUCATION, EU): NAME + STATIC_ORG_INFO + OTHER,
    (RESEARCH_AND_EDUCATION, NREN): NAME + STATIC_ORG_INFO + OTHER,
    (RESEARCH_AND_EDUCATION, HEI): NAME + STATIC_ORG_INFO + OTHER,
    RESEARCH_AND_SCHOLARSHIP: R_AND_S,
    COCOv1: GEANT_COCO,
    COCOv2: REFEDS_COCO,
    ESI: MYACADEMICID_ESI,
    (ESI, COCOv1): MYACADEMICID_ESI + GEANT_COCO,
    (ESI, COCOv2): MYACADEMICID_ESI + REFEDS_COCO,
    # no aggregation categories
    PERSONALIZED: REFEDS_PERSONALIZED_ACCESS,
    PSEUDONYMOUS: REFEDS_PSEUDONYMOUS_ACCESS,
    ANONYMOUS: REFEDS_ANONYMOUS_ACCESS,
}

ONLY_REQUIRED = {
    COCOv1: True,
    COCOv2: True,
    (ESI, COCOv1): True,
    (ESI, COCOv2): True,
}

NO_AGGREGATION = {
    PERSONALIZED: True,
    PSEUDONYMOUS: True,
    ANONYMOUS: True,
}