Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auth option with latest API #284

Merged
merged 6 commits into from
Feb 26, 2024
Merged

Add auth option with latest API #284

merged 6 commits into from
Feb 26, 2024

Conversation

RamanaReddy0M
Copy link
Contributor

@RamanaReddy0M RamanaReddy0M commented Feb 21, 2024

Related PRs:

From utils:

Example:

✗ ./asnmap -auth    

   ___   _____  __              
  / _ | / __/ |/ /_ _  ___ ____ 
 / __ |_\ \/    /  ' \/ _  / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
                         /_/ 

                projectdiscovery.io

[INF] Get your free api key by signing up at https://cloud.projectdiscovery.io
[*] Enter PDCP API Key (exit to abort): 
[INF] Successfully logged in as (@ramana.reddy)
✗ ./asnmap -d projectdiscovery.io 

   ___   _____  __              
  / _ | / __/ |/ /_ _  ___ ____ 
 / __ |_\ \/    /  ' \/ _  / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
                         /_/ 

                projectdiscovery.io

[INF] Current asnmap version v1.0.6 (latest)
104.23.144.0/20
104.23.160.0/19
104.23.192.0/18
104.24.0.0/15
104.26.0.0/20
172.67.0.0/16
172.68.0.0/22
172.68.4.0/23
172.68.6.0/24

@RamanaReddy0M RamanaReddy0M marked this pull request as draft February 21, 2024 12:40
@RamanaReddy0M RamanaReddy0M self-assigned this Feb 21, 2024
@RamanaReddy0M RamanaReddy0M linked an issue Feb 21, 2024 that may be closed by this pull request
@RamanaReddy0M RamanaReddy0M marked this pull request as ready for review February 21, 2024 15:57
@RamanaReddy0M RamanaReddy0M marked this pull request as draft February 22, 2024 06:35
@tarunKoyalwar
Copy link
Member

New Changes

  • Interactive Api Key Prompt/Login is only triggered in CLI Mode & downstream application's should implement in respective tools
  • Following output will always be printed to console in all downstream tools that use asnmap api but did not specify / pass api key
[asnmap-api] missing or invalid api key (get your free api key from https://cloud.projectdiscovery.io)

along with this ErrUnAuthorized is returned as response and downstream tools should explicitly check for this error and handle as per required logic

CLI

./asnmap -ip 37.60.229.15 -json                                                                                    130 ↵

   ___   _____  __              
  / _ | / __/ |/ /_ _  ___ ____ 
 / __ |_\ \/    /  ' \/ _  / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
                         /_/ 

		projectdiscovery.io

[INF] Current asnmap version v1.0.6 (latest)
[asnmap-api] missing or invalid api key (get your free api key from https://cloud.projectdiscovery.io)
[INF] Try again after authenticating with PDCP

[INF] Get your free api key by signing up at https://cloud.projectdiscovery.io
[*] Enter PDCP API Key (exit to abort): 
[INF] Successfully logged in as (@tarun)

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

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

lgtm !

@ehsandeep ehsandeep merged commit f852563 into dev Feb 26, 2024
4 checks passed
@ehsandeep ehsandeep deleted the issue-282-auth-option branch February 26, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for auth option using latest API with auth
3 participants