Comments (6)
But otherwise yes, I guess, the "safest" route would be to force people to define a location.
I think this is the route I'm going to go. Since this is a breaking API change, I'll release it as v2 and immediately deprecate the v1 branch.
from certainty.
from certainty.
If I run mkdir /tmp/certainty
then execute this script...
<?php
use ParagonIE\Certainty\RemoteFetch;
require 'vendor/autoload.php';
$fetcher = new RemoteFetch(
'/tmp/certainty'
);
var_dump($fetcher->getLatestBundle());
This is the expected output:
object(ParagonIE\Certainty\Bundle)#33 (5) {
["chronicleHash":protected]=>
string(44) "Jmto9HgxYETn-1JA6YVjDEs7OyjY_bffb2kfy-AGM2E="
["customValidator":protected]=>
object(ParagonIE\Certainty\Validator)#21 (0) {
}
["filePath":protected]=>
string(36) "/tmp/certainty/cacert-2018-03-07.pem"
["sha256sum":protected]=>
string(64) "79ea479e9f329de7075c40154c591b51eb056d458bc4dff76d9a4b9c6c4f6d0b"
["signature":protected]=>
string(128) "06dc96f0bc32ee82eb7611ac7fe0bfa646fd4139a65fe7999a404377e4b4a3272f74c509c1cbb1a6f509c8c7d438e79e95982b1f992c7fc6071d99e6f103680c"
}
from certainty.
Yeah, I spotted that in the docs when I flicked through them yesterday, but didn't have a chance to test. Sounds like that will work for me.
But in terms of OOBE ("out of the box experience") surely not breaking composer
updates in the default config would be a "Good Thing"(TM) ?
If we're going strictly "by the book", then composer
also seems to define the vendor directory as
the conventional location for all third-party code in a project
I'm not sure whether dynamically pulling certs into vendor would be pushing that definition a little bit far ?
from certainty.
What options remain available? /tmp
is a soft target for local users to tamper with data (race conditions, ahoy!).
I suppose we could make this argument not optional and throw an Error if the directory specified does not exist.
from certainty.
I only thought of /tmp
because of the nature of the data (public certs, not sensitive, you can validate the integrity probably using mechanisms you already have coded as part of certainty
? )
But otherwise yes, I guess, the "safest" route would be to force people to define a location.
Or otherwise maybe do something with the Package Events features of composer (https://getcomposer.org/doc/articles/scripts.md) ? (Just guessing here, I'm no composer
guru, but was just flicking through the docs for possible ideas).
from certainty.
Related Issues (20)
- Create CLI Tool for Composer Post-Update Script HOT 2
- Permission denied for folder HOT 2
- Check CA-Cert bundle metadata into a public Chronicle
- Docs do not mention Windows support (or lack) HOT 4
- No valid bundles were found in the data directory. HOT 31
- Use of undefined constant CURL_SSLVERSION_TLSv1_2 HOT 4
- ca-certs.json not found in data directory HOT 7
- Support for custom CAs? HOT 5
- SSL certificate problem: unable to get local issuer certificate HOT 3
- What if GitHub is down? HOT 2
- Cannot connect to https://php-chronicle.pie-hosted.com/chronicle HOT 8
- ca-certs.json not found in data directory HOT 1
- Chronicle is offline HOT 1
- Default RemoteFetch constructor always throws exception HOT 1
- What to do with cacert-2022-03-29.pem? HOT 2
- cacert-2022-07-19.pem is marked bad by certainty but not updated HOT 4
- Test Generated File Persists After Testing HOT 1
- Compare with composer's library HOT 1
- Avoid recommending dev-master HOT 4
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 certainty.