Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions actions/create_profile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ priority: 1
input_parameters: ["request"]


local profile = content.walk_documents("home",
local profile = contentdb.walk_documents("home",
function (file_uuid, header, body)
if header.type == "profile" then
return {name = header.name, uuid = file_uuid}
Expand All @@ -12,7 +12,7 @@ local profile = content.walk_documents("home",
)

if profile then
local msg = "A profile '" .. profile.name .. "' already exists in 'content/home/" .. profile.uuid .. "'"
local msg = "A profile '" .. profile.name .. "' already exists in 'contentdb/home/" .. profile.uuid .. "'"
log.warn(msg)
return {
headers = {
Expand All @@ -29,19 +29,19 @@ local sign_priv, sign_pub = crypto.sign.new_keypair()
local sign_priv_id = uuid.v4()
local sign_pub_id = uuid.v4()

content.write_file("home", profile_uuid, {
contentdb.write_file("home", profile_uuid, {
type = "profile",
name = request.body.name
})

content.write_file("home", sign_priv_id, {
contentdb.write_file("home", sign_priv_id, {
type = "key",
kind = "sign_private",
priority = math.random()*0.9 + 0.1,
profile_uuid = profile_uuid,
}, tostring(sign_priv))

content.write_file("home", sign_pub_id, {
contentdb.write_file("home", sign_pub_id, {
type = "key",
kind = "sign_public",
private_uuid = sign_priv_id,
Expand Down
6 changes: 3 additions & 3 deletions actions/jade_new_profile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ input_parameters: ["request"]

local profile_uuid = request.body.uuid

local exists = content.walk_documents(profile_uuid,
local exists = contentdb.walk_documents(profile_uuid,
function (file_uuid, header, body)
if header.type == "profile" then
return true
Expand All @@ -20,13 +20,13 @@ if exists then
return { status = 403 }
end

content.write_file(profile_uuid, profile_uuid, {
contentdb.write_file(profile_uuid, profile_uuid, {
type = "profile",
name = request.body.name
})

local sign_pub_id = uuid.v4()
content.write_file(profile_uuid, sign_pub_id, {
contentdb.write_file(profile_uuid, sign_pub_id, {
type = "key",
kind = "sign_public",
}, request.body.public_key)
Expand Down
4 changes: 2 additions & 2 deletions actions/send_profile_and_key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ input_parameters: ["request"]
local profile
local pub_key

content.walk_documents("home", function (file_uuid, header, body)
contentdb.walk_documents("home", function (file_uuid, header, body)
if header.type == "key" and header.kind == "sign_public" then
pub_key = body
end
Expand Down Expand Up @@ -41,7 +41,7 @@ end

local target_uuid = request.path_segments[2]

local target_host = content.walk_documents(target_uuid,
local target_host = contentdb.walk_documents(target_uuid,
function (file_uuid, header, body)
if header.type == "place" then
return header.host
Expand Down