Jacherr / assyst2

Assyst Discord Bot 2.0 rewrite
https://jacher.io/assyst
MIT License
19 stars 4 forks source link

Assyst HTTP Headers for tags that use third party APIs #16

Open fres621 opened 1 month ago

fres621 commented 1 month ago

What would you like to see added to Assyst? Assyst tags let us use our own APIs and we can verify that the request was made via Assyst because the IP it uses to fetch is always the same, however it'd be useful to additionally have some headers to identify the server, channel and tag that made the http request

Additional context This'd let us who already own private APIs let Assyst tags access them without the risk of abuse if for example we could check the tag's owner ID, guild ID etc Suggested headers:

X-Assyst-Guild: guild ID
X-Assyst-Channel: channel ID
X-Assyst-Caller: ID of user who used tag
X-Assyst-Tag: Preferably would hold some object (could be JSON or comma separated with set values) that would have basic information about the tag like the tag name and tag owner ID
fres621 commented 1 month ago

if a tag is invoked within other tag using {tag:name} then there should either be an indication of so or the X-Assyst-Tag object would hold data of the most external tag (e.g. if tag outer calls tag inner which does a request, the object should give information about outer)

Jacherr commented 1 month ago

Can probably be added with not too much hassle, cc @y21 It's possible we can give tags free-rein over request headers altogether but with a few default ones like you suggested,