Comments (6)
Probably OK as long as you can guarantee it won't break with more realistic implementations.
Also it's potentially losing the detailed information in the error as to why the key was invalid if done via New() .
from trillian.
I don't think it will break realistic implementations.
I expect that key material should be available on server start and errors should be caught fairly early. Also, if we need to distinguish between multiple error cases in New
we can define specific errors.
from trillian.
Not sure. Constructors really shouldn't be doing significant work (like reading files) and having constructors that can fail is usually an anti-pattern.
What might work is separating out all the code that decodes keys and having the PEM key manager constructor just take the keys. I don't know if this is better without trying it.
from trillian.
from trillian.
FYI, the one example of a constructor in Effective Go is one that can fail:
https://golang.org/doc/effective_go.html#composite_literals
The pattern of "constructors shouldn't be doing significant work" is mostly for languages like C++, where they can get invoked implicitly, but just about nothing is implicit in Go, so no problem, significant work and failure are totally fine, especially if it can reduce the state space of the returned object!
from trillian.
I sometimes think Go was designed purely to contradict every other existing language.
from trillian.
Related Issues (20)
- KeepAlive in etcd client cannot ensure the permanent validity of lease
- Brainstorming: Verkle Tree support in Trillian (constant-sized proofs) HOT 1
- Would there be any interest in more k8s "native" tooling for integration testing? HOT 6
- Unable to create a tree in Trillian log mysql database HOT 4
- Bazel not building
- MySQL: World-writable config warning during startup
- Trillian log server and signer config file does not allow comments HOT 1
- Tag a new release with transparency-dev/merkle extracted HOT 4
- Drop dependency from certificate-transparency-go HOT 1
- Scripts and documentation still refer to pre-Go-module practices HOT 1
- Build and use image for ./examples/deployment/kubernetes/createtree HOT 1
- defense against split view attacks HOT 3
- Cleanup: remove `tree_ids_with_no_ephemeral_nodes` flag after it is the default behavior
- Bump golangci-lint and remove //nolint comments in experimental/batchmap/cmd/verify/verify.go
- Are these the correct 'release' containers for log_[signer,server]? HOT 5
- Cockroach tests are pinned to historic version HOT 4
- TX rollback error: sql: transaction has already been committed or rolled back HOT 2
- Document SCTs and the tradeoffs involved in using them
- FR: Ability to configure tree hashing algorithm, along with SHA3 support HOT 6
- Alternative construction to merkle trees
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 trillian.