Giter VIP home page Giter VIP logo

wp-tide-api's Introduction

WP Tide API

Build Status Coverage Status License: GPL v2

If you're looking for the plugin which updates the WordPress admin UI with the audit results, this is not the plugin you’re looking for, that plugin does not yet exist.

Dependencies

Composer Install

Not required to run if using tide-local.

composer install

Authentication

JWT is implemented for token-based authentication of REST API requests. Each request to the API will need to specify an HTTP Authorization header with the JWT provided as the Bearer Token.

Example: Get token with API Key and API Secret

curl -X POST -F 'api_key=<API_KEY>' -F 'api_secret=<API_SECRET>' http://tide.local/api/tide/v1/auth

Once a token is obtained you can access other REST API resources by specifying the HTTP Authorization header with a bearer token.

Example: Standard WordPress endpoint request with JWT authentication active and using a Bearer token

curl -H "Authorization: Bearer <TOKEN>" http://tide.local/api/tide/v1/audit

Submitting an audit request

Example request:

curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache"  -H "Content-Type: multipart/form-data;" -F "title=<TITLE>" -F "content=<CONTENT>" -F "visibility=public" -F "source_url=<SOURCE_URL>" -F "source_type=zip" -F "request_client=wporg" -F "force=false" -F "slug=<SLUG>"  "http://tide.local/api/tide/v1/audit/"

Request fields:

field description
title Title of the plugin or theme
content Description of the plugin or theme
slug The slug of the plugin or theme
project_type The type of project to audit: theme, plugin
source_url The source to the zip file or git repository
source_type Either zip or git
request_client The login name of a user in the api
force Force a re-audit for existing audits
visibility Whether it is public or private
standards Available standards (comma separated for multiple): phpcs_wordpress, phpcs_wordpress-core, phpcs_wordpress-docs, phpcs_wordpress-extras, phpcs_wordpress-vip, phpcs_phpcompatibility

Private Audits

Audits with visibility set to private will require a Bearer Token for the GET request.

curl -H "Authorization: Bearer <TOKEN>" http://tide.local/api/tide/v1/audit/<ID|CHECKSUM>

or

curl -H "Authorization: Bearer <TOKEN>" http://tide.local/api/tide/v1/audit/<USER_LOGIN>/<SLUG>

Props

@rheinardkorf, @valendesigns, @danlouw, @miina, @sayedtaqui, @DavidCramer, @PatelUtkarsh, @davidlonjon, @kopepasah

wp-tide-api's People

Contributors

valendesigns avatar rheinardkorf avatar danlouw avatar man4toman avatar jeffpaul avatar

Watchers

James Cloos 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.