Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.2.0. #458

Merged
merged 29 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
405a753
Make datetime bucket seeding independent of `SET TIMEZONE =`
pdobacz Sep 1, 2022
677e636
Merge pull request #444 from diffix/piotr/fix-tz-seeding
pdobacz Sep 1, 2022
a2b487c
Merge pull request #446 from diffix/release/fir
cristianberneanu Sep 2, 2022
873845c
Support date_trunc
pdobacz Aug 31, 2022
83e01e6
Merge remote-tracking branch 'origin/master' into piotr/date_trunc
pdobacz Sep 6, 2022
c5c39ef
Add empty line in allowed_objects.c
pdobacz Sep 6, 2022
1cab5d3
Merge pull request #447 from diffix/piotr/date_trunc
pdobacz Sep 6, 2022
7a0d167
Missed spot where primary_arg is nonzero
pdobacz Sep 8, 2022
81c2461
Merge pull request #449 from diffix/piotr/fix-where-datetime-validation
pdobacz Sep 12, 2022
3295f94
Disallow sum_noise(datetime) instead of crashing
pdobacz Sep 12, 2022
8e82bad
Support `extract(... from ...)`
pdobacz Sep 12, 2022
6711291
Merge pull request #450 from diffix/piotr/extract-datetime
pdobacz Sep 13, 2022
f41c108
Add support for joining tables in anonymizing queries.
cristianberneanu Sep 20, 2022
5c1d87b
Add test for AID collection when joining tables.
cristianberneanu Sep 20, 2022
c499b6f
Fix explain table JOIN test.
cristianberneanu Sep 20, 2022
caa0612
Allow `cast(extract ...) as integer`
pdobacz Sep 15, 2022
a229059
Merge pull request #451 from diffix/cristian/feature/query
cristianberneanu Sep 21, 2022
829bc40
Drop restrictions on extract field + more consistency in numeric casts
pdobacz Sep 21, 2022
6d51ee2
Merge pull request #452 from diffix/piotr/normalize-for-metabase-date…
pdobacz Sep 21, 2022
5c83e40
Add support for building on Windows.
cristianberneanu Sep 26, 2022
4755bd9
Source-code compatibility fixes for compiling on Windows.
cristianberneanu Sep 26, 2022
817218d
Add Windows build instructions to Readme.
cristianberneanu Sep 26, 2022
07ce148
Merge pull request #453 from diffix/cristian/misc
cristianberneanu Sep 26, 2022
9a90794
Add resource files to solution.
cristianberneanu Sep 27, 2022
a8a0380
Merge pull request #454 from diffix/cristian/misc
cristianberneanu Sep 27, 2022
9bbe7ab
Require VS 2019 (or greater) for building on Windows.
cristianberneanu Oct 18, 2022
3fe5a8b
Merge pull request #456 from diffix/cristian/misc
cristianberneanu Oct 18, 2022
e9e4636
Release 1.2.0.
cristianberneanu Sep 26, 2023
58c833a
Fix release build error caused by git ownership check.
cristianberneanu Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

