Giter Site home page Giter Site logo

Comments (6)

paragonie-scott avatar paragonie-scott commented on June 15, 2024 2

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.

paragonie-scott avatar paragonie-scott commented on June 15, 2024

https://github.com/paragonie/certainty/blob/master/docs/features/RemoteFetch.md#changing-the-path-or-url

from certainty.

paragonie-scott avatar paragonie-scott commented on June 15, 2024

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.

udf2457 avatar udf2457 commented on June 15, 2024

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.

paragonie-scott avatar paragonie-scott commented on June 15, 2024

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.

udf2457 avatar udf2457 commented on June 15, 2024

I only thought of /tmpbecause 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.