Add AppleScript to get authentication token and place in home directory, used for OSX GUI app to authenticate a user as authorized to admin ZT1.

This commit is contained in:
Adam Ierymenko 2013-11-18 15:06:05 -05:00
parent 77bab13546
commit 0adc91d6cb
9 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>applet</string>
<key>CFBundleIconFile</key>
<string>applet</string>
<key>CFBundleIdentifier</key>
<string>com.zerotier.one.ZeroTierOneMacAuthenticateScript</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>ZeroTier One (Authenticate)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>aplt</string>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6</string>
</dict>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>(c) 2013 ZeroTier Networks LLC</string>
<key>WindowState</key>
<dict>
<key>dividerCollapsed</key>
<false/>
<key>eventLogLevel</key>
<integer>-1</integer>
<key>name</key>
<string>ScriptWindowState</string>
<key>positionOfDivider</key>
<real>333</real>
<key>savedFrame</key>
<string>7 181 602 597 0 0 1280 778 </string>
<key>selectedTabView</key>
<string>result</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1 @@
APPLaplt

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

View File

@ -0,0 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf1265
{\fonttbl}
{\colortbl;\red255\green255\blue255;}
}

View File

@ -2,7 +2,30 @@
#include "aboutwindow.h"
#include "ui_mainwindow.h"
#include <string>
#include <map>
#include <vector>
#include <QClipboard>
#include <QMutex>
static std::map< unsigned long,std::vector<std::string> > ztReplies;
static QMutex ztReplies_m;
static void handleZTMessage(void *arg,unsigned long id,const char *line)
{
ztReplies_m.lock();
if (*line) {
ztReplies[id].push_back(std::string(line));
ztReplies_m.unlock();
} else {
std::vector<std::string> resp(ztReplies[id]);
ztReplies.erase(id);
ztReplies_m.unlock();
}
}
// Globally visible
ZeroTier::Node::LocalClient *zeroTierClient = (ZeroTier::Node::LocalClient *)0;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),

View File

@ -3,10 +3,16 @@
#include <QMainWindow>
#include "../node/Node.hpp"
namespace Ui {
class MainWindow;
}
// Globally visible instance of local client for communicating with ZT1
// Can be null if not connected, or will point to current
extern ZeroTier::Node::LocalClient *zeroTierClient;
class MainWindow : public QMainWindow
{
Q_OBJECT