Skip to content

Commit

Permalink
Committing built version of 5ca3627
Browse files Browse the repository at this point in the history
  • Loading branch information
10upbot on GitHub committed Jul 2, 2020
1 parent 459668f commit 3465389
Show file tree
Hide file tree
Showing 24 changed files with 5,962 additions and 1 deletion.
144 changes: 143 additions & 1 deletion lang/distributor.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Distributor 1.6.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/distributor\n"
"POT-Creation-Date: 2020-07-02 19:46:11+00:00\n"
"POT-Creation-Date: 2020-07-02 20:13:48+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -277,6 +277,8 @@ msgid "Could not determine remote post id."
msgstr ""

#: includes/classes/PullListTable.php:58
#: vendor/georgestephanis/application-passwords/class.application-passwords-list-table.php:26
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:620
msgid "Name"
msgstr ""

Expand Down Expand Up @@ -641,6 +643,7 @@ msgstr ""

#: includes/external-connection-cpt.php:568
#: includes/external-connection-cpt.php:669
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:583
msgid "Add New"
msgstr ""

Expand Down Expand Up @@ -1020,6 +1023,131 @@ msgstr ""
msgid "Distributed from"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords-list-table.php:27
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:623
msgid "Created"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords-list-table.php:28
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:626
msgid "Last Used"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords-list-table.php:29
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:629
msgid "Last IP"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords-list-table.php:30
#: vendor/georgestephanis/application-passwords/class.application-passwords-list-table.php:76
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:632
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:633
msgid "Revoke"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords-list-table.php:96
msgid "Revoke all application passwords"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:289
msgid ""
"No HTTP Basic Authorization credentials were found submitted with this "
"request."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:405
msgid "Approve Application"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:437
msgid "Authorize Application"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:440
msgid "An application would like to connect to your account."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:445
#. translators: application name.
msgid ""
"Would you like to give the application identifying itself as %1$s access to "
"your account? You should only do this if you trust the app in question."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:449
msgid ""
"Would you like to give this application access to your account? You should "
"only do this if you trust the app in question."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:457
msgid "Application Title:"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:458
msgid "Name this connection…"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:460
msgid "Yes, I approve of this connection."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:478
msgid ""
"You will be given a password to manually enter into the application in "
"question."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:484
msgid "No, I do not approve of this connection."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:501
msgid ""
"You will be returned to the WordPress Dashboard, and we will never speak of "
"this again."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:532
msgid "Your New Application Password:"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:572
msgid ""
"Due to a potential server misconfiguration, it seems that HTTP Basic "
"Authorization may not work for the REST API on this site: `Authorization` "
"headers are not being sent to WordPress by the web server. <a "
"href=\"https://github.com/georgestephanis/application-passwords/wiki/Basic-"
"Authorization-Header----Missing\">You can learn more about this problem, "
"and a possible solution, on our GitHub Wiki.</a>"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:579
msgid "Application Passwords"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:580
msgid ""
"Application passwords allow authentication via non-interactive systems, "
"such as XMLRPC or the REST API, without providing your actual password. "
"Application passwords can be easily revoked. They cannot be used for "
"traditional logins to your website."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:582
msgid "New Application Password Name"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:611
msgid ""
"Be sure to save this in a safe location. You will not be able to retrieve "
"it."
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:612
msgid "Dismiss"
msgstr ""

#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p9/Plugin/Ui.php:54
msgid "View details"
msgstr ""
Expand Down Expand Up @@ -1063,6 +1191,20 @@ msgctxt "verb"
msgid "Trash"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:431
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:605
#. translators: application, password.
msgctxt "application, password"
msgid "Your new password for %1$s is: %2$s"
msgstr ""

#: vendor/georgestephanis/application-passwords/class.application-passwords.php:466
#: vendor/georgestephanis/application-passwords/class.application-passwords.php:490
#. translators: url.
msgctxt "%1$s is a url"
msgid "You will be sent to %1$s"
msgstr ""

#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p9/Plugin/Ui.php:213
msgctxt "the plugin title"
msgid "The %s plugin is up to date."
Expand Down
8 changes: 8 additions & 0 deletions vendor/georgestephanis/application-passwords/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load File.join(
File.dirname(__FILE__),
"vendor/wpsh/local/Vagrantfile"
)

Vagrant.configure(2) do |config|
config.vm.hostname = "application-passwords"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.app-pass-dialog-background {
opacity: 1.0;
background: rgba(0,0,0,0.7);
}

.app-pass-dialog {
padding: 20px;
}

