feat: Privacy policy (#1957)

* feat: command side privacy policy

* feat: add privacy policy to api

* feat: add privacy policy query side

* fix: add privacy policy to mgmt api

* fix: add privacy policy to auth and base data

* feat: use privacyPolicy in login gui

* feat: use privacyPolicy in login gui

* feat: test org fatures

* feat: typos

* feat: tos in register
This commit is contained in:
Fabi
2021-07-05 10:36:51 +02:00
committed by GitHub
parent 91f1c88d4e
commit beb1c1604a
75 changed files with 3171 additions and 34 deletions

View File

@@ -1450,6 +1450,65 @@ service AdminService {
};
}
//Returns the privacy policy defined by the administrators of ZITADEL
rpc GetPrivacyPolicy(GetPrivacyPolicyRequest) returns (GetPrivacyPolicyResponse) {
option (google.api.http) = {
get: "/policies/privacy";
};
option (zitadel.v1.auth_option) = {
permission: "iam.policy.read";
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "policy";
tags: "privacy policy";
tags: "privacy";
responses: {
key: "200";
value: {
description: "default privacy policy";
};
};
};
}
//Updates the default privacy policy of ZITADEL
// it impacts all organisations without a customised policy
rpc UpdatePrivacyPolicy(UpdatePrivacyPolicyRequest) returns (UpdatePrivacyPolicyResponse) {
option (google.api.http) = {
put: "/policies/privacy";
body: "*";
};
option (zitadel.v1.auth_option) = {
permission: "iam.policy.write";
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "policy";
tags: "privacy policy";
tags: "privacy";
responses: {
key: "200";
value: {
description: "default privacy policy updated";
};
};
responses: {
key: "400";
value: {
description: "invalid argument";
schema: {
json_schema: {
ref: "#/definitions/rpcStatus";
};
};
};
};
};
}
//Returns the custom text for initial message
rpc GetDefaultInitMessageText(GetDefaultInitMessageTextRequest) returns (GetDefaultInitMessageTextResponse) {
option (google.api.http) = {
@@ -2397,6 +2456,7 @@ message SetDefaultFeaturesRequest {
bool label_policy_private_label = 15;
bool label_policy_watermark = 16;
bool custom_text = 17;
bool privacy_policy = 18;
}
message SetDefaultFeaturesResponse {
@@ -2431,6 +2491,7 @@ message SetOrgFeaturesRequest {
bool label_policy_private_label = 16;
bool label_policy_watermark = 17;
bool custom_text = 18;
bool privacy_policy = 19;
}
message SetOrgFeaturesResponse {
@@ -2891,6 +2952,22 @@ message UpdatePasswordLockoutPolicyResponse {
zitadel.v1.ObjectDetails details = 1;
}
//This is an empty request
message GetPrivacyPolicyRequest {}
message GetPrivacyPolicyResponse {
zitadel.policy.v1.PrivacyPolicy policy = 1;
}
message UpdatePrivacyPolicyRequest {
string tos_link = 1;
string privacy_link = 2;
}
message UpdatePrivacyPolicyResponse {
zitadel.v1.ObjectDetails details = 1;
}
message GetDefaultInitMessageTextRequest {
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
}

View File

@@ -25,6 +25,7 @@ message Features {
bool label_policy_private_label = 14;
bool label_policy_watermark = 15;
bool custom_text = 16;
bool privacy_policy = 17;
}
message FeatureTier {

View File

@@ -1927,6 +1927,70 @@ service ManagementService {
};
}
// Returns the privacy policy of the organisation
// With this policy privacy relevant things can be configured (e.g. tos link)
rpc GetPrivacyPolicy(GetPrivacyPolicyRequest) returns (GetPrivacyPolicyResponse) {
option (google.api.http) = {
get: "/policies/privacy"
};
option (zitadel.v1.auth_option) = {
permission: "policy.read"
};
}
// Returns the default privacy policy of the IAM
// With this policy the privacy relevant things can be configured (e.g tos link)
rpc GetDefaultPrivacyPolicy(GetDefaultPrivacyPolicyRequest) returns (GetDefaultPrivacyPolicyResponse) {
option (google.api.http) = {
get: "/policies/default/privacy"
};
option (zitadel.v1.auth_option) = {
permission: "policy.read"
};
}
// Add a custom privacy policy for the organisation
// With this policy privacy relevant things can be configured (e.g. tos link)
rpc AddCustomPrivacyPolicy(AddCustomPrivacyPolicyRequest) returns (AddCustomPrivacyPolicyResponse) {
option (google.api.http) = {
post: "/policies/privacy"
body: "*"
};
option (zitadel.v1.auth_option) = {
permission: "policy.write"
feature: "privacy_policy"
};
}
// Update the privacy complexity policy for the organisation
// With this policy privacy relevant things can be configured (e.g. tos link)
rpc UpdateCustomPrivacyPolicy(UpdateCustomPrivacyPolicyRequest) returns (UpdateCustomPrivacyPolicyResponse) {
option (google.api.http) = {
put: "/policies/privacy"
body: "*"
};
option (zitadel.v1.auth_option) = {
permission: "policy.write"
feature: "privacy_policy"
};
}
// Removes the privacy policy of the organisation
// The default policy of the IAM will trigger after
rpc ResetPrivacyPolicyToDefault(ResetPrivacyPolicyToDefaultRequest) returns (ResetPrivacyPolicyToDefaultResponse) {
option (google.api.http) = {
delete: "/policies/privacy"
};
option (zitadel.v1.auth_option) = {
permission: "policy.delete"
};
}
// Returns the active label policy of the organisation
// With this policy the private labeling can be configured (colors, etc.)
rpc GetLabelPolicy(GetLabelPolicyRequest) returns (GetLabelPolicyResponse) {
@@ -3973,6 +4037,45 @@ message ResetPasswordLockoutPolicyToDefaultResponse {
zitadel.v1.ObjectDetails details = 1;
}
//This is an empty request
message GetPrivacyPolicyRequest {}
message GetPrivacyPolicyResponse {
zitadel.policy.v1.PrivacyPolicy policy = 1;
}
//This is an empty request
message GetDefaultPrivacyPolicyRequest {}
message GetDefaultPrivacyPolicyResponse {
zitadel.policy.v1.PrivacyPolicy policy = 1;
}
message AddCustomPrivacyPolicyRequest {
string tos_link = 1;
string privacy_link = 2;
}
message AddCustomPrivacyPolicyResponse {
zitadel.v1.ObjectDetails details = 1;
}
message UpdateCustomPrivacyPolicyRequest {
string tos_link = 1;
string privacy_link = 2;
}
message UpdateCustomPrivacyPolicyResponse {
zitadel.v1.ObjectDetails details = 1;
}
//This is an empty request
message ResetPrivacyPolicyToDefaultRequest {}
message ResetPrivacyPolicyToDefaultResponse {
zitadel.v1.ObjectDetails details = 1;
}
//This is an empty request
message GetLabelPolicyRequest {}

View File

@@ -220,4 +220,11 @@ message PasswordLockoutPolicy {
description: "defines if the organisation's admin changed the policy"
}
];
}
message PrivacyPolicy {
zitadel.v1.ObjectDetails details = 1;
string tos_link = 2;
string privacy_link = 3;
bool is_default = 4;
}