Devii Documentation
website·Indexed 32 days ago
https://docs.devii.ioDevii provides a security engine for access control and rights management over SQL-based external database connections. It features a Policy-Based Access Control (PBAC) system, OIDC authentication support, GraphQL integration, and a built-in blob storage system for file handling. The platform includes a Devii Portal for tenancy and role management, as well as NLAPI for natural language interaction with relational databases.
What's inside Devii
- Devii uses a 'default deny' security model where access is only granted if a matching policy rule exists. Rules cannot be used to explicitly deny access; instead, the absence of a granting rule results in denial. A rule consists of a scope (who and what), a set of capabilities (what operations), and an optional filter expression that modifies the data returned or acted upon.
Overview of Devii API Engine
Devii is an instant API engine designed to reduce the time and cost of building and maintaining GraphQL APIs. It provides built-in policy-based security for scalability and offers instant API access and cloud hosting for popular databases, including MySQL, Oracle, and PostgreSQL.Overview of Devii Webhook Rules
Webhook rules allow you to automatically send HTTP requests to external services when data in your database tables is inserted, updated, or deleted. This enables real-time integration without polling. Each rule is defined by target tables, triggering operations (insert, update, delete, upload), and parameters for the request (URL, method, headers, and payload).Overview of OIDC Authentication in Devii
Devii supports authentication via OpenID Connect (OIDC) providers (e.g., Google, AWS, Microsoft Entra ID). Instead of storing credentials locally, Devii verifies identity tokens from an external provider and maps the user to a Devii role using a configured comparison field.
Role-based Access for OIDC Configuration:
pxadmin(installation root): Can create OIDC providers.- Tenant root roles: Can create OIDC configurations.
- Users with role creation privileges: Can create
role_oidcmappings for others. - All users: Can create/update their own mappings.
Overview of Devii Filter Expression Language
Devii uses a custom domain-specific language (DSL) for filtering data on its GraphQLqueryandAggregatesendpoints. This language is similar to a SQLWHEREclause but is not standard SQL or JSON/GraphQL filter syntax. It is passed as a string argument to thefilterfield of a GraphQL query. Note that mutations do not support filter arguments; use theidfield for targeted updates or deletes.# Example Query { people(filter: "name='Boba Fett'") { name birthYear } } # Example Aggregate { Aggregates { avg(subquery: "query{films{budget}}") } }Understand Devii Role and Capability fundamentals
In Devii, Roles are used to represent both individual users and groups. Every user accessing a tenant schema must do so through a role. Roles determine both the operational 'powers' (capabilities) a user has and their access to specific data objects via ACLs. A role with no capabilities is considered 'read-only', meaning it can only access data objects it has ACLs for, and those permissions are treated as read-only regardless of the ACL settings.Generate GraphQL APIs from SQL databases with Devii Server
Devii Server provides automatic GraphQL schema generation for popular SQL databases. Key capabilities include:
- Automatic generation of resolvers for queries and mutations.
- A filter expression language for queries.
- Support for result ordering, Limit, and Offset.
- Support for aggregate queries.
Understand the Devii file upload and validation lifecycle
Devii uses a multi-step process to handle file uploads and validation:
- Initiation: The client creates a record using the
FileUploadGraphQL type to receive an upload URL and headers. - Upload: The client uploads the file to the provided remote storage (e.g., Google Storage).
- Server-Side Validation: A background process monitors records with a
pendingstatus. It validates the file blob's existence, MIME type, and size.- OK: If MIME type and size match the record, status becomes
ok. Devii then provides download URLs via thethefilesattribute. - Invalid: If there is a MIME type discrepancy or the size exceeds the recorded value, status becomes
invalid. - Pending: If the blob is missing or the size is smaller than expected, it remains
pending. Only upload URLs are provided in this state.
- OK: If MIME type and size match the record, status becomes
- Client Verification: The client typically triggers a fetch on the model after upload to verify the status has transitioned from
pendingtook.
- Initiation: The client creates a record using the
Understand Devii billing and payment security
Devii does not store credit card information on its own servers. All payments are processed via BNG Payments using PCI-compliant systems.Perform data aggregation using Aggregates
Devii provides an
Aggregatesobject to perform common mathematical operations on a subquery. The available aggregate functions are:avg: Calculates the average of a field.count: Counts the number of objects.max: Finds the maximum value.min: Finds the minimum value.sum: Calculates the total sum of a field.
Devii Core and Package Functionality Overview
Devii is divided into a core engine and optional functional packages:
Devii Core Handles basic GraphQL schema generation, querying, mutations, tenant management, roles, role classes, policy rules, and the expression language parser/evaluator.
Available Packages
- Multimedia: Manages file associations with records using signed URLs for upload/download via Cloudstorage (Azure Blob, GCS, S3, or on-premises).
- Geospatial: Adds geometry/geography types and geospatial functions to query filters. Uses OGC Well-Known Text format.
- Geoimaging: Renders geospatial rasters and performs image processing via process rules.
- Alerts: Sends email/SMS notifications on table changes via process rules.
- Reporting: Generates HTML/PDF reports using JavaScript templates via process rules.
- Financials: Integrates payment gateways (e.g., BNG Holdings NMI-compatible API) for content purchase and subscriptions via process rules.
- Aggregate Queries: Provides server-side aggregates (
avg,count,max,min,sum) with grouping and expression-based filtering. - Function and Procedure Calls: Exports database functions and stored procedures through the GraphQL API, controlled by the policy rule engine.
Understand the relationship between Website Terms and SaaS Terms
The Website Terms of Service govern the use of the Devii website (the Site). However, if you use a Devii software-as-a-service (SaaS) offering, such as the Devii Standard Offering ('Standard Plan'), your use is governed by the applicable service-specific terms (e.g., Devii Standard Offering Terms of Service, Commercial, or Enterprise contracts). In the event of a conflict, the service-specific terms take precedence over the Website Terms.