Coder Social home page Coder Social logo

akamai-redirect-checker's Introduction

Akamai Redirect Checker


The Akamai Redirect Checker is a script which checks provided URLs against the staging network of Akamai. It does this by getting the first CNAME of a domain (which usually is the Akamai CNAME) and get its value. Then it simply changes the CNAME value to the staging version and get its IP. It also supports the production network to quickly check if implemented changes work.

Dependencies


Make sure you have Python3 installed. This module uses the following Python packages

  • urllib3
  • dnspython
  • requests
  • openpyxl
pip3 install urllib3 dnspython requests argparse openpyxl 

Or use the provided setup.sh script. This script will install Python3 and its dependencies together with the required Python packages. It will also prompt you to create the archer command.

Usage


Manually provide source only

One of the options is to provide a source only. The script will return the final destination of the source with its status code.

Example:

python archer.py -s https://www.philips-hue.com/support

Expected result:

[200] https://www.philips-hue.com/nl-nl/support/faq

Manually provide source and destination

When you provide a source with a destination the script will check if the final destination matches the provided destination.

Example:

python archer.py -s https://www.philips-hue.com/support -d https://www.philips-hue.com/nl-nl/support/faq

Expected result:

[Success] Redirect works!

Provide a file with sources and destinations

Example:

python archer.py -f redirects.xlsx

Result example:

[1][Success] Redirect works!
[2][Failed] Final destination does not match target URL!
[3][Success] Redirect works!
[4][Success] Redirect works!

Relaxed source and/ or destination flags

The redirect check requires a protocol in the URL to function, https for example. This is why you'll need to provide a full URL. This can however be 'omitted'. By using the --relaxed-destination or --relaxed-source flags.

These flags are available for the sole reason to make working with files easier. Some customers do not include the http or https protocol in their request files. By using --relaxed-source we will automatically add the http port to URLs that do not have a protocol defined. The same principle applies to the destination URL with --relaxed-destination.

Script flags

Flag Function
-h, --help Shows the help message
-f, --file Provide a file with two columns in which the first has the source and the second has the destination URLs.
-s, --source URL that needs to be redirected. Will print the destination with status code if provided without destination.
-d, --destination Excepted destination URL. Will show if the redirect is successful by returning a success or fail message.
-rs, --relaxed-source Relaxes the matching criteria by auto adding http:// to the source URL if it is missing.
-rd, --relaxed-destination Relaxes the matching criteria by auto adding https:// to the destination URL if it is missing.
-p, --production Routes DNS requests over the production network instead of staging.
-v, --verbose Displays the found config and redirect trace.

akamai-redirect-checker's People

Watchers

Alexander Moraal avatar

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.