Git Product home page Git Product logo

thirdlicense's Issues

Generate license in RTF format

The MSI installers requires an RTF file to show the license. The tool should be able to generate the format so the file can be automatically included.

Issue: Retrieving private Azure DevOps Artifacts NuGet Feed cause exception

Hi there.

Firstly, I wanted to say this is a really useful library. I didn't see a bug template for this repository, so I just tried to include as much detail as possible.

Steps

  1. Add a NuGet.config to repository
  2. Add a private Azure DevOps Artifact NuGet Feed Package Source to the packageSources , e.g. <packageSources><add key="AzureDevOps" value="https://pkgs.dev.azure.com/.../nuget/v3/index.json" /></packageSources>
  3. Add and reference a package from Azure DevOps Artifact NuGet Feed to a csproj
  4. Run thirdlicense --project {project}

Observed
There is an unhandled exception with HTTP Status Code of 401 (Unauthorized).

Expectation
I believe Third License should either:

  1. use cached NuGet credentials (or prompt for NuGet credentials from the user)
  2. have a flag to ignore the failed source(s) (similar to the parameter --ignore-failed-sources in dotnet restore)

I have no experience with the NuGet SDK so I don't think I can do option 1, but I am more than happy to contribute a PR for option 2. If that would be okay?


Stack Trace

Unhandled exception: NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://pkgs.dev.azure.com/{redacted}/_packaging/{redacted}/nuget/v3/index.json.
 ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at NuGet.Protocol.HttpSource.<>c__DisplayClass15_0`1.<<GetAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func`2 action, CancellationToken token)
   at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func`2 action, CancellationToken token)
   at NuGet.Protocol.HttpSource.GetAsync[T](HttpSourceCachedRequest request, Func`2 processAsync, ILogger log, CancellationToken token)
   at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
   --- End of inner exception stack trace ---
   at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
   at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
   at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
   at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T]()
   at NuGet.Protocol.HttpFileSystemBasedFindPackageByIdResourceProvider.TryCreate(SourceRepository sourceRepository, CancellationToken token)
   at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
   at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T]()
   at ThirdLicense.NuGetProtocolInspector.AddRepositoryAsync(PackageSource source) in /home/runner/work/ThirdLicense/ThirdLicense/src/ThirdLicense/NuGetProtocolInspector.cs:line 130
   at ThirdLicense.NuGetProtocolInspector.AddDefaultEndpointsAsync() in /home/runner/work/ThirdLicense/ThirdLicense/src/ThirdLicense/NuGetProtocolInspector.cs:line 88
   at ThirdLicense.Program.Generate(String project, String endpoint, FileInfo output) in /home/runner/work/ThirdLicense/ThirdLicense/src/ThirdLicense/Program.cs:line 96
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()

Append manual dependencies

Some programs use dependencies that are not specified as NuGet dependencies. In some cases, the developer must provide manually its licenses. This tool could accept as a parameter a file with that description. Potential options:

  • Flag to append instead of overwrite the output into an existing file (that would contain the manual dependencies).
    • If you run twice the tool, it would append twice.
  • Flag to use a custom header / tail for the output file
    • It may cause issues in some license generator like Markdown where it would generate already a title
  • Flag to use a JSON / YAML / TOML file that describes the third-parties to consider
    • This solution would integrate better with the license generator code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.