Comments (7)
@hug-dev would this impact the SE driver in a major way?
from parsec-client-rust.
this could/should be changed so that most parameters are instead passed by reference.
what do you think would be the advantages of this? Do you have any examples in mind?
@hug-dev would this impact the SE driver in a major way?
I don't think so! It can adapt 😃
from parsec-client-rust.
what do you think would be the advantages of this? Do you have any examples in mind?
Yeah, the key name is a big example - we take it as an owned string everywhere... it would be much nicer and idiomatic for a user to just do &key_name
instead of key_name.clone()
every time. But pretty much all other attributes (e.g. AsymmetricEncryption
for sign and verify) do the same
from parsec-client-rust.
Yeah, the key name is a big example - we take it as an owned string everywhere... it would be much nicer and idiomatic for a user to just do &key_name instead of key_name.clone() every time.
Definitely agree for the name! For the other non-Copy type, I guess we will have to review them on a case-by-case basis. Basically it only depends if the client needs to re-use the values after calling the function.
from parsec-client-rust.
I guess the default should be to take references everywhere unless the types are Copy
.
For String
it should be &str
and for Vec<u8>
&[u8]
from parsec-client-rust.
I think we've debated this before - passing by reference ends up "hiding" the fact that you actually want an instance of that data and that you're going to clone it. I don't know if it's sensible to just assume that if a type implements Clone
we can treat a reference the same way as an owned instance.
from parsec-client-rust.
I think most BasicClient
methods take references to buffers now. The thing that would be nice is to use &str
instead of String
for keys as the latter implies making .clone
everywhere... Ideally the clone should be done at the end to hide the complexity before.
Renaming this issue to that. Actually closing and opening a new one.
from parsec-client-rust.
Related Issues (20)
- Add support for MAC operations
- Migrate away from using users crate
- Extract UnixSocket-specific functionality out of RequestHandler
- Rename methods to contain `psa_` prefix HOT 1
- Make the CoreClient really dumb HOT 16
- Expose the interface through the client, even for testing
- Resolve service endpoint from a URI environment variable HOT 3
- Implement new authenticator support HOT 2
- List existing tests
- Socket path security checks can fail when the client is in a container HOT 4
- Implement component bootstrapping HOT 6
- Add a JWT-SVID authentication data
- Un-versioned SPIFFE dependency prevents publishing crate at version 0.12.0 HOT 2
- Add support for ListClients and DeleteClient
- Investigate a SignClient for just-in-time key creation HOT 3
- Use &str for key names instead of String
- Manage data safely within the client HOT 4
- Complete the `BasicClient` examples HOT 1
- Add BasicClient::new_non_authenticated()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parsec-client-rust.