Lenard Frommelt
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    [![hackmd-github-sync-badge](https://hackmd.io/EtJSEnxjTVOOvRJdWGJlYw/badge)](https://hackmd.io/EtJSEnxjTVOOvRJdWGJlYw) ###### tags: `documentation` `sci` # [secretmanagementinterface](https://github.com/JhonnyJason/secretmanagementinterface) v0.3 For further reference what the Secret Management is all about [read this](https://hackmd.io/PZjpRfzPSBCqS-8K54x2jA). ## Basic ### /getNodeId Returns the `serverNodeId` of the Secret Manager service. Requires an `authCode` to actually do something. For general public requests we use the `authCode` of `deadbeefcafebabedeadbeefcafebabedeadbeefcafebabedeadbeefcafebabe`. This is the default on any new Instance - it is recommended to switch the publicly known `authCode` frequently in production. #### request ```javascript { authCode: STRINGHEX64 } ``` #### response ```javascript { serverNodeId: STRINGHEX64, timestamp: NUMBER, signature: STRINGHEX128 } ``` ### /createAuthCode This request creates an `authCode` for a certain action. The `authCode` will be shared to the requestor. Therefore we need to accept secrets from the SecretManager first. Actions that require authCodes: - `getNodeId` - `setRequestableServer` - `deleteRequestableServer` - `openSecretSpace` #### request ```javascript { action: STRING, publicKey: STRINGHEX64, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ## Secret Spaces ### /openSecretSpace If there is no `secretSpace` for this `nodeId` it creates an new `SecretSpace` object. If there is a `closureDate` defined it will be closed(removed) at the specified date. If we have a `closureDate` defined and a `secretSpace` already exists for this `nodeId` we will reply with an error. We must have a valid `authCode`. This way we could limit the creation of `secretSpaces` to people we trust. - `authCode` is to be generated by a user who already has access to the server via `/createAuthCode` specifying the `createSecretSpace` option (32byte as hex encoded string) - `publicKey` or `nodeId` will be the id of the secretSpace - only a person proofing ownership of the right `privateKey` has access to modify, delete and read the `secretSpace` (32byte as hex encoded string) - `closureDate` defines the exact time the secretSpace will automatically be deleted. May be `null` (=never be deleted) or `+4hours` (=will be deleted in 4 hours) or `+4days` (=will be deleted in 4 days) or `+4month` (=will be deleted in 4 month) or `+4years` (=will be deleted in 4 years) or a valid Unix Timestamp of an exact date to close the space. #### request ```javascript { authCode: STRINGHEX64, publicKey: STRINGHEX64, closureDate: NUMBER, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ### /getSecretSpace Returns the encrypted version of the whole `secretSpace`. #### request ```javascript { publicKey: STRINGHEX64, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { referencePoint: STRINGHEX64, encryptedContent: STRINGHEX } ``` ### /deleteSecretSpace This will remove the `secretSpace` and all it's `subSpaces` effectivly deleting the according `nodeId` from the server. #### request ```javascript { publicKey: STRINGHEX64, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ## Secrets ### /setSecret Encryptes the given `secret` and stores it at `secretId` within the owners' `secretSpace`. It still is recommended to also encrypt the secret beforen sending it. (As we should not completely trust SSL using CAs.) #### request ```javascript { publicKey: STRINGHEX64, secretId: STRING, secret: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ### /getSecret Returns the encrypted secret of the given `secretId`. #### request ```javascript { publicKey: STRINGHEX64, secretId: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce, NUMBER } ``` #### response ```javascript { referencePoint: STRINGHEX64, encryptedContent: STRINGHEX } ``` ### /deleteSecret Deletes the given `secretId` from the `secretSpace`. #### request ```javascript { publicKey: STRINGHEX64, secretId: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ## Sub Spaces ### /openSubSpace If it does not exist it will create a new `subSpace` which goes by the key `fromId` within our `subSpaces`. Now the `fromId` may write secrets into this `subSpace`. Also the `subSpace` may be temporary. Therefore we should specify a `closureDate` as not `null`. #### request ```javascript { publicKey: STRINGHEX64, fromId: STRINGHEX64, closureDate: NUMBER, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ### /getSubSpace Returns the encrypted version of the specified `subSpace`. #### request ```javascript { publicKey: STRINGHEX64, fromId: STRINGHEX64, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { referencePoint: STRINGHEX64, encryptedContent: STRINGHEX } ``` ### /deleteSubSpace This will delete the object which goes by the key `fromId` within our `subSpaces`. All shared secrets in there are lost. And the `fromId` could not share any secrets to us. #### request ```javascript { publicKey: STRINGHEX64, fromId: STRINGHEX64, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ## Shared Secrets ### /shareSecretTo This will write the secret into the `subSpace` of the `shareToId` if it exists. We also may specify `isOneTimeSecret = true`. This means that the `shareToId` picks the secret up once - then it would be automatically deleted. #### request ```javascript { publicKey: STRINGHEX64, shareToId: STRINGHEX64, secretId: STRING, secret: STRING, isOneTimeSecret: BOOLEAN, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ### /getSecretFrom Returns the encrypted secret shared to us by `fromId` having the id `secretId`. #### request ```javascript { publicKey: STRINGHEX64, fromId: STRINGHEX64, secretId: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { referencePoint: STRINGHEX64, encryptedContent: STRINGHEX } ``` ### /deleteSharedSecret This will delete the specified `secretId` if it exists in the available `subSpace` of the `sharedToId`. #### request ```javascript { publicKey: STRINGHEX64, sharedToId: STRINGHEX64, secretId: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ## Notifications ### /addNotificationHook This creates a hook to notify a `requestableServer` of some action. You may add multiple notificationHooks on the same target. We have type `log` which uses every action on the `targetId` to send a `logNotification`. Then we have the types `event onGet`, `event onSet` and `event onDelete` which would only send the specific action as an `eventNotification`. The `targetId` is either `this`, `secrets.mySpecificSecretId`, `subSpaces.deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef` or `subSpaces.deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef.secretIdSharedToMe`. Last but not least important is the `notifyURL` where the specific notification is being sent to. The response is the `notificationHookObject`. Containing the `id` which is the `notificationHookId`to be used for deleting, the `type` as given by the request and the `url` as more handy version for the given `notifyURL`. Also there is an `notificationError` field which will indicat if there is something wrong, with the notification. When there is no error on the Notification, then the `notificationError` is `null`. *Note: when the `notificationHook` is being created, an initial notification is fired to determine the initial error content* #### request ```javascript { publicKey: STRINGHEX64, type: STRING, targetId: STRING, notifyURL: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { id: STRINGHEX32, type: STRING, url: STRING, notificationError: OBJECT } ``` ### /getNotificationHooks This retrieves the all `notificationHookObject`s of the specified `targetId`. #### request ```javascript { publicKey: STRINGHEX64, targetId: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { notificationHooks: ARRAY } ``` ### /deleteNotificationHook The notification hook is identified by it's `id` specified here as `notificationHookId`. #### request ```javascript { publicKey: STRINGHEX64, notificationHookId: STRINGHEX32, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ## Requestable Servers *Note: the API for limiting Requestable Servers exists in the specification however it is not Implemented in v0.3. It must be reasoned more about how this feature will be used exactly and if it is necessary even.* ### /setRequestableServer #### request ```javascript { authCode: STRINGHEX64, serverURL: STRING, serverNodeId: STRINGHEX64, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ``` ### /getRequestableServer #### request ```javascript { serverURL: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { serverURL: STRING serverNodeId: STRINGHEX64 } ``` ### /deleteRequestableServer #### request ```javascript { authCode: STRINGHEX64, serverURL: STRING, timestamp: NUMBER, signature: STRINGHEX128, nonce: NUMBER } ``` #### response ```javascript { ok: true } ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully