cesanta / docker_auth

Authentication server for Docker Registry 2
Apache License 2.0
1.28k stars 305 forks source link

How to write a new auth backend? #337

Open zfLQ2qx2 opened 2 years ago

zfLQ2qx2 commented 2 years ago

I'm currently using an external program for validation and have found the server gets fork bombed when many clients try to authenticate at once. My authentication isn't very sophisticated, the login password is a github personal access token, I call a Github API to see what orgs it belongs to, and if someone in my organization they are authorized. To remedy the fork bomb issue I'd like to just patch in a local auth method at compile time to make the HTTP request. Could someone walk me through what would be required to implement this? I've looked at the other authn modules and its not really clear how they get called, it looks like there is more involved then just dropping in a .go file in that directory.

zfLQ2qx2 commented 2 years ago

@techknowlogick Can you help me out?