playground icon indicating copy to clipboard operation
playground copied to clipboard

Improve share functionality

Open fjogeleit opened this issue 2 years ago • 5 comments

Current share function implementation:

  • Combine Resources, Policies and Context as JSON String
  • Compress and encode to base64 string to reduce length using lzstring
  • Adding the content as query param and load it on page loading/mounting

Advantages

  • No expiration
  • Stateless

Disadvantages

  • Very long URL
  • Could not be send as via tools like Slack

Find a way to somehow shorten the URL and improve the UX

fjogeleit avatar May 12 '23 08:05 fjogeleit

Any free service we can use for that ?

Should be an option when generating the share link IMHO.

eddycharly avatar May 15 '23 09:05 eddycharly

I searched for one but no luck, the api had only pay plans

fjogeleit avatar May 15 '23 09:05 fjogeleit

IMO this is pretty low on the priority list. The biggest advantage with the current implementation is that it IS stateless and has no dependency on an external service. The cost of a long URL is fairly trivial, I believe.

chipzoller avatar May 20 '23 12:05 chipzoller

Can we leverage GitHub Gists to store the artifacts?

It will require a login but that may be OK and with SSO the user experience is pretty good.

JimBugwadia avatar May 20 '23 21:05 JimBugwadia

I created the issue because in first tests slack was not able to post the created links, I assumed it was because of the length but maybe it was because of the insecure domain (http). So the current way works quite good.

What would be the outcome of persisting it in a gist?

fjogeleit avatar May 21 '23 09:05 fjogeleit