jscarle / OnePassword.NET

A 1Password CLI Wrapper for .NET.
https://jscarle.github.io/OnePassword.NET/
MIT License
23 stars 8 forks source link

caching #47

Closed MannusEtten closed 11 months ago

MannusEtten commented 1 year ago

we got it working and integrating the package with the CLI-tooling. We do inject now the username/pwd for connectionstrings when we create a datacontext in .net core.

But the retrieval takes every time a couple of seconds.

So now our execution time is really slow but the password is not change in the meantime.

Is it an option to build in some caching mechanism? Where I can set the caching time to x minutes for example?

jscarle commented 1 year ago

Can you give me more details about your projet? .NET version? Type of project (ASP.NET, Web API, Blazor, Winforms)? How are you using 1Password .NET (in the constructor, in a method, using dependency injection)?

MannusEtten commented 1 year ago

Hi, I have build several webservices and a console app for my product where I use your work. Thanks for the good work by the way!

I do not use the dependency injector related stuff for your library. But I do have to request really often in the process some records from 1password. I see that every request takes relatively long.

So I have now an in-memory cache of those records from 1password to speed it up because especially in my webservices it takes too long otherwise.

jscarle commented 11 months ago

Thanks for the kind words!

I feel like implementing caching internally to this project would fall outside of its scope. Not to mention that it would add additional complexity and perhaps even some security issues, so both reasons, I believe your approach is probably what would work best considering your use case.

I'm glad that this project is useful for you. All the best.