Comments (2)
from guardian.
This is the latest test that I have been building out see (https://github.com/dovuofficial/guardian-php-sdk/tree/research/guardian-client):
it('A dry-run policy can create user, with a role, and submit project data -- read data from filter + ensure status', function ($project) {
/**
* 1. Authenticate as registry
*/
$this->helper->authenticateAsRegistry();
/**
* 2. Ensure dry run and (possible) restart state
*/
// $this->policy_mode->dryRun();
// $this->dry_run_scenario->restart();
/**
* 3. Creating a new user in dry run state where a role is assigned.
*/
$users = $this->dry_run_scenario->createUser(); // Returns a list of all users
$user = (object) end($users);
$this->dry_run_scenario->login($user->did);
$this->policy_workflow->assignRole(GuardianRole::SUPPLIER);
/**
* 4. Prepare document
*/
$document = json_decode($project, true);
$uuid = $document['uuid'];
/**
* 5. Send document to the correct tag
*/
$tag = "create_ecological_project";
$this->policy_workflow->sendDocumentToTag($tag, $document);
// TODO: Use the listener logic (This will increase based off of the current resource load on API)
sleep(2);
/**
* 6. As the "Administrator" filter and fetch the valid block
*/
// As standard authority (first in the list of dry run users)
$this->dry_run_scenario->login($users[0]['did']);
// This is stateful in API.
$this->policy_workflow->filterByTag("supplier_grid_filter", $uuid);
$supplier = $this->policy_workflow->dataByTagToBlock("supplier_grid");
/**
* Ensure that the expected uuid matches the filter
*/
expect($supplier->uuid)->toBe($uuid);
/**
* Ensure that the expected status matches state
*/
expect($supplier->getStatus())->toBe("Waiting for approval");
/**
* Later: Reset policy state
*/
// $this->dry_run_scenario->restart();
// $this->policy_mode->draft();
});
from guardian.
Related Issues (20)
- Errors 500 - Impossible to log into MGS (testnet) HOT 1
- Incorrect process for user creation in some cases
- Improve security of hashed passwords HOT 1
- Duplicated properties in schema field
- In-policy roles & rules supporting complex use-cases HOT 1
- Incorrect and/or missing token information in Guardian
- Linking VCs via API does not work HOT 2
- Change the default port for Indexer
- Granular global search/diff matching arbitrary policy block subtrees
- Optimise and Eliminate Redundant Connections to MongoDB
- Migrate Logging from Winston to Pino
- Express to Fastify Migration
- A method of complete data loss for any user, like a registry. HOT 3
- `INITIALIZATION_TOPIC_ID` web documentation HOT 1
- Manage Policies: Combine Import and Add new policy into single dialog
- Update fonts in styles
- Profile: Add backgroud card to align with other pages
- Not all modules are displayed on the /modules page
- Update toasts design
- App Branding: Update image placeholder
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 guardian.