| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="JavaScriptLibraryMappings"> | ||
| <includedPredefinedLibrary name="ECMAScript 6" /> | ||
| </component> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="JavaScriptSettings"> | ||
| <option name="languageLevel" value="ES6" /> | ||
| </component> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="ProjectTasksOptions" suppressed-tasks="Babel" /> | ||
| </project> |
| /** | ||
| * Created by awei on 2016/8/1. | ||
| */ | ||
| import crypto from 'crypto' | ||
| export default function (config) { | ||
| var expiration = new Date() | ||
| expiration.setMilliseconds(expiration.getMilliseconds() + config.expiration) | ||
| var policyBase64 = new Buffer( | ||
| JSON.stringify( | ||
| { | ||
| expiration: expiration, | ||
| conditions: [ | ||
| ['content-length-range', 0, config.contentLength] | ||
| ] | ||
| } | ||
| ) | ||
| ).toString('base64') | ||
| return { | ||
| policy: policyBase64, | ||
| OSSAccessKeyId: config.accessId, | ||
| signature: crypto.createHmac('sha1', config.accessKey).update(policyBase64).digest().toString('base64') | ||
| } | ||
| } |
+213
-11
@@ -5,3 +5,7 @@ <?xml version="1.0" encoding="UTF-8"?> | ||
| <list default="true" id="15360143-9f5f-448c-bdde-8689bb1385c4" name="Default" comment=""> | ||
| <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.gitignore" /> | ||
| <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/dev/build.js" /> | ||
| <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/dev/oss-sign.js" /> | ||
| <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" /> | ||
| <change type="MODIFICATION" beforePath="$PROJECT_DIR$/oss-sign.js" afterPath="$PROJECT_DIR$/oss-sign.js" /> | ||
| <change type="MODIFICATION" beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" /> | ||
| </list> | ||
@@ -29,5 +33,15 @@ <ignored path="oss-sign.iws" /> | ||
| <leaf> | ||
| <file leaf-file-name=".gitignore" pinned="false" current-in-tab="true"> | ||
| <file leaf-file-name=".gitignore" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/.gitignore"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="45"> | ||
| <caret line="3" column="12" selection-start-line="3" selection-start-column="12" selection-end-line="3" selection-end-column="12" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="oss-sign.js" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/dev/oss-sign.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="0"> | ||
@@ -40,7 +54,56 @@ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | ||
| </file> | ||
| <file leaf-file-name="build.js" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/dev/build.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="75"> | ||
| <caret line="7" column="4" selection-start-line="7" selection-start-column="4" selection-end-line="7" selection-end-column="4" /> | ||
| <folding> | ||
| <element signature="e#0#40#0" expanded="false" /> | ||
| </folding> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="oss-sign.js" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/oss-sign.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="285"> | ||
| <caret line="19" column="2" selection-start-line="19" selection-start-column="2" selection-end-line="19" selection-end-column="2" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="package.json" pinned="false" current-in-tab="true"> | ||
| <entry file="file://$PROJECT_DIR$/package.json"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="135"> | ||
| <caret line="9" column="1" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| </leaf> | ||
| </component> | ||
| <component name="FileTemplateManagerImpl"> | ||
| <option name="RECENT_TEMPLATES"> | ||
| <list> | ||
| <option value="JavaScript File" /> | ||
| </list> | ||
| </option> | ||
| </component> | ||
| <component name="Git.Settings"> | ||
| <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> | ||
| </component> | ||
| <component name="IdeDocumentHistory"> | ||
| <option name="CHANGED_PATHS"> | ||
| <list> | ||
| <option value="$PROJECT_DIR$/dev/build.js" /> | ||
| <option value="$PROJECT_DIR$/dev/dist/oss-sign.js" /> | ||
| <option value="$PROJECT_DIR$/.gitignore" /> | ||
| <option value="$PROJECT_DIR$/package.json" /> | ||
| </list> | ||
| </option> | ||
| </component> | ||
| <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" /> | ||
@@ -56,4 +119,4 @@ <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" /> | ||
| <component name="ProjectFrameBounds"> | ||
| <option name="x" value="366" /> | ||
| <option name="y" value="223" /> | ||
| <option name="x" value="157" /> | ||
| <option name="y" value="46" /> | ||
| <option name="width" value="1920" /> | ||
@@ -106,2 +169,16 @@ <option name="height" value="977" /> | ||
| </PATH> | ||
| <PATH> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="oss-sign" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="oss-sign" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="dev" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| </PATH> | ||
| </subPane> | ||
@@ -115,8 +192,67 @@ </pane> | ||
| <property name="WebServerToolWindowFactoryState" value="false" /> | ||
| <property name="nodejs_interpreter_path" value="/usr/local/bin/node" /> | ||
| <property name="settings.editor.selected.configurable" value="Settings.JavaScript" /> | ||
| <property name="JavaScriptPreferStrict" value="false" /> | ||
| <property name="JavaScriptWeakerCompletionTypeGuess" value="true" /> | ||
| <property name="js-jscs-nodeInterpreter" value="/usr/local/bin/node" /> | ||
| <property name="settings.editor.splitter.proportion" value="0.2" /> | ||
| </component> | ||
| <component name="RecentsManager"> | ||
| <key name="MoveFile.RECENT_KEYS"> | ||
| <recent name="$PROJECT_DIR$" /> | ||
| </key> | ||
| <key name="CopyFile.RECENT_KEYS"> | ||
| <recent name="$PROJECT_DIR$/dev" /> | ||
| <recent name="$PROJECT_DIR$" /> | ||
| </key> | ||
| </component> | ||
| <component name="RunManager"> | ||
| <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma"> | ||
| <config-file value="" /> | ||
| <node-interpreter value="project" /> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir=""> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="cucumber.js" factoryName="Cucumber.js"> | ||
| <option name="cucumberJsArguments" value="" /> | ||
| <option name="executablePath" /> | ||
| <option name="filePath" /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="js.build_tools.npm" factoryName="npm"> | ||
| <command value="run-script" /> | ||
| <scripts /> | ||
| <node-interpreter value="project" /> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha"> | ||
| <node-interpreter>project</node-interpreter> | ||
| <node-options /> | ||
| <working-directory /> | ||
| <pass-parent-env>true</pass-parent-env> | ||
| <envs /> | ||
| <ui /> | ||
| <extra-mocha-options /> | ||
| <test-kind>DIRECTORY</test-kind> | ||
| <test-directory /> | ||
| <recursive>false</recursive> | ||
| <method /> | ||
| </configuration> | ||
| </component> | ||
| <component name="ShelveChangesManager" show_recycled="false"> | ||
@@ -133,20 +269,30 @@ <option name="remove_strategy" value="false" /> | ||
| <workItem from="1477379889388" duration="63000" /> | ||
| <workItem from="1477379957539" duration="280000" /> | ||
| <workItem from="1477379957539" duration="1329000" /> | ||
| </task> | ||
| <task id="LOCAL-00001" summary="创建"> | ||
| <created>1477380260226</created> | ||
| <option name="number" value="00001" /> | ||
| <option name="presentableId" value="LOCAL-00001" /> | ||
| <option name="project" value="LOCAL" /> | ||
| <updated>1477380260226</updated> | ||
| </task> | ||
| <option name="localTasksCounter" value="2" /> | ||
| <servers /> | ||
| </component> | ||
| <component name="TimeTrackingManager"> | ||
| <option name="totallyTimeSpent" value="343000" /> | ||
| <option name="totallyTimeSpent" value="1392000" /> | ||
| </component> | ||
| <component name="ToolWindowManager"> | ||
| <frame x="366" y="223" width="1920" height="977" extended-state="0" /> | ||
| <editor active="false" /> | ||
| <frame x="157" y="46" width="1920" height="977" extended-state="0" /> | ||
| <editor active="true" /> | ||
| <layout> | ||
| <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24960506" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> | ||
| <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24960506" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> | ||
| <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> | ||
| <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32945284" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> | ||
| <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> | ||
@@ -156,7 +302,5 @@ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> | ||
| <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | ||
| </layout> | ||
@@ -175,2 +319,8 @@ </component> | ||
| </component> | ||
| <component name="VcsManagerConfiguration"> | ||
| <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> | ||
| <option name="CHECK_NEW_TODO" value="false" /> | ||
| <MESSAGE value="创建" /> | ||
| <option name="LAST_COMMIT_MESSAGE" value="创建" /> | ||
| </component> | ||
| <component name="XDebuggerManager"> | ||
@@ -181,4 +331,40 @@ <breakpoint-manager /> | ||
| <component name="editorHistoryManager"> | ||
| <entry file="file://$PROJECT_DIR$/oss-sign.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="345"> | ||
| <caret line="23" column="0" selection-start-line="23" selection-start-column="0" selection-end-line="23" selection-end-column="0" /> | ||
| <folding> | ||
| <element signature="e#0#39#0" expanded="false" /> | ||
| </folding> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/dev/dist/build.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="0"> | ||
| <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/dev/build.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="75"> | ||
| <caret line="7" column="4" selection-start-line="7" selection-start-column="4" selection-end-line="7" selection-end-column="4" /> | ||
| <folding> | ||
| <element signature="e#0#40#0" expanded="false" /> | ||
| </folding> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/.gitignore"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="45"> | ||
| <caret line="3" column="12" selection-start-line="3" selection-start-column="12" selection-end-line="3" selection-end-column="12" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/dev/oss-sign.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="0"> | ||
@@ -190,3 +376,19 @@ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/oss-sign.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="285"> | ||
| <caret line="19" column="2" selection-start-line="19" selection-start-column="2" selection-end-line="19" selection-end-column="2" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/package.json"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="135"> | ||
| <caret line="9" column="1" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </component> | ||
| </project> |
+13
-16
| /** | ||
| * Created by awei on 2016/8/1. | ||
| */ | ||
| import crypto from 'crypto' | ||
| export default function (config) { | ||
| var expiration = new Date() | ||
| expiration.setMilliseconds(expiration.getMilliseconds() + config.expiration) | ||
| var policyBase64 = new Buffer( | ||
| JSON.stringify( | ||
| { | ||
| expiration: expiration, | ||
| conditions: [ | ||
| ['content-length-range', 0, config.contentLength] | ||
| ] | ||
| } | ||
| ) | ||
| ).toString('base64') | ||
| 'use strict'; | ||
| var crypto = require('crypto'); | ||
| module.exports = function (config) { | ||
| var expiration = new Date(); | ||
| expiration.setMilliseconds(expiration.getMilliseconds() + config.expiration); | ||
| var policyBase64 = new Buffer(JSON.stringify({ | ||
| expiration: expiration, | ||
| conditions: [['content-length-range', 0, config.contentLength]] | ||
| })).toString('base64'); | ||
| return { | ||
@@ -22,3 +19,3 @@ policy: policyBase64, | ||
| signature: crypto.createHmac('sha1', config.accessKey).update(policyBase64).digest().toString('base64') | ||
| } | ||
| } | ||
| }; | ||
| }; |
+1
-1
| { | ||
| "name": "oss-sign", | ||
| "version": "0.0.1", | ||
| "version": "0.0.2", | ||
| "author": { | ||
@@ -5,0 +5,0 @@ "name": "余阿伟" |
Sorry, the diff of this file is not supported yet
22756
83.03%12
50%40
73.91%