Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Porting System.Security.Claims#4933

Merged
weshaggard merged 2 commits into
dotnet:masterfrom
venkat-raman251:master
Dec 29, 2015
Merged

Porting System.Security.Claims#4933
weshaggard merged 2 commits into
dotnet:masterfrom
venkat-raman251:master

Conversation

@venkat-raman251
Copy link
Copy Markdown
Contributor

No description provided.

@venkat-raman251
Copy link
Copy Markdown
Contributor Author

@weshaggard : Please have a look.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can any of these fields be readonly?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are used to hold property values that are just {get}. Today's coding practice is usually { private set }.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But at the very least a field like _properties should be readonly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A user can add a property at any time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't affect whether the dictionary field can be readonly.

@justinvp
Copy link
Copy Markdown
Contributor

A couple other questions:

  1. Should there be a .sln file for this component?
  2. Should the commit author be changed to @dotnet-bot for the initial commit?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could _externalClaims be typed as List<List<Claim>> instead of Collection<IEnumerable<Claim>>? It looks like this is only used internally and the IEnumerable<Claim>s are always List<T> already. This would be slightly more efficient than using Collection<T> and would avoid enumerator allocations when enumerating each item in the Claims property as List<T>'s struct enumerator would be used.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they are only used internally and was designed for holding claims from 'roleProviders'.
I don't see any reason to avoid improving this.

@venkat-raman251
Copy link
Copy Markdown
Contributor Author

Opened a tracking issue for the proposed refactoring #4935

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "claim" is sometimes capitalized and sometimes not. Not clear to me the rhyme or reason for it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is a type, how about 'Claim'? Capitalized.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy either way, as long as we're consistent 😄

@stephentoub
Copy link
Copy Markdown
Member

Are there any tests to go with the library?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants