diff --git a/actions/create_profile.lua b/actions/create_profile.lua index 825534c..e57fcd3 100644 --- a/actions/create_profile.lua +++ b/actions/create_profile.lua @@ -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} @@ -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 = { @@ -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, diff --git a/actions/jade_new_profile.lua b/actions/jade_new_profile.lua index 306024b..64d3937 100644 --- a/actions/jade_new_profile.lua +++ b/actions/jade_new_profile.lua @@ -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 @@ -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) diff --git a/actions/send_profile_and_key.lua b/actions/send_profile_and_key.lua index 99b8381..e356aee 100644 --- a/actions/send_profile_and_key.lua +++ b/actions/send_profile_and_key.lua @@ -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 @@ -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