{"id":22640949,"url":"https://github.com/aliencube/webapi.requirehttps","last_synced_at":"2025-03-29T05:26:48.538Z","repository":{"id":18566908,"uuid":"21769286","full_name":"aliencube/WebAPI.RequireHttps","owner":"aliencube","description":"This  provides a custom action attribute using ActionFilterAttribute (http://msdn.microsoft.com/en-us/library/system.web.http.filters.actionfilterattribute(v=vs.118).aspx), to allow HTTPS connection based on configuration.","archived":false,"fork":false,"pushed_at":"2014-07-17T04:58:09.000Z","size":9248,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T15:55:23.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://githubapicache.apphb.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliencube.png","metadata":{"files":{"readme":"README.md","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":"2014-07-12T14:47:17.000Z","updated_at":"2014-07-13T00:39:15.000Z","dependencies_parsed_at":"2022-08-05T00:15:22.922Z","dependency_job_id":null,"html_url":"https://github.com/aliencube/WebAPI.RequireHttps","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliencube%2FWebAPI.RequireHttps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliencube%2FWebAPI.RequireHttps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliencube%2FWebAPI.RequireHttps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliencube%2FWebAPI.RequireHttps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliencube","download_url":"https://codeload.github.com/aliencube/WebAPI.RequireHttps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246143552,"owners_count":20730285,"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-12-09T04:15:07.575Z","updated_at":"2025-03-29T05:26:48.518Z","avatar_url":"https://github.com/aliencube.png","language":"C#","readme":"# WebAPI.RequireHttps #\n\n**WebAPI.RequireHttps** provides a custom action attribute using [ActionFilterAttribute](http://msdn.microsoft.com/en-us/library/system.web.http.filters.actionfilterattribute(v=vs.118).aspx), to allow HTTPS connection based on configuration.\n\n\n## Acknowledgement ##\n\nThis library is based on the article, [Working with SSL in Web API](http://www.asp.net/web-api/overview/security/working-with-ssl-in-web-api).\n\n\n## Getting Started ##\n\n**WebAPI.RequireHttps** is a custom action filter attribute, therefore, it should be used for either Web API controllers or individual actions.\n\n\n### Controller Level Definition ###\n\n```csharp\n[RequireHttps(RequireHttpsConfigurationSettingsProviderType =\n                  typeof(RequireHttpsConfigurationSettingsProvider))]\npublic class SampleApiController : ApiController\n{\n    ...\n}\n```\n\n\n### Action Level Definition ###\n\n```csharp\npublic class SampleApiController : ApiController\n{\n    [RequireHttps(RequireHttpsConfigurationSettingsProviderType =\n                      typeof(RequireHttpsConfigurationSettingsProvider))]\n    public HttpResponseMessage Get()\n    {\n        ...\n    }\n}\n```\n\n\n## Configuration ##\n\nIn order to configure the `RequireHttpsAttribute` instance, `Web.config` should be considered.\n\n```xml\n\u003capplicationSettings\u003e\n    \u003cAliencube.WebApi.RequireHttps.Properties.Settings\u003e\n        \u003csetting name=\"BypassHttps\" serializeAs=\"String\"\u003e\n            \u003cvalue\u003eFalse\u003c/value\u003e\n        \u003c/setting\u003e\n        \u003csetting name=\"ApplicationServiceProviders\" serializeAs=\"String\"\u003e\n            \u003cvalue /\u003e\n        \u003c/setting\u003e\n    \u003c/Aliencube.WebApi.RequireHttps.Properties.Settings\u003e\n\u003c/applicationSettings\u003e\n```\n\n* `BypassHttps`: If it is set to `true`, the `RequireHttpsAttribute` instance assumes the request is over HTTPS connection. Default value is `false`.\n* `ApplicationServiceProviders`: In case that additional check based on application service provider is required, this should be defined. Currently (version 1.5.0.0), this value can be either, `Default` or `AppHarbor`. Default value is `nil`.\n\n\n# Contribution #\n\nYour contribution is always welcome! All your work should be done in the`dev` branch. Once you finish your work, please send us a pull request on `dev` for review. Make sure that all your changes **MUST** be covered with test codes; otherwise yours won't get accepted.\n\n\n\n\n## License ##\n\n**WebAPI.RequireHttps** is released under [MIT License](http://opensource.org/licenses/MIT).\n\n\u003e The MIT License (MIT)\n\u003e \n\u003e Copyright (c) 2014 [aliencube.org](http://aliencube.org)\n\u003e \n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is\n\u003e furnished to do so, subject to the following conditions:\n\u003e \n\u003e The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\u003e \n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencube%2Fwebapi.requirehttps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliencube%2Fwebapi.requirehttps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencube%2Fwebapi.requirehttps/lists"}