Äcdocutils.nodes
document
q)Åq}q(U	nametypesq}q(X���representing 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	rawsourceqU�UparentqhUsourceqXg���/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(hU�hhhhhU
field_listq:h }q;(h"]h#]h$]h%]h']uh)Kh*hh]q<cdocutils.nodes
field
q=)Åq>}q?(hU�hh8hhhUfieldq@h }qA(h"]h#]h$]h%]h']uh)Kh*hh]qB(cdocutils.nodes
field_name
qC)ÅqD}qE(hX���StatusqFhh>hhhU
field_nameqGh }qH(h"]h#]h$]h%]h']uh)K�h]qIh3X���StatusqJÖÅqK}qL(hhFhhDubaubcdocutils.nodes
field_body
qM)ÅqN}qO(hX���DRAFT
h }qP(h"]h#]h$]h%]h']uhh>h]qQcdocutils.nodes
paragraph
qR)ÅqS}qT(hX���DRAFTqUhhNhhhU	paragraphqVh }qW(h"]h#]h$]h%]h']uh)Kh]qXh3X���DRAFTqYÖÅqZ}q[(hhUhhSubaubahU
field_bodyq\ubeubaubhR)Åq]}q^(hXz��There 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]qah3Xz��There 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(hU�hhhhhhh }qo(h"]h#]h$]h%]qphah']qqhauh)Kh*hh]qr(h,)Åqs}qt(hX���Representing Access Rulesquhhmhhhh0h }qv(h"]h#]h$]h%]h']uh)Kh*hh]qwh3X���Representing Access RulesqxÖÅqy}qz(hhuhhsubaubcdocutils.nodes
literal_block
q{)Åq|}q}(hX2���record = [PID, isPublic, readGroups, readSubjects]hhmhhhU
literal_blockq~h }q(U	xml:spaceqÄUpreserveqÅh%]h$]h"]h#]h']uh)Kh*hh]qÇh3X2���record = [PID, isPublic, readGroups, readSubjects]qÉÖÅqÑ}qÖ(hU�hh|ubaubh7)ÅqÜ}qá(hU�hhmhhhh:h }qà(h"]h#]h$]h%]h']uh)Kh*hh]qâ(h=)Åqä}qã(hU�hhÜhhhh@h }qå(h"]h#]h$]h%]h']uh)Kh*hh]qç(hC)Åqé}qè(hX���PIDqêhhähhhhGh }që(h"]h#]h$]h%]h']uh)K�h]qíh3X���PIDqìÖÅqî}qï(hhêhhéubaubhM)Åqñ}qó(hX���identifier of object
h }qò(h"]h#]h$]h%]h']uhhäh]qôhR)Åqö}qõ(hX���identifier of objectqúhhñhhhhVh }qù(h"]h#]h$]h%]h']uh)Kh]qûh3X���identifier of objectqüÖÅq†}q°(hhúhhöubaubahh\ubeubh=)Åq¢}q£(hU�hhÜhhhh@h }q§(h"]h#]h$]h%]h']uh)Kh*hh]q•(hC)Åq¶}qß(hX���isPublicq®hh¢hhhhGh }q©(h"]h#]h$]h%]h']uh)K�h]q™h3X���isPublicq´ÖÅ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ª(hU�hhÜ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)K�h]q¬h3X
���readGroupsq√ÖÅqƒ}q≈(hh¿hhæubaubhM)Åq∆}q«(hXX���a 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À(hXW���a 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Œh3XW���a multi-valued field that contains a list of groups that have read access on the objectqœÖÅq–}q—(hhÃhh ubaubahh\ubeubh=)Åq“}q”(hU�hhÜ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)K�h]q⁄h3X���readSubjectsq€ÖÅq‹}q›(hhÿhh÷ubaubhM)Åqfi}qfl(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„(hXY���a multi-valued field that contains a list of subjects that have read access on the objectq‰hhfihhhhVh }qÂ(h"]h#]h$]h%]h']uh)Kh]qÊh3XY���a 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Ó(h3Xj���A python function that would generate a suitable query for retrieving a list of PIDs for which a user has qÔÖÅq}qÒ(hXj���A 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ˆh3X���readq˜ÖÅq¯}q˘(hU�hhÛ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ÄhÅh%]h$]h"]h#]h']uh)K h*hh]r��h3XÎ��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��(hU�hh˛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.r��hhmhhhhVh }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��(hj��hj��ubaubhR)Å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.r��hhmhhhhVh }r��(h"]h#]h$]h%]h']uh)K2h*hh]r��h3Xœ���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��(hj��hj
��ubaubhR)År��}r��(hX���Similar indexes can be generated for write, change, and execute permissions, though these are not needed for search operations.r��hhmhhhhVh }r��(h"]h#]h$]h%]h']uh)K4h*hh]r��h3X���Similar indexes can be generated for write, change, and execute permissions, though these are not needed for search operations.r��ÖÅr��}r��(hj��hj��ubaubhR)År��}r��(hX���Draft SOLR schema fragment:r��hhmhhhhVh }r ��(h"]h#]h$]h%]h']uh)K6h*hh]r!��h3X���Draft SOLR schema fragment:r"��ÖÅr#��}r$��(hj��hj��ubaubh{)År%��}r&��(hX}��<field name="pid" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="isPublic" type="boolean" indexed="true" stored="false" />
<field name="readGroups" type="string" indexed="true" stored="false" multiValued="true" />
<field name="readSubjects" type="string" indexed="true" stored="false" multiValued="true" />
<uniqueKey>pid</uniqueKey>hhmhhhh~h }r'��(Ulinenosr(��âUlanguager)��X���xmlhÄhÅh%]h$]h"]Uhighlight_argsr*��}h#]h']uh)K8h*hh]r+��h3X}��<field name="pid" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="isPublic" type="boolean" indexed="true" stored="false" />
<field name="readGroups" type="string" indexed="true" stored="false" multiValued="true" />
<field name="readSubjects" type="string" indexed="true" stored="false" multiValued="true" />
<uniqueKey>pid</uniqueKey>r,��ÖÅr-��}r.��(hU�hj%��ubaubeubh)År/��}r0��(hU�hhhhhhh }r1��(h"]h#]h$]h%]r2��hah']r3��hauh)KBh*hh]r4��(h,)År5��}r6��(hX���Observationsr7��hj/��hhhh0h }r8��(h"]h#]h$]h%]h']uh)KBh*hh]r9��h3X���Observationsr:��ÖÅr;��}r<��(hj7��hj5��ubaubhR)År=��}r>��(hX��A 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]rA��h3X��A 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.rG��hj/��hhhhVh }rH��(h"]h#]h$]h%]h']uh)KFh*hh]rI��h3XŒ���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��(hjG��hjE��ubaubeubeubahU�UtransformerrM��NU
footnote_refsrN��}rO��UrefnamesrP��}rQ��Usymbol_footnotesrR��]rS��Uautofootnote_refsrT��]rU��Usymbol_footnote_refsrV��]rW��U	citationsrX��]rY��h*hUcurrent_linerZ��NUtransform_messagesr[��]r\��Ureporterr]��NUid_startr^��KU
autofootnotesr_��]r`��U
citation_refsra��}rb��Uindirect_targetsrc��]rd��Usettingsre��(cdocutils.frontend
Values
rf��org��}rh��(Ufootnote_backlinksri��KUrecord_dependenciesrj��NUrfc_base_urlrk��Uhttps://tools.ietf.org/html/rl��U	tracebackrm��àUpep_referencesrn��NUstrip_commentsro��NU
toc_backlinksrp��Uentryrq��U
language_coderr��Uenrs��U	datestamprt��NUreport_levelru��KU_destinationrv��NU
halt_levelrw��KU
strip_classesrx��Nh0NUerror_encoding_error_handlerry��Ubackslashreplacerz��Udebugr{��NUembed_stylesheetr|��âUoutput_encoding_error_handlerr}��Ustrictr~��U
sectnum_xformr��KUdump_transformsr��NU
docinfo_xformrÅ��KUwarning_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ç��âUsource_linkré��NUrfc_referencesrè��NUoutput_encodingrê��Uutf-8rë��U
source_urlrí��NUinput_encodingrì��U	utf-8-sigrî��U_disable_configrï��NU	id_prefixrñ��U�U	tab_widthró��KUerror_encodingrò��UUTF-8rô��U_sourcerö��hUgettext_compactrõ��àU	generatorrú��NUdump_internalsrù��NU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©��àUraw_enabledr™��KU
dump_settingsr´��NubUsymbol_footnote_startr¨��K�Uidsr≠��}rÆ��(hhmhhhj/��uUsubstitution_namesrØ��}r∞��hh*h }r±��(h"]h%]h$]Usourcehh#]h']uU	footnotesr≤��]r≥��Urefidsr¥��}rµ��ub.