{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Security/issues/1641","repository_url":"https://api.github.com/repos/aspnet/Security","labels_url":"https://api.github.com/repos/aspnet/Security/issues/1641/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Security/issues/1641/comments","events_url":"https://api.github.com/repos/aspnet/Security/issues/1641/events","html_url":"https://github.com/aspnet/Security/issues/1641","id":295603946,"number":1641,"title":"Bring back an equivalent of AuthenticationDescription.Items","user":{"login":"PinpointTownes","id":6998306,"avatar_url":"https://avatars1.githubusercontent.com/u/6998306?v=4","gravatar_id":"","url":"https://api.github.com/users/PinpointTownes","html_url":"https://github.com/PinpointTownes","followers_url":"https://api.github.com/users/PinpointTownes/followers","following_url":"https://api.github.com/users/PinpointTownes/following{/other_user}","gists_url":"https://api.github.com/users/PinpointTownes/gists{/gist_id}","starred_url":"https://api.github.com/users/PinpointTownes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinpointTownes/subscriptions","organizations_url":"https://api.github.com/users/PinpointTownes/orgs","repos_url":"https://api.github.com/users/PinpointTownes/repos","events_url":"https://api.github.com/users/PinpointTownes/events{/privacy}","received_events_url":"https://api.github.com/users/PinpointTownes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":45,"created_at":"2018-02-08T17:40:10Z","updated_at":"2018-02-09T00:54:49Z","closed_at":"2018-02-09T00:54:49Z","author_association":"CONTRIBUTOR","body":"In 1.x, the per-middleware `Items` bag was extremely useful to store provider-specific data. Unfortunately, with the huge refactoring introduced in 2.0, this property disappeared.\r\n\r\nSuggested API:\r\n\r\n```csharp\r\n// Existing type:\r\npublic class AuthenticationSchemeBuilder\r\n{\r\n    // Add this new member:\r\n    public IDictionary<string, object> Items { get; }\r\n        = new Dictionary<string, object>(StringComparer.Ordinal);\r\n\r\n    // Update this method:\r\n    public AuthenticationScheme Build()\r\n        => new AuthenticationScheme(Name, DisplayName, HandlerType, Items);\r\n}\r\n```\r\n\r\n```csharp\r\n// Existing type:\r\npublic class AuthenticationScheme\r\n{\r\n    // Update the existing constructor:\r\n    public AuthenticationScheme(string name, string displayName, Type handlerType)\r\n        : this(name, displayName, handlerType, items: null)\r\n    {\r\n    }\r\n\r\n    // Add a new constructor:\r\n    public AuthenticationScheme(string name, string displayName, Type handlerType, IDictionary<string, object> items)\r\n    {\r\n        if (name == null)\r\n        {\r\n            throw new ArgumentNullException(nameof(name));\r\n        }\r\n        if (handlerType == null)\r\n        {\r\n            throw new ArgumentNullException(nameof(handlerType));\r\n        }\r\n        if (!typeof(IAuthenticationHandler).IsAssignableFrom(handlerType))\r\n        {\r\n            throw new ArgumentException(\"handlerType must implement IAuthenticationHandler.\");\r\n        }\r\n\r\n        Name = name;\r\n        HandlerType = handlerType;\r\n        DisplayName = displayName;\r\n        Items = new ReadOnlyDictionary<string, object>(items ?? new Dictionary<string, object>());\r\n    }\r\n\r\n    // Add this new member:\r\n    public IReadOnlyDictionary<string, object> Items { get; }\r\n}\r\n```\r\n\r\n@Eilon this is a zero-risk change. Could that be part of 2.1?\r\n\r\n/cc @Tratcher "},"comment":{"url":"https://api.github.com/repos/aspnet/Security/issues/comments/364300487","html_url":"https://github.com/aspnet/Security/issues/1641#issuecomment-364300487","issue_url":"https://api.github.com/repos/aspnet/Security/issues/1641","id":364300487,"user":{"login":"PinpointTownes","id":6998306,"avatar_url":"https://avatars1.githubusercontent.com/u/6998306?v=4","gravatar_id":"","url":"https://api.github.com/users/PinpointTownes","html_url":"https://github.com/PinpointTownes","followers_url":"https://api.github.com/users/PinpointTownes/followers","following_url":"https://api.github.com/users/PinpointTownes/following{/other_user}","gists_url":"https://api.github.com/users/PinpointTownes/gists{/gist_id}","starred_url":"https://api.github.com/users/PinpointTownes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinpointTownes/subscriptions","organizations_url":"https://api.github.com/users/PinpointTownes/orgs","repos_url":"https://api.github.com/users/PinpointTownes/repos","events_url":"https://api.github.com/users/PinpointTownes/events{/privacy}","received_events_url":"https://api.github.com/users/PinpointTownes/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T00:54:49Z","updated_at":"2018-02-09T00:54:49Z","author_association":"CONTRIBUTOR","body":"> We chatted a bit about this in triage, we decided not to add any generic bag items back to the scehma as it was an intentional decision to eliminate the extra bag.\r\n\r\nSo surprising... :trollface: "}}
{"actor":{"display_login":"PinpointTownes"}}