{"id":20059527,"url":"https://github.com/elli-lib/elli_cloudfront","last_synced_at":"2025-05-05T15:31:41.376Z","repository":{"id":57494829,"uuid":"55017781","full_name":"elli-lib/elli_cloudfront","owner":"elli-lib","description":"Elli middleware to manage CloudFront signed cookies.","archived":false,"fork":false,"pushed_at":"2016-09-28T02:00:12.000Z","size":115,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-07T12:10:17.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://elli-lib.github.io/elli_cloudfront","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elli-lib.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-29T23:36:36.000Z","updated_at":"2018-07-31T01:45:23.000Z","dependencies_parsed_at":"2022-08-28T19:40:57.284Z","dependency_job_id":null,"html_url":"https://github.com/elli-lib/elli_cloudfront","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_cloudfront","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_cloudfront/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_cloudfront/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli_cloudfront/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elli-lib","download_url":"https://codeload.github.com/elli-lib/elli_cloudfront/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224034460,"owners_count":17244786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T13:08:04.362Z","updated_at":"2024-11-13T13:08:05.129Z","avatar_url":"https://github.com/elli-lib.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+OPTIONS: ^:{} toc:nil\n#+STARTUP: showall\n\n* elli_cloudfront\n[[https://travis-ci.org/elli-lib/elli_cloudfront][file:https://travis-ci.org/elli-lib/elli_cloudfront.svg?branch=master]]\n[[https://github.com/elli-lib/elli_cloudfront/releases/latest][file:https://img.shields.io/github/tag/elli-lib/elli_cloudfront.svg]]\n[[https://github.com/erlang/otp/releases][file:https://img.shields.io/badge/erlang-%3E%3D%2017.0-red.svg]]\n[[http://elli-lib.github.io/elli_cloudfront][file:https://img.shields.io/badge/docs-80%25-green.svg]]\n[[file:LICENSE][file:https://img.shields.io/badge/license-BSD-blue.svg]]\n\n[[https://github.com/knutin/elli][Elli]] middleware to manage [[http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html][CloudFront signed cookies]].\n\n** Build\n#+BEGIN_SRC fish\nrebar3 compile\n#+END_SRC\n\n** Example\n[[file:priv/example.lfe][priv/example.lfe]]\n\n#+BEGIN_SRC fish\n# rebar3 compile\nlfe priv/example.lfe\n#+END_SRC\n\n#+BEGIN_SRC http\nHTTP/1.1 302 Found\nDate: Wed, 30 Mar 2016 01:02:46 GMT\nExpires: Wed, 30 Mar 2016 02:02:46 GMT\nLocation: https://d123456789abcde.cloudfront.net\nSet-Cookie: CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cDovL2V4YW1wbGUuY29tLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE0NTkyODUzNjZ9fX1dfQ__\nSet-Cookie: CloudFront-Signature=QgpGJ04j48DNbLdaC5bRJBQNzwPSQvtkY-y-VosdRaQ0RS5yLd~JA34VD~G5OsroUJPNChN4ptCTFPfdEazcxbmrAfHvpY~NW-3UWXJYqQ~8ZqnOApUnoooH89T~6N8ul4Ss1y6bSFH9pAq2MQVELupmtW359hd~-4oC7kKJrP-4TJrrGA6OwNQ-~JKRDpapA0E8OR8Ns-8OOh3FUQruwrWuR6edZUuq02WvhyNLVkLE8O5avLl7EwVNSx2bNXkTrIsI4gGB7sBOFbaW62RkSb~dmYu~Db06ytzYfW61R49WkXzAVgzsu2SDsI6KMX6jayA9UTnt40OFgbuQZkE34g__\nSet-Cookie: CloudFront-Key-Pair-Id=AKEXAMPLE123\n#+END_SRC\n\n** Minimal example ~elli_cloudfront_handler~\n#+BEGIN_SRC lfe :tangle priv/example-cf-handler.lfe\n(defmodule example-cf-handler\n  (behaviour elli_cloudfront_handler)\n  ;; elli_cloudfront_handler callbacks\n  (export (is_authorized 3)\n          (store_ticket 2) (validate_ticket 2) (delete_ticket 1)))\n\n;; Defines #ticket{} and includes elli.hrl\n(include-lib \"elli_cloudfront/include/elli_cloudfront.hrl\")\n\n(defun is_authorized (_req _service _args)\n  ;; TODO:\n  ;; - Parse req for user info\n  ;; - Confirm or deny user is authorized to view service\n  ;; - Return a user id\n  #(ok #\"USERID\"))\n\n(defun store_ticket (_user _ticket)\n  ;; TODO: Store user's ticket\n  'ok)\n\n(defun validate_ticket (_req _token)\n  ;; TODO:\n  ;; - Parse req for user info\n  ;; - Fetch ticket by token\n  ;; - Confirm or deny that it belongs to the user\n  ;; - Return the \"service\" associated with the ticket\n  #(ok #\"https://d123456789abcde.cloudfront.net\"))\n\n(defun delete_ticket (_token)\n  ;; TODO: Delete the ticket with the given token\n  'ok)\n#+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felli-lib%2Felli_cloudfront","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felli-lib%2Felli_cloudfront","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felli-lib%2Felli_cloudfront/lists"}