€cdocutils.nodes document q)q}q(U nametypesq}q(Xrepresenting access rulesqNX#supporting access control in searchqNX observationsqNuUsubstitution_defsq }q Uparse_messagesq ]q Ucurrent_sourceq NU decorationqNUautofootnote_startqKUnameidsq}q(hUrepresenting-access-rulesqhU#supporting-access-control-in-searchqhU observationsquUchildrenq]qcdocutils.nodes section q)q}q(U rawsourceqUUparentqhUsourceqXg/var/lib/jenkins/jobs/API_Documentation_trunk/workspace/api-documentation/source/design/search_auth.txtqUtagnameqUsectionqU attributesq }q!(Udupnamesq"]Uclassesq#]Ubackrefsq$]Uidsq%]q&haUnamesq']q(hauUlineq)KUdocumentq*hh]q+(cdocutils.nodes title q,)q-}q.(hX#Supporting Access Control in Searchq/hhhhhUtitleq0h }q1(h"]h#]h$]h%]h']uh)Kh*hh]q2cdocutils.nodes Text q3X#Supporting Access Control in Searchq4…q5}q6(hh/hh-ubaubcdocutils.nodes field_list q7)q8}q9(hUhhhhhU field_listq:h }q;(h"]h#]h$]h%]h']uh)Kh*hh]q}q?(hUhh8hhhUfieldq@h }qA(h"]h#]h$]h%]h']uh)Kh*hh]qB(cdocutils.nodes field_name qC)qD}qE(hXStatusqFhh>hhhU field_nameqGh }qH(h"]h#]h$]h%]h']uh)Kh]qIh3XStatusqJ…qK}qL(hhFhhDubaubcdocutils.nodes field_body qM)qN}qO(hXDRAFT h }qP(h"]h#]h$]h%]h']uhh>h]qQcdocutils.nodes paragraph qR)qS}qT(hXDRAFTqUhhNhhhU paragraphqVh }qW(h"]h#]h$]h%]h']uh)Kh]qXh3XDRAFTqY…qZ}q[(hhUhhSubaubahU field_bodyq\ubeubaubhR)q]}q^(hXzThere is a requirement that search results contain only information for which the user has permission to read, which requires that access permissions for each item in the search results is examined. Search operations are high demand operations on Coordinating Nodes and will be targeted by a large number of clients. As such, efficiency of access control evaluation is critical.q_hhhhhhVh }q`(h"]h#]h$]h%]h']uh)Kh*hh]qah3XzThere is a requirement that search results contain only information for which the user has permission to read, which requires that access permissions for each item in the search results is examined. Search operations are high demand operations on Coordinating Nodes and will be targeted by a large number of clients. As such, efficiency of access control evaluation is critical.qb…qc}qd(hh_hh]ubaubhR)qe}qf(hX`This document outlines an approach using the Lucene based SOLR index to provide such capability.qghhhhhhVh }qh(h"]h#]h$]h%]h']uh)Kh*hh]qih3X`This document outlines an approach using the Lucene based SOLR index to provide such capability.qj…qk}ql(hhghheubaubh)qm}qn(hUhhhhhhh }qo(h"]h#]h$]h%]qphah']qqhauh)K h*hh]qr(h,)qs}qt(hXRepresenting Access Rulesquhhmhhhh0h }qv(h"]h#]h$]h%]h']uh)K h*hh]qwh3XRepresenting Access Rulesqx…qy}qz(hhuhhsubaubcdocutils.nodes literal_block q{)q|}q}(hX2record = [PID, isPublic, readGroups, readSubjects]hhmhhhU literal_blockq~h }q(U xml:spaceq€Upreserveqh%]h$]h"]h#]h']uh)Kh*hh]q‚h3X2record = [PID, isPublic, readGroups, readSubjects]qƒ…q„}q…(hUhh|ubaubh7)q†}q‡(hUhhmhhhh:h }qˆ(h"]h#]h$]h%]h']uh)Kh*hh]q‰(h=)qŠ}q‹(hUhh†hhhh@h }qŒ(h"]h#]h$]h%]h']uh)Kh*hh]q(hC)qŽ}q(hXPIDqhhŠhhhhGh }q‘(h"]h#]h$]h%]h']uh)Kh]q’h3XPIDq“…q”}q•(hhhhŽubaubhM)q–}q—(hXidentifier of object h }q˜(h"]h#]h$]h%]h']uhhŠh]q™hR)qš}q›(hXidentifier of objectqœhh–hhhhVh }q(h"]h#]h$]h%]h']uh)Kh]qžh3Xidentifier of objectqŸ…q }q¡(hhœhhšubaubahh\ubeubh=)q¢}q£(hUhh†hhhh@h }q¤(h"]h#]h$]h%]h']uh)Kh*hh]q¥(hC)q¦}q§(hXisPublicq¨hh¢hhhhGh }q©(h"]h#]h$]h%]h']uh)Kh]qªh3XisPublicq«…q¬}q­(hh¨hh¦ubaubhM)q®}q¯(hX@boolean set true if the object is accessible by the public user h }q°(h"]h#]h$]h%]h']uhh¢h]q±hR)q²}q³(hX?boolean set true if the object is accessible by the public userq´hh®hhhhVh }qµ(h"]h#]h$]h%]h']uh)Kh]q¶h3X?boolean set true if the object is accessible by the public userq·…q¸}q¹(hh´hh²ubaubahh\ubeubh=)qº}q»(hUhh†hhhh@h }q¼(h"]h#]h$]h%]h']uh)Kh*hh]q½(hC)q¾}q¿(hX readGroupsqÀhhºhhhhGh }qÁ(h"]h#]h$]h%]h']uh)Kh]qÂh3X readGroupsqÃ…qÄ}qÅ(hhÀhh¾ubaubhM)qÆ}qÇ(hXXa multi-valued field that contains a list of groups that have read access on the object h }qÈ(h"]h#]h$]h%]h']uhhºh]qÉhR)qÊ}qË(hXWa multi-valued field that contains a list of groups that have read access on the objectqÌhhÆhhhhVh }qÍ(h"]h#]h$]h%]h']uh)Kh]qÎh3XWa multi-valued field that contains a list of groups that have read access on the objectqÏ…qÐ}qÑ(hhÌhhÊubaubahh\ubeubh=)qÒ}qÓ(hUhh†hhhh@h }qÔ(h"]h#]h$]h%]h']uh)Kh*hh]qÕ(hC)qÖ}q×(hX readSubjectsqØhhÒhhhhGh }qÙ(h"]h#]h$]h%]h']uh)Kh]qÚh3X readSubjectsqÛ…qÜ}qÝ(hhØhhÖubaubhM)qÞ}qß(hX[a multi-valued field that contains a list of subjects that have read access on the object h }qà(h"]h#]h$]h%]h']uhhÒh]qáhR)qâ}qã(hXYa multi-valued field that contains a list of subjects that have read access on the objectqähhÞhhhhVh }qå(h"]h#]h$]h%]h']uh)Kh]qæh3XYa multi-valued field that contains a list of subjects that have read access on the objectqç…qè}qé(hhähhâubaubahh\ubeubeubhR)qê}që(hX·A python function that would generate a suitable query for retrieving a list of PIDs for which a user has *read* access may be (note that subject strings need to be properly escaped):qìhhmhhhhVh }qí(h"]h#]h$]h%]h']uh)Kh*hh]qî(h3XjA python function that would generate a suitable query for retrieving a list of PIDs for which a user has qï…qð}qñ(hXjA python function that would generate a suitable query for retrieving a list of PIDs for which a user has hhêubcdocutils.nodes emphasis qò)qó}qô(hX*read*h }qõ(h"]h#]h$]h%]h']uhhêh]qöh3Xreadq÷…qø}qù(hUhhóubahUemphasisqúubh3XG access may be (note that subject strings need to be properly escaped):qû…qü}qý(hXG access may be (note that subject strings need to be properly escaped):hhêubeubh{)qþ}qÿ(hXëdef canReadQuery(subject): #return list of public objects if CN.isPublic(subject): return "isPublic:true" #public OR readable by group if CN.isGroup(subject): return "isPublic:true || readGroups: %s" % subject #list of public objects, OR objects readable by groups subject belongs to # OR explicitly readable by subject groups = CN.getSubjectGroups(subject) gq = "readGroups:(%s)" % " ".join(groups) return "isPublic:true || readSubjects:%s || %s" % (subject, gq)hhmhhhh~h }r(h€hh%]h$]h"]h#]h']uh)K h*hh]rh3Xëdef canReadQuery(subject): #return list of public objects if CN.isPublic(subject): return "isPublic:true" #public OR readable by group if CN.isGroup(subject): return "isPublic:true || readGroups: %s" % subject #list of public objects, OR objects readable by groups subject belongs to # OR explicitly readable by subject groups = CN.getSubjectGroups(subject) gq = "readGroups:(%s)" % " ".join(groups) return "isPublic:true || readSubjects:%s || %s" % (subject, gq)r…r}r(hUhhþubaubhR)r}r(hXÖSubjects are represented in DataONE as lengthy strings. There may be some performance improvements gained by mapping the subject strings to integers and using this representation internally within the Lucene index.rhhmhhhhVh }r(h"]h#]h$]h%]h']uh)K0h*hh]r h3XÖSubjects are represented in DataONE as lengthy strings. There may be some performance improvements gained by mapping the subject strings to integers and using this representation internally within the Lucene index.r …r }r (hjhjubaubhR)r }r(hXÏKeeping this index in a separate shard would enable it's maintenance and use independently of other indexes that may be used to support search against other properties of System Metadata or Science Metadata.rhhmhhhhVh }r(h"]h#]h$]h%]h']uh)K2h*hh]rh3XÏKeeping this index in a separate shard would enable it's maintenance and use independently of other indexes that may be used to support search against other properties of System Metadata or Science Metadata.r…r}r(hjhj ubaubhR)r}r(hXSimilar indexes can be generated for write, change, and execute permissions, though these are not needed for search operations.rhhmhhhhVh }r(h"]h#]h$]h%]h']uh)K4h*hh]rh3XSimilar indexes can be generated for write, change, and execute permissions, though these are not needed for search operations.r…r}r(hjhjubaubhR)r}r(hXDraft SOLR schema fragment:rhhmhhhhVh }r (h"]h#]h$]h%]h']uh)K6h*hh]r!h3XDraft SOLR schema fragment:r"…r#}r$(hjhjubaubh{)r%}r&(hX} pidhhmhhhh~h }r'(Ulinenosr(‰Ulanguager)Xxmlh€hh%]h$]h"]Uhighlight_argsr*}h#]h']uh)K8h*hh]r+h3X} pidr,…r-}r.(hUhj%ubaubeubh)r/}r0(hUhhhhhhh }r1(h"]h#]h$]h%]r2hah']r3hauh)KBh*hh]r4(h,)r5}r6(hX Observationsr7hj/hhhh0h }r8(h"]h#]h$]h%]h']uh)KBh*hh]r9h3X Observationsr:…r;}r<(hj7hj5ubaubhR)r=}r>(hXA subject may participate in a potentially large number of groups which would result in a lengthy query string. The alternative would be to decompose groups with read access into a list of subjects, and just have a single list of subjects for each PID. This list could become very large.r?hj/hhhhVh }r@(h"]h#]h$]h%]h']uh)KDh*hh]rAh3XA subject may participate in a potentially large number of groups which would result in a lengthy query string. The alternative would be to decompose groups with read access into a list of subjects, and just have a single list of subjects for each PID. This list could become very large.rB…rC}rD(hj?hj=ubaubhR)rE}rF(hXÎAn index may be replicated across multiple locations to ensure the access control index is sufficiently responsive. A load balancer such as HAProxy can then be used to direct requests to different replicas.rGhj/hhhhVh }rH(h"]h#]h$]h%]h']uh)KFh*hh]rIh3XÎAn index may be replicated across multiple locations to ensure the access control index is sufficiently responsive. A load balancer such as HAProxy can then be used to direct requests to different replicas.rJ…rK}rL(hjGhjEubaubeubeubahUU transformerrMNU footnote_refsrN}rOUrefnamesrP}rQUsymbol_footnotesrR]rSUautofootnote_refsrT]rUUsymbol_footnote_refsrV]rWU citationsrX]rYh*hU current_linerZNUtransform_messagesr[]r\Ureporterr]NUid_startr^KU autofootnotesr_]r`U citation_refsra}rbUindirect_targetsrc]rdUsettingsre(cdocutils.frontend Values rforg}rh(Ufootnote_backlinksriKUrecord_dependenciesrjNU rfc_base_urlrkUhttps://tools.ietf.org/html/rlU tracebackrmˆUpep_referencesrnNUstrip_commentsroNU toc_backlinksrpUentryrqU language_coderrUenrsU datestamprtNU report_levelruKU _destinationrvNU halt_levelrwKU strip_classesrxNh0NUerror_encoding_error_handlerryUbackslashreplacerzUdebugr{NUembed_stylesheetr|‰Uoutput_encoding_error_handlerr}Ustrictr~U sectnum_xformrKUdump_transformsr€NU docinfo_xformrKUwarning_streamr‚NUpep_file_url_templaterƒUpep-%04dr„Uexit_status_levelr…KUconfigr†NUstrict_visitorr‡NUcloak_email_addressesrˆˆUtrim_footnote_reference_spacer‰‰UenvrŠNUdump_pseudo_xmlr‹NUexpose_internalsrŒNUsectsubtitle_xformr‰U source_linkrŽNUrfc_referencesrNUoutput_encodingrUutf-8r‘U source_urlr’NUinput_encodingr“U utf-8-sigr”U_disable_configr•NU id_prefixr–UU tab_widthr—KUerror_encodingr˜UUTF-8r™U_sourceršhUgettext_compactr›ˆU generatorrœNUdump_internalsrNU smart_quotesrž‰U pep_base_urlrŸU https://www.python.org/dev/peps/r Usyntax_highlightr¡Ulongr¢Uinput_encoding_error_handlerr£j~Uauto_id_prefixr¤Uidr¥Udoctitle_xformr¦‰Ustrip_elements_with_classesr§NU _config_filesr¨]Ufile_insertion_enabledr©ˆU raw_enabledrªKU dump_settingsr«NubUsymbol_footnote_startr¬KUidsr­}r®(hhmhhhj/uUsubstitution_namesr¯}r°hh*h }r±(h"]h%]h$]Usourcehh#]h']uU footnotesr²]r³Urefidsr´}rµub.