.new-application-password-content {
padding-bottom: 20px;
padding-top: 10px;
}
128 changes: 128 additions & 0 deletions vendor/georgestephanis/application-passwords/application-passwords.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/* global appPass, wp */
( function( $, appPass ) {
var $appPassSection = $( '#application-passwords-section' ),
$newAppPassForm = $appPassSection.find( '.create-application-password' ),
$newAppPassField = $newAppPassForm.find( '.input' ),
$newAppPassButton = $newAppPassForm.find( '.button' ),
$appPassTwrapper = $appPassSection.find( '.application-passwords-list-table-wrapper' ),
$appPassTbody = $appPassSection.find( 'tbody' ),
$appPassTrNoItems = $appPassTbody.find( '.no-items' ),
$removeAllBtn = $( '#revoke-all-application-passwords' ),
tmplNewAppPass = wp.template( 'new-application-password' ),
tmplAppPassRow = wp.template( 'application-password-row' ),
tmplNotice = wp.template( 'application-password-notice' ),
testBasicAuthUser = Math.random().toString( 36 ).replace( /[^a-z]+/g, '' ),
testBasicAuthPassword = Math.random().toString( 36 ).replace( /[^a-z]+/g, '' );

$.ajax( {
url: appPass.root + appPass.namespace + '/test-basic-authorization-header',
method: 'POST',
beforeSend: function( xhr ) {
xhr.setRequestHeader( 'Authorization', 'Basic ' + btoa( testBasicAuthUser + ':' + testBasicAuthPassword ) );
},
error: function( jqXHR ) {
if ( 404 === jqXHR.status ) {
$newAppPassForm.before( tmplNotice( {
type: 'error',
message: appPass.text.no_credentials
} ) );
}
}
} ).done( function( response ) {
if ( response.PHP_AUTH_USER === testBasicAuthUser && response.PHP_AUTH_PW === testBasicAuthPassword ) {
// Save the success in SessionStorage or the like, so we don't do it on every page load?
} else {
$newAppPassForm.before( tmplNotice( {
type: 'error',
message: appPass.text.no_credentials
} ) );
}
} );

$newAppPassButton.click( function( e ) {
e.preventDefault();
var name = $newAppPassField.val();

if ( 0 === name.length ) {
$newAppPassField.focus();
return;
}

$newAppPassField.prop( 'disabled', true );
$newAppPassButton.prop( 'disabled', true );

$.ajax( {
url: appPass.root + appPass.namespace + '/application-passwords/' + appPass.user_id + '/add',
method: 'POST',
beforeSend: function( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', appPass.nonce );
},
data: {
name: name
}
} ).done( function( response ) {
$newAppPassField.prop( 'disabled', false ).val( '' );
$newAppPassButton.prop( 'disabled', false );

$newAppPassForm.after( tmplNewAppPass( {
name: name,
password: response.password
} ) );

$appPassTbody.prepend( tmplAppPassRow( response.row ) );

$appPassTwrapper.show();
$appPassTrNoItems.remove();
} );
} );

$appPassTbody.on( 'click', '.delete', function( e ) {
e.preventDefault();
var $tr = $( e.target ).closest( 'tr' ),
slug = $tr.data( 'slug' );

$.ajax( {
url: appPass.root + appPass.namespace + '/application-passwords/' + appPass.user_id + '/' + slug,
method: 'DELETE',
beforeSend: function( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', appPass.nonce );
}
} ).done( function( response ) {
if ( response ) {
if ( 0 === $tr.siblings().length ) {
$appPassTwrapper.hide();
}
$tr.remove();
}
} );
} );

$removeAllBtn.on( 'click', function( e ) {
e.preventDefault();

$.ajax( {
url: appPass.root + appPass.namespace + '/application-passwords/' + appPass.user_id,
method: 'DELETE',
beforeSend: function( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', appPass.nonce );
}
} ).done( function( response ) {
if ( parseInt( response, 10 ) > 0 ) {
$appPassTbody.children().remove();
$appPassSection.children( '.new-application-password' ).remove();
$appPassTwrapper.hide();
}
} );
} );

$( document ).on( 'click', '.application-password-modal-dismiss', function( e ) {
e.preventDefault();

$( '.new-application-password.notification-dialog-wrap' ).hide();
} );

// If there are no items, don't display the table yet. If there are, show it.
if ( 0 === $appPassTbody.children( 'tr' ).not( $appPassTrNoItems ).length ) {
$appPassTwrapper.hide();
}
}( jQuery, appPass ) );
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* Plugin Name: Application Passwords
* Plugin URI: https://github.com/WordPress/application-passwords
* Description: Creates unique passwords for applications to authenticate users without revealing their main passwords.
* Author: George Stephanis
* Version: 0.1.1
* Author URI: https://github.com/georgestephanis
*/

define( 'APPLICATION_PASSWORDS_VERSION', '0.1.0' );

/**
* Include the application passwords system.
*/
require_once( dirname( __FILE__ ) . '/class.application-passwords.php' );
Application_Passwords::add_hooks();
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions vendor/georgestephanis/application-passwords/assets/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3465389

Please sign in to comment.