@@ -52,6 +52,9 @@ def __init__(self):
5252 self ._description = []
5353 self ._display_name = []
5454 self ._logos = []
55+ self ._keywords = []
56+ self ._information_url = []
57+ self ._privacy_statement_url = []
5558
5659 def add_description (self , text , lang ):
5760 """
@@ -96,6 +99,52 @@ def add_logo(self, text, width, height, lang=None):
9699 logo_entry ["lang" ] = lang
97100 self ._logos .append (logo_entry )
98101
102+ def add_keywords (self , text , lang ):
103+ """
104+ Binds keywords to the given language
105+ :type text: List
106+ :type lang: str
107+
108+ :param text: List of keywords
109+ :param lang: language
110+ """
111+
112+ if text :
113+ self ._keywords .append (
114+ {
115+ "text" : [_keyword .replace (" " , "+" ) for _keyword in text ],
116+ "lang" : lang if lang else "en" ,
117+ }
118+ )
119+
120+ def add_information_url (self , text , lang ):
121+ """
122+ Binds information_url to the given language
123+ :type text: str
124+ :type lang: str
125+
126+ :param text: Information URL
127+ :param lang: language
128+ """
129+
130+ if text :
131+ self ._information_url .append ({"text" : text , "lang" : lang if lang else "en" })
132+
133+ def add_privacy_statement_url (self , text , lang ):
134+ """
135+ Binds privacy_statement_url to the given language
136+ :type text: str
137+ :type lang: str
138+
139+ :param text: Privacy statement URL
140+ :param lang: language
141+ """
142+
143+ if text :
144+ self ._privacy_statement_url .append (
145+ {"text" : text , "lang" : lang if lang else "en" }
146+ )
147+
99148 def to_dict (self ):
100149 """
101150 Returns a dictionary representation of the UIInfoDesc object.
@@ -110,6 +159,12 @@ def to_dict(self):
110159 ui_info ["display_name" ] = self ._display_name
111160 if self ._logos :
112161 ui_info ["logo" ] = self ._logos
162+ if self ._keywords :
163+ ui_info ["keywords" ] = self ._keywords
164+ if self ._information_url :
165+ ui_info ["information_url" ] = self ._information_url
166+ if self ._privacy_statement_url :
167+ ui_info ["privacy_statement_url" ] = self ._privacy_statement_url
113168 return {"service" : {"idp" : {"ui_info" : ui_info }}} if ui_info else {}
114169
115170
@@ -227,9 +282,9 @@ def to_dict(self):
227282 if self ._organization :
228283 description .update (self ._organization .to_dict ())
229284 if self ._contact_person :
230- description [' contact_person' ] = []
285+ description [" contact_person" ] = []
231286 for person in self ._contact_person :
232- description [' contact_person' ].append (person .to_dict ())
287+ description [" contact_person" ].append (person .to_dict ())
233288 if self ._ui_info :
234289 description .update (self ._ui_info .to_dict ())
235290 return description
0 commit comments