parsav  Diff

Differences From Artifact [d6af263481]:

To Artifact [4fbd6ed0a5]:


    81     81   		var fakeactor: lib.store.actor
    82     82   		if act.ptr == nil then
    83     83   			-- the user is known to us but has not yet claimed an
    84     84   			-- account on the server. create a template for the
    85     85   			-- account that will be created once they log in
    86     86   			fakeact = true
    87     87   			fakeactor = lib.store.actor {
    88         -				id = 0, handle = usn, nym = usn;
           88  +				id = 0, handle = usn, nym = nil;
    89     89   				origin = 0, bio = nil;
    90         -				key = [lib.mem.ptr(uint8)] {ptr=nil, ct=0}
           90  +				key = [lib.mem.ptr(uint8)] {ptr=nil, ct=0};
           91  +				epithet = nil;
    91     92   			}
    92     93   			act.ct = 1
    93     94   			act.ptr = &fakeactor
    94     95   			act.ptr.rights = lib.store.rights_default()
    95     96   		end
    96     97   		if am == nil then
    97     98   			-- pick an auth method
................................................................................
   169    170   		lib.render.docpage(co,path(1))
   170    171   	elseif path.ct == 1 then
   171    172   		lib.render.docpage(co, rstring.null())
   172    173   	else
   173    174   		co:complain(404, 'no such documentation', 'invalid documentation URL')
   174    175   	end
   175    176   end
          177  +
          178  +terra http.configure(co: &lib.srv.convo, path: hpath)
          179  +	lib.render.conf(co,path)
          180  +end
   176    181   
   177    182   do local branches = quote end
   178    183   	local filename, flen = symbol(&int8), symbol(intptr)
   179    184   	local page = symbol(lib.http.page)
   180    185   	local send = label()
   181    186   	local storage = data.stmap
   182    187   	for i,e in ipairs(config.embeds) do local id,mime = e[1],e[2]
................................................................................
   262    267   		if path.ptr[0]:cmp(lib.str.lit('user')) then
   263    268   			http.actor_profile_uid(co, path, meth)
   264    269   		elseif path.ptr[0]:cmp(lib.str.lit('tl')) then
   265    270   			http.timeline(co, path)
   266    271   		elseif path.ptr[0]:cmp(lib.str.lit('doc')) then
   267    272   			if meth ~= method.get and meth ~= method.head then goto wrongmeth end
   268    273   			http.documentation(co, path)
          274  +		elseif path.ptr[0]:cmp(lib.str.lit('conf')) then
          275  +			if co.aid == 0 then goto unauth end
          276  +			http.configure(co,path)
   269    277   		else goto notfound end
   270    278   		return
   271    279   	end
   272    280   
   273    281   	::wrongmeth:: co:complain(405, 'method not allowed', 'that method is not meaningful for this endpoint') do return end
   274    282   	::notfound:: co:complain(404, 'not found', 'no such resource available') do return end
          283  +	::unauth:: co:complain(401, 'unauthorized', 'this content is not available at your clearance level') do return end
   275    284   end