d2-obsidian icon indicating copy to clipboard operation
d2-obsidian copied to clipboard

obsidian d2 plugin (v1.1.4) Doesn't consume TALA license from the json file it asserts it does.

Open wolfspyre opened this issue 1 year ago • 0 comments

I tested to make sure I wasn't insane^H^H^H^H^H^Hmissing something:

  • The plugin says it looks for: ~/.local/state/tstruct/auth.json and consumes the value of the key api_token for TALA license validation.

  • d2 / tala use ~/.config/tstruct/auth.json in the same format.

  • I validated that d2/tala cli are consuming my license properly:

$ d2 layout tala|grep -E '(API token \(v|Email:|Renewal)'
*** API token (v1) found from ~/.config/tstruct/auth.json ***
Email:        [email protected]
Renewal Date: 30 Nov 25 15:49 CST
  • I validated that the content is the same between ~/.local/state/tstruct/auth.json and ~/.config/tstruct/auth.json:
me@host:~$ md5 /Users/me/.local/state/tstruct/auth.json
MD5 (/Users/me/.local/state/tstruct/auth.json) = 58ef8caefcefb8670bf34583b1bf5282
me@host:~$ md5 ~/.config/tstruct/auth.json
MD5 (/Users/me/.config/tstruct/auth.json) = 58ef8caefcefb8670bf34583b1bf5282

so from a files in place perspective, this should accomplish the needful as far as I can tell; however: if I configure the D2 plugin in obsidian to use the TALA layout, and I do NOT paste an api token into the configuration pane within obsidian, diagrams are rendered as unlicensed.

once I paste the exact same value as is stored in the specified json file under the 'api_token' key into the API token window in obsidian, diagrams are properly rendered:

Note - no API key in the config ui: d2plugin_obsidian_bug_00

validation that the files have the same content, and that the d2 binary sees the license file, and validates it properly: d2plugin_obsidian_bug_01

SAD PANDA: d2plugin_obsidian_bug_02

Paste API token into UI: d2plugin_obsidian_bug_03

LESS?? sad panda... d2plugin_obsidian_bug_04 (yes it works... but.... )

is there any additional information I can provide about my env that would be helpful?

wolfspyre avatar Dec 09 '24 06:12 wolfspyre