Creating Customized rule for FxCop - fxcop

Need help for creating a fxcop rule for following statement:
"Do not cast values from different domains"
I have googled for this statement and get some info from following microsoft site:
Click Here
It says
"•Do not cast values from different domains. Casts operate within a particular domain of values. For example, numbers and strings are different domains. "
But i am not getting any idea how can I make a generic rule for this.
I am building some customized rules which are not available in FxCop.

Related

LDAP: Filtering using an Attribute that has a forward slash in its name

We have an LDAP system with an unknown number of users who have erroneously had a custom attribute added to their account which contains a forward slash in the name
I want to use our LDAP Browser to figure out how many of these entries there are.
The problem is that I cannot seem to construct a filter based on that attribute name because of the presence of that forward slash in the attribute name causes errors.
Trying something like this
Results in a "Search Failed" message in my LDAP Browser (It's a Radiant ONE Browser)
If I remove the forward slash and search again I get a "0 entries returned" message as would be expected since I am now searching on an attribute name that does not exist.
I have tried escaping using a backslash but this does not work either.
First, it depends.
As the "Radiant ONE Browser" probably also does some parsing to the values.
Only way I am aware you might is something like:
(sn//lastName=*)
Generally I would recommend that you fix the attribute within the schema these type of issues only seem to get worse down the road.

Use category name in Sitefinity blog URL

I followed the instructions here on establishing a new provider and generating custom URLs, and it works as expected. There doesn't seem to be a clear reference for what parameters can be utilized in the settings as the example given is very basic.
I want to use the category name of the post in the URL. I tried:
/[Category]/[UrlName]
but what I got in the frontend was:
http://localhost:60327/my-page/Telerik.OpenAccess.TrackedList%601[System.Guid]/my-post-name
I also tried
/[Category.Title]/[UrlName]
which just threw errors.
Anyone know how to do this, or better yet, a good reference for the parameters?
I don't think this is possible since the Category property is actually a collection (TrackedList).
In theory you would need one of the collection items, let's say the first one, and your URL expression would be /[Category[0].Title]/[UrlName], but this is currently not supported by the expression parser.
Also, the idea of making the URL dependent on a complex (related) field is not a good idea. If someone deletes that category, they will break all your blog post URLs.
I would suggest you to create a custom text field for the blog post item (ex: CategoryUrl) and then you should be able to set the URL format to /[CategoryUrl]/[UrlName]. Make sure CategoryUrl field is required.

If url ends with ' then show post

I have a website, let's say that my site is example.com.
I would like to show a post if anyone tries to sql injection it. For example if the link is example.com/?portofolio=1 and they type example.com/?portofolio=1' then I would like to show a post/page (refer them to another post) instead of database information (if they get any). Everytime they type ' at the end of every url.
If you are asking how to show that page - that depends on the language and/or framework you are using. This can usually be done with a redirect, though some frameworks allow rendering a different page for the same URL.
If you are asking how to detect SQL injections - that depends on how your code works. Different codes will have different ways to inject SQL. If you are going to go through the trouble of figuring out all the SQL vulnerabilities in your code, and code some rules to try and catch them - wouldn't it be better to remove those vulnerabilities? It'll be easier too - usually the answer is to use SQL parameters instead of concatenating strings.

Best approach to build a DYNAMIC query-by-example form in AngularJS?

I'm relatively experienced with Angular having written many directives, but I have a new requirement where I have to build a query-by-example form into which a user can enter different search criteria. My problem is that I do not know ahead of time what the possible criteria will be. This criteria information will be coming from the server via an ajax request and can differ per user. Thus I will need to dynamically construct a suitable user interface based on the information I get from the server.
I have built individual directives suitable for capturing the search criteria (for example a custom calendar control for date criteria) but I am unsure of the best approach to adding these directives to a form dynamically. Is this even possible in Angular?
I have built something like this before in jQuery but its not so clear to me how I would best do this in an 'Angular way'?
Any suggestions would be most appreciated!
Everything that you can express as a model-to-view projection can be implemented in AngularJS.
I think here you can make a model consisting of "query params". Each of them has name, type and data for filter builder. For example, for the "select" type a data can contain a list of all possible values to choose from.
Then you iterate through the list of "query params" with ng-repeat, rendering each control differently according to its type. That's all.
If I understood the task wrong, please provide more info.

how to handle dynamic objects\controls with OpKey Personal edition

Any idea how to handle dynamic objects and controls from within OpKey Personal. We are using OpKey an automation framework over selenium since past one year but got into a problem lately.
My situation. a control in my web portal is displayed dynamically bsed on certain input parameters i choose. Using regular expression in OpKey object repository is not working.
Any idea how can i handle this situation