{"action":"created","issue":{"url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/1479","repository_url":"https://api.github.com/repos/OAI/OpenAPI-Specification","labels_url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/1479/labels{/name}","comments_url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/1479/comments","events_url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/1479/events","html_url":"https://github.com/OAI/OpenAPI-Specification/issues/1479","id":294785026,"number":1479,"title":"Using Authorization annotation in JAVA","user":{"login":"kfirisrael","id":36197637,"avatar_url":"https://avatars3.githubusercontent.com/u/36197637?v=4","gravatar_id":"","url":"https://api.github.com/users/kfirisrael","html_url":"https://github.com/kfirisrael","followers_url":"https://api.github.com/users/kfirisrael/followers","following_url":"https://api.github.com/users/kfirisrael/following{/other_user}","gists_url":"https://api.github.com/users/kfirisrael/gists{/gist_id}","starred_url":"https://api.github.com/users/kfirisrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfirisrael/subscriptions","organizations_url":"https://api.github.com/users/kfirisrael/orgs","repos_url":"https://api.github.com/users/kfirisrael/repos","events_url":"https://api.github.com/users/kfirisrael/events{/privacy}","received_events_url":"https://api.github.com/users/kfirisrael/received_events","type":"User","site_admin":false},"labels":[{"id":733277536,"url":"https://api.github.com/repos/OAI/OpenAPI-Specification/labels/review","name":"review","color":"27f92e","default":false}],"state":"open","locked":false,"assignee":{"login":"webron","id":241629,"avatar_url":"https://avatars0.githubusercontent.com/u/241629?v=4","gravatar_id":"","url":"https://api.github.com/users/webron","html_url":"https://github.com/webron","followers_url":"https://api.github.com/users/webron/followers","following_url":"https://api.github.com/users/webron/following{/other_user}","gists_url":"https://api.github.com/users/webron/gists{/gist_id}","starred_url":"https://api.github.com/users/webron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webron/subscriptions","organizations_url":"https://api.github.com/users/webron/orgs","repos_url":"https://api.github.com/users/webron/repos","events_url":"https://api.github.com/users/webron/events{/privacy}","received_events_url":"https://api.github.com/users/webron/received_events","type":"User","site_admin":false},"assignees":[{"login":"webron","id":241629,"avatar_url":"https://avatars0.githubusercontent.com/u/241629?v=4","gravatar_id":"","url":"https://api.github.com/users/webron","html_url":"https://github.com/webron","followers_url":"https://api.github.com/users/webron/followers","following_url":"https://api.github.com/users/webron/following{/other_user}","gists_url":"https://api.github.com/users/webron/gists{/gist_id}","starred_url":"https://api.github.com/users/webron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webron/subscriptions","organizations_url":"https://api.github.com/users/webron/orgs","repos_url":"https://api.github.com/users/webron/repos","events_url":"https://api.github.com/users/webron/events{/privacy}","received_events_url":"https://api.github.com/users/webron/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-02-06T14:45:48Z","updated_at":"2018-05-09T13:26:14Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nWe've defined a yaml file with Swagger version 2.0 with the following security definitions:\r\n\r\n```yaml\r\nsecurityDefinitions:\r\n  UserNameSecurity:\r\n    type: apiKey\r\n    in: header\r\n    name: X-API-USERNAME\r\n  PasswordSecurity:\r\n    type: apiKey\r\n    in: header\r\n    name: X-API-PASSWORD\r\n  TenantSecurity:\r\n    type: apiKey\r\n    in: header\r\n    name: X-API-TENANT\r\n    \r\nsecurity:\r\n- UserNameSecurity: []\r\n- PasswordSecurity: []\r\n- TenantSecurity: []\r\n```\r\n\r\nAfter compiling it using Swagger JAVA compiler version 2.2.3 we see the security labels as annotations in all the operation, but we can't access the values entered for them in the request header.\r\n        @io.swagger.annotations.Authorization(value = \"PasswordSecurity\"),\r\n        @io.swagger.annotations.Authorization(value = \"TenantSecurity\"),\r\n        @io.swagger.annotations.Authorization(value = \"UserNameSecurity\")\r\n\r\nDo you know how can the apiKey values, supplied in the header, can be accessed in the generated code?\r\n\r\nThanks,\r\nKfir"},"comment":{"url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/comments/387737639","html_url":"https://github.com/OAI/OpenAPI-Specification/issues/1479#issuecomment-387737639","issue_url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/1479","id":387737639,"user":{"login":"mrbq","id":33124256,"avatar_url":"https://avatars1.githubusercontent.com/u/33124256?v=4","gravatar_id":"","url":"https://api.github.com/users/mrbq","html_url":"https://github.com/mrbq","followers_url":"https://api.github.com/users/mrbq/followers","following_url":"https://api.github.com/users/mrbq/following{/other_user}","gists_url":"https://api.github.com/users/mrbq/gists{/gist_id}","starred_url":"https://api.github.com/users/mrbq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrbq/subscriptions","organizations_url":"https://api.github.com/users/mrbq/orgs","repos_url":"https://api.github.com/users/mrbq/repos","events_url":"https://api.github.com/users/mrbq/events{/privacy}","received_events_url":"https://api.github.com/users/mrbq/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T13:26:14Z","updated_at":"2018-05-09T13:26:14Z","author_association":"NONE","body":"Hi,\r\n\r\nI have the same problem. I want to have an API first design and I want to get the security definition (path and roles) from the swagger specification so I can use it in my spring security configuration. \r\n\r\nIf I can do this, it means that the secured services and the roles that can access them should be defined in swagger and not in the application.\r\n\r\nThanks,\r\nmarcos"}}
{"actor":{"display_login":"mrbq"}}