Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch config from GitHub repo #278

Open
tymik opened this issue Aug 18, 2023 · 5 comments
Open

Fetch config from GitHub repo #278

tymik opened this issue Aug 18, 2023 · 5 comments
Labels
enhancement New feature or request feature-request Feature Request good first issue Good for newcomers

Comments

@tymik
Copy link

tymik commented Aug 18, 2023

I have used AWS Extend Switch Roles in past with an internal tool that was built to sync the config from the GitHub repository for easy team sharing and updating of the common config.
It was pretty useful when working with multiple accounts across the team.
The internal extension used GitHub API key and path to the config file in a repo to sync and it was doing the sync every 15 minutes or when forced.
The extension also used the chrome extension ID to sync with proper extension - I guess it was meant to work only with AWS Extend Switch Roles and I haven't tried it with this extension (I might test it in a couple of days).
Anyway, it would be really nice to see an embedded functionality like this here, making this extension even better and not needing some old internal extension that doesn't seem to be maintained for a very long time.

Of course, if that would be possible to achieve easily, support for other remote repos (GitLab, Bitbucket, AWS Code Commit, etc) would be even better, but I think that GitHub is a pretty good start.

@janstuemmel
Copy link
Owner

I already thought about this and even implemented some boilerplate (#254) due to #252.

I think it is a pretty neat idea to have a sidecar extension that pushes configuration into this extension while it seams a bit hacky at the same time. Please read the conversation in #252.

What i could imagine: This extension pulls configuration over a http endpoint. The user could define a curl request (or a simple form) with headers to retrieve the config by an intervall or a refresh button. I do not like the idea to implement authentication for github or something like this though.

@janstuemmel janstuemmel added enhancement New feature or request good first issue Good for newcomers feature-request Feature Request labels Aug 18, 2023
@tymik
Copy link
Author

tymik commented Aug 22, 2023

I'm not sure if it would need to be a sidecar extension though, I was rather thinking about an embedded part of configuration here.
You could provide the api url to github content, your api key and that would be all that's needed to work.

But as per #252 maybe it would make more sense to enable sidecars as then different extensions could be used without the need to embed additional functionality into this extension.

I do not like the idea to implement authentication for github or something like this though.

Why?
There's an API key in GitHub one can generate to use with the extension and there's no other way to get config fetched from private repos.

@janstuemmel
Copy link
Owner

I'm not sure if it would need to be a sidecar extension though, I was rather thinking about an embedded part of configuration here. You could provide the api url to github content, your api key and that would be all that's needed to work.

That would be simple http request, right?

But as per #252 maybe it would make more sense to enable sidecars as then different extensions could be used without the need to embed additional functionality into this extension.

Maybe yes, it will take a while tho. I do not want to rush this idea.

I do not like the idea to implement authentication for github or something like this though.

Why? There's an API key in GitHub one can generate to use with the extension and there's no other way to get config fetched from private repos.

Can you provide an example of how it could look like? I think i do not understand you correctly.

@tymik
Copy link
Author

tymik commented Aug 24, 2023

That would be simple http request, right?

I suppose yes

Maybe yes, it will take a while tho. I do not want to rush this idea.

Sure! I'd contribute if I could but my coding skills are too poor, I'd need support :(

Can you provide an example of how it could look like? I think i do not understand you correctly.

I suppose that get repository content method would need to be used.
Here's curl snippet:

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/OWNER/REPO/contents/PATH

token could be provided in settings to the plugin, together with the API URL to the file, and then there could be a button to trigger the request manually and some sort of cron (I don't know how automatic periodic actions are working in Chrome) to auto fetch the file.

@nickjmv
Copy link

nickjmv commented Nov 9, 2023

Is there any progress on this? I'm very interested in this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request Feature Request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants