{"id":16858931,"url":"https://github.com/ross/acts_as_obfuscated","last_synced_at":"2025-03-18T14:08:28.299Z","repository":{"id":668327,"uuid":"311545","full_name":"ross/acts_as_obfuscated","owner":"ross","description":"Add support to ActiveRecord::Base for id obfuscation, i.e. instead of .../users/show/1 you get .../users/show/cXdbpx completely transparently","archived":false,"fork":false,"pushed_at":"2009-11-06T01:23:51.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T19:37:56.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ross.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-09-19T04:46:39.000Z","updated_at":"2013-10-16T19:27:05.000Z","dependencies_parsed_at":"2022-07-08T02:47:36.409Z","dependency_job_id":null,"html_url":"https://github.com/ross/acts_as_obfuscated","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Facts_as_obfuscated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Facts_as_obfuscated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Facts_as_obfuscated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ross%2Facts_as_obfuscated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ross","download_url":"https://codeload.github.com/ross/acts_as_obfuscated/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244236079,"owners_count":20420759,"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-10-13T14:15:38.754Z","updated_at":"2025-03-18T14:08:28.274Z","avatar_url":"https://github.com/ross.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"ActsAsObfuscated\n================\n\nAdd support to ActiveRecord::Base for id obfuscation, i.e. instead of\n.../users/show/1 you get .../users/show/cXdbpx completely transparently\n\nInstall\n=======\n\nscript/plugin install git://github.com/ross/acts_as_obfuscated.git\n\nExample\n=======\n\nJust add acts_as_obfuscated to the desired model objects:\n\nclass User \u003c ActiveRecord::Base\n  acts_as_obfuscated\n\n  ...\nend\n\nand that's it. \n\n$ ./script/console \nLoading development environment (Rails 2.3.4)\n\u003e\u003e u = User.create(:name =\u003e 'Bob')\n=\u003e #\u003cUser id: 4, name: \"Bob\", created_at: \"2009-09-19 04:53:43\", updated_at: \"2009-09-19 04:53:43\"\u003e\n\u003e\u003e u.id\n=\u003e 4\n\u003e\u003e u.eid\n=\u003e \"diBGnp\"\n\u003e\u003e User.find(u.id)\n=\u003e #\u003cUser id: 4, name: \"Bob\", created_at: \"2009-09-19 04:53:43\", updated_at: \"2009-09-19 04:53:43\"\u003e\n\u003e\u003e User.find(u.eid)\n=\u003e #\u003cUser id: 4, name: \"Bob\", created_at: \"2009-09-19 04:53:43\", updated_at: \"2009-09-19 04:53:43\"\u003e\n\u003e\u003e\n\nacts_as_obfuscated doesn't stop you from adding custom to_param functions, so\nlong as the first portion is the eid followed by a '-':\n\nclass User \u003c ActiveRecord::Base\n  acts_as_obfuscated\n\n  has_many(:toys)\n\n  def to_param\n    CGI.escape(\"#{super.to_param}-#{self.name}\").gsub(/\\./, '_')\n  end\nend\n\n$ ./script/console \nLoading development environment (Rails 2.3.4)\nu= U\u003e\u003e u= User.last\n=\u003e #\u003cUser id: 4, name: \"Bob\", created_at: \"2009-09-19 04:53:43\", updated_at: \"2009-09-19 04:53:43\"\u003e\n\u003e\u003e u.to_param\n=\u003e \"diBGnp-Bob\"\n\u003e\u003e User.find(u.to_param)\n=\u003e #\u003cUser id: 4, name: \"Bob\", created_at: \"2009-09-19 04:53:43\", updated_at: \"2009-09-19 04:53:43\"\u003e\n\nCopyright \u0026 License\n===================\nCopyright (c) 2009 ross mcfarland\nContact via Github for change requests, etc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fross%2Facts_as_obfuscated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fross%2Facts_as_obfuscated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fross%2Facts_as_obfuscated/lists"}