chg-meridian / chg.extensions.security.txt Goto Github PK
View Code? Open in Web Editor NEWProvides a middleware for the security.txt (see https://securitytxt.org/)
License: Apache License 2.0
Provides a middleware for the security.txt (see https://securitytxt.org/)
License: Apache License 2.0
Is your feature request related to a problem? Please describe.
The RFC for security.txt supports redirects e.g. from app.example.com/.well-known/security.txt to example.com/.well-known/security.txt or from another-example.com//.well-known/security.txt to example.com/.well-known/security.txt
Describe the solution you'd like
Would you support a new feature to allow this? Possible implementations I was thinking of include:
Service registration that passes in a Uri to redirect to
builder.Services.AddSecurityText(new Uri("https://example.com/.well-known/security.txt"));
OR using the existing TextBuilder approach
builder.Services.AddSecurityText(textBuilder =>
{
textBuilder
.SetRedirect(new Uri("https://example.com/.well-known/security.txt"))
});
Describe alternatives you've considered
None
Additional context
I'm happy to work on this and submit a pull request if you agree to the feature's implementation.
Does this project use any Continuous Integration Tool? If so, is it online? (TravisCI, CircleCI), or offline tool (Jenkins, Hudson).
Due to the recommendation by Microsoft (https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/) this library should have a strong-name.
Hi,
The CreateComment method in the SecurityTextContainer uses ~~
as intermediate string for normalizing line endings in input data. This may lead to problems when the comment itself contains these characters. A better solution could be to replace those combinations with e.g. \n
to avoid intermediate string placeholders that could be used in a regular comment.
Additionally the new line characters \r\n,
\r
and \n
are replaced with Environment.NewLine
which leads to different output depending on which plattform it is hosted. Maybe we should specify which line ending should be used more explicitly so the behaviour will be the same regardless of the plattform that hosts the middleware. Is it a candidate for options/settings?
Describe the bug
app.UseSecurityText()
throws exception, when loading from a text file, even when file does contain the Contact: directive.
Shouldn't throw exception
Exception thrown: 'CHG.Extensions.Security.Txt.InvalidSecurityInformationException' in CHG.Extensions.Security.Txt.dll
An exception of type 'CHG.Extensions.Security.Txt.InvalidSecurityInformationException' occurred in CHG.Extensions.Security.Txt.dll but was not handled in user code
The "Contact: " directive MUST always be present in a security.txt file.
Contact: mailto:[email protected]
services.AddSecurityText(builder =>
builder.ReadFromFile("./security.txt")
);
app.UseMvc
call: app.UseSecurityText()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.