jobs:
publish:
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
container:
image: pgxn/pgxn-tools
steps:
- name: Install deps
run: |
sudo apt update
apt-get install -y jq
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Silence git error about dubious ownership
run: git config --global --add safe.directory /__w/pg_diffix/pg_diffix
- name: Package release
run: make package
- name: Make release draft
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.vscode/*
!.vscode/cpp.code-snippets
.vs/
x64/
*.vcxproj.user

*.o
*.so
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Version 1.2.0
- Added support for joining tables in anonymizing queries.
- Added support for Windows.
- Added support for `date_trunc` and `extract(... from ...)`.

## Version 1.1.0
- Added support for simple pre-anonymization `WHERE` clauses.
- Added `sum` and `avg` aggregrators.
Expand Down
6 changes: 3 additions & 3 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pg_diffix",
"abstract": "A PostgreSQL extension for strong dynamic anonymization.",
"description": "Diffix is a bundled set of mechanisms for anonymizing structured data. Open Diffix is a project to make Diffix anonymization free and open. More details at open-diffix.org.",
"version": "1.1.0",
"version": "1.2.0",
"maintainer": "Open Diffix <hello@open-diffix.org>",
"license": {
"restricted": "https://github.com/diffix/pg_diffix/blob/master/LICENSE.md"
Expand All @@ -13,7 +13,7 @@
"abstract": "A PostgreSQL extension for strong dynamic anonymization.",
"file": "src/pg_diffix.c",
"docfile": "docs/user_guide.md",
"version": "1.1.0"
"version": "1.2.0"
}
},
"prereqs": {
Expand Down Expand Up @@ -48,4 +48,4 @@
"version": "1.0.0",
"url": "https://pgxn.org/meta/spec.txt"
}
}
}
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ The [analyst guide](docs/analyst_guide.md) describes the SQL features and limita

## Installation

PostgreSQL version 13 or higher is required. You also need `make`, `jq`, and a recent C compiler.
PostgreSQL version 13 or higher is required.

### Linux

You need `make`, `jq`, and a recent C compiler.
You should already have the `postgresql-server-dev-x` package installed if you have PostgreSQL version `x`.
If not, you must install it in order to compile the source.

Expand All @@ -21,6 +25,17 @@ The compiled extension is installed with: `make install` (which requires superus
The extension is also available on [PGXN](https://pgxn.org/dist/pg_diffix/), and can be installed using
[PGXN Client](https://pgxn.github.io/pgxnclient/).

### Windows

You need Visual Studio 2019 (or greater) installed with the "Desktop development with C++" option selected.
You also need to set the environment variable `PGROOT` to point to the location of the PostgreSQL installation.

You can compile the source from inside VS, by opening the provided solution file, or from the command line,
by opening a "Developer Command Prompt for VS 20XX" terminal in the project's folder and executing `msbuild` (to do a
release build, execute `msbuild -p:Configuration=Release`, to clean the build files, run `msbuild -t:Clean`).

The compiled extension is installed by running `install` (for debug version) or `install Release` (for release version).

## Activating the extension

You can set up the extension for the current database by using the command `CREATE EXTENSION pg_diffix;`.
Expand Down Expand Up @@ -111,9 +126,10 @@ The demo image extends the base image with a sample dataset and a user for each

Once started, the container creates and populates the `banking` database.
Three users are created, all of them with password `demo`:
- `trusted_user` with anonymized access to `banking` in trusted mode
- `untrusted_user` with anonymized access to `banking` in untrusted mode
- `direct_user` with direct (non-anonymized) access to `banking`

- `trusted_user` with anonymized access to `banking` in trusted mode
- `untrusted_user` with anonymized access to `banking` in untrusted mode
- `direct_user` with direct (non-anonymized) access to `banking`

**NOTE** The required file `docker/demo/01-banking-data.sql` is managed by [Git LFS](https://git-lfs.github.com).

Expand Down
13 changes: 13 additions & 0 deletions install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@ECHO OFF

SET configuration=%1
IF "%configuration%"=="" SET configuration=Debug

copy .\x64\%configuration%\pg_diffix.dll %PGROOT%\lib\
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%

copy .\*.sql %PGROOT%\share\extension\
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%

copy .\pg_diffix.control %PGROOT%\share\extension\
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%
25 changes: 25 additions & 0 deletions pg_diffix.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32901.215
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pg_diffix", "pg_diffix.vcxproj", "{38363B61-2A14-4350-8136-168F8FC02737}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{38363B61-2A14-4350-8136-168F8FC02737}.Debug|x64.ActiveCfg = Debug|x64
{38363B61-2A14-4350-8136-168F8FC02737}.Debug|x64.Build.0 = Debug|x64
{38363B61-2A14-4350-8136-168F8FC02737}.Release|x64.ActiveCfg = Release|x64
{38363B61-2A14-4350-8136-168F8FC02737}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6C82DEF7-361D-41EF-AB43-6AABA3D85D9C}
EndGlobalSection
EndGlobal
152 changes: 152 additions & 0 deletions pg_diffix.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pg_diffix\aggregation\aid.h" />
<ClInclude Include="pg_diffix\aggregation\aid_tracker.h" />
<ClInclude Include="pg_diffix\aggregation\bucket_scan.h" />
<ClInclude Include="pg_diffix\aggregation\common.h" />
<ClInclude Include="pg_diffix\aggregation\contribution_tracker.h" />
<ClInclude Include="pg_diffix\aggregation\count.h" />
<ClInclude Include="pg_diffix\aggregation\led.h" />
<ClInclude Include="pg_diffix\aggregation\noise.h" />
<ClInclude Include="pg_diffix\aggregation\star_bucket.h" />
<ClInclude Include="pg_diffix\aggregation\summable.h" />
<ClInclude Include="pg_diffix\auth.h" />
<ClInclude Include="pg_diffix\config.h" />
<ClInclude Include="pg_diffix\hooks.h" />
<ClInclude Include="pg_diffix\node_funcs.h" />
<ClInclude Include="pg_diffix\oid_cache.h" />
<ClInclude Include="pg_diffix\query\allowed_objects.h" />
<ClInclude Include="pg_diffix\query\anonymization.h" />
<ClInclude Include="pg_diffix\query\relation.h" />
<ClInclude Include="pg_diffix\query\validation.h" />
<ClInclude Include="pg_diffix\utils.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\aggregation\aid.c" />
<ClCompile Include="src\aggregation\aid_tracker.c" />
<ClCompile Include="src\aggregation\bucket_scan.c" />
<ClCompile Include="src\aggregation\common.c" />
<ClCompile Include="src\aggregation\contribution_tracker.c" />
<ClCompile Include="src\aggregation\count.c" />
<ClCompile Include="src\aggregation\count_distinct.c" />
<ClCompile Include="src\aggregation\count_histogram.c" />
<ClCompile Include="src\aggregation\led.c" />
<ClCompile Include="src\aggregation\low_count.c" />
<ClCompile Include="src\aggregation\noise.c" />
<ClCompile Include="src\aggregation\star_bucket.c" />
<ClCompile Include="src\aggregation\sum.c" />
<ClCompile Include="src\aggregation\summable.c" />
<ClCompile Include="src\auth.c" />
<ClCompile Include="src\config.c" />
<ClCompile Include="src\hooks.c" />
<ClCompile Include="src\node_funcs.c" />
<ClCompile Include="src\oid_cache.c" />
<ClCompile Include="src\pg_diffix.c" />
<ClCompile Include="src\query\allowed_objects.c" />
<ClCompile Include="src\query\anonymization.c" />
<ClCompile Include="src\query\relation.c" />
<ClCompile Include="src\query\validation.c" />
<ClCompile Include="src\utils.c" />
</ItemGroup>
<ItemGroup>
<None Include="analysis.sql" />
<None Include="CHANGELOG.md" />
<None Include="LICENSE.md" />
<None Include="pg_diffix--fir.sql" />
<None Include="pg_diffix.control" />
<None Include="README.md" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{38363b61-2a14-4350-8136-168f8fc02737}</ProjectGuid>
<RootNamespace>pgdiffix</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir);$(PGROOT)\include\server\port\win32_msvc;$(PGROOT)\include\server\port\win32;$(PGROOT)\include\server;$(PGROOT)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4244;4715</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(PGROOT)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>postgres.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir);$(PGROOT)\include\server\port\win32_msvc;$(PGROOT)\include\server\port\win32;$(PGROOT)\include\server;$(PGROOT)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4244;4715</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(PGROOT)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>postgres.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Loading
Loading