Skip to content

Commit cf6a0fa

Browse files
Merge from 'develop', Set version to 2.1.0-beta2
2 parents c313efa + f66ef02 commit cf6a0fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1349
-240
lines changed

.editorconfig

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# Entfernen Sie die folgende Zeile, wenn Sie EDITORCONFIG-Einstellungen von höheren Verzeichnissen vererben möchten.
2+
root = true
3+
4+
# C#-Dateien
5+
[*.cs]
6+
7+
#### Wichtige EditorConfig-Optionen ####
8+
9+
# Einzüge und Abstände
10+
indent_size = 4
11+
indent_style = space
12+
tab_width = 4
13+
14+
# Einstellungen für neue Zeilen
15+
end_of_line = crlf
16+
insert_final_newline = false
17+
18+
#### .NET-Codierungskonventionen ####
19+
20+
# Using-Direktiven organisieren
21+
dotnet_separate_import_directive_groups = false
22+
dotnet_sort_system_directives_first = false
23+
file_header_template = unset
24+
25+
# this.- und Me.-Einstellungen
26+
dotnet_style_qualification_for_event = false
27+
dotnet_style_qualification_for_field = false
28+
dotnet_style_qualification_for_method = false
29+
dotnet_style_qualification_for_property = false
30+
31+
# Einstellungen für Sprachschlüsselwörter und BCL-Typen
32+
dotnet_style_predefined_type_for_locals_parameters_members = true
33+
dotnet_style_predefined_type_for_member_access = true
34+
35+
# Einstellungen für Klammern
36+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
37+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
38+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
39+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
40+
41+
# Einstellungen für Modifizierer
42+
dotnet_style_require_accessibility_modifiers = for_non_interface_members
43+
44+
# Einstellungen für Ausdrucksebene
45+
dotnet_style_coalesce_expression = true
46+
dotnet_style_collection_initializer = true
47+
dotnet_style_explicit_tuple_names = true
48+
dotnet_style_namespace_match_folder = true
49+
dotnet_style_null_propagation = true
50+
dotnet_style_object_initializer = true
51+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
52+
dotnet_style_prefer_auto_properties = true
53+
dotnet_style_prefer_compound_assignment = true
54+
dotnet_style_prefer_conditional_expression_over_assignment = true
55+
dotnet_style_prefer_conditional_expression_over_return = true
56+
dotnet_style_prefer_inferred_anonymous_type_member_names = true
57+
dotnet_style_prefer_inferred_tuple_names = true
58+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
59+
dotnet_style_prefer_simplified_boolean_expressions = true
60+
dotnet_style_prefer_simplified_interpolation = true
61+
62+
# Einstellungen für Felder
63+
dotnet_style_readonly_field = true
64+
65+
# Einstellungen für Parameter
66+
dotnet_code_quality_unused_parameters = all
67+
68+
# Unterdrückungseinstellungen
69+
dotnet_remove_unnecessary_suppression_exclusions = none
70+
71+
# Einstellungen für neue Zeilen
72+
dotnet_style_allow_multiple_blank_lines_experimental = true
73+
dotnet_style_allow_statement_immediately_after_block_experimental = true
74+
75+
#### C#-Codierungskonventionen ####
76+
77+
# Var-Einstellungen
78+
csharp_style_var_elsewhere = false
79+
csharp_style_var_for_built_in_types = false
80+
csharp_style_var_when_type_is_apparent = false
81+
82+
# Ausdruckskörpermember
83+
csharp_style_expression_bodied_accessors = true
84+
csharp_style_expression_bodied_constructors = false
85+
csharp_style_expression_bodied_indexers = true
86+
csharp_style_expression_bodied_lambdas = true
87+
csharp_style_expression_bodied_local_functions = false
88+
csharp_style_expression_bodied_methods = false
89+
csharp_style_expression_bodied_operators = false
90+
csharp_style_expression_bodied_properties = true
91+
92+
# Einstellungen für den Musterabgleich
93+
csharp_style_pattern_matching_over_as_with_null_check = true
94+
csharp_style_pattern_matching_over_is_with_cast_check = true
95+
csharp_style_prefer_not_pattern = true
96+
csharp_style_prefer_pattern_matching = true
97+
csharp_style_prefer_switch_expression = true
98+
99+
# Einstellungen für NULL-Überprüfung
100+
csharp_style_conditional_delegate_call = true
101+
102+
# Einstellungen für Modifizierer
103+
csharp_prefer_static_local_function = true
104+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
105+
106+
# Einstellungen für Codeblöcke
107+
csharp_prefer_braces = true
108+
csharp_prefer_simple_using_statement = false
109+
110+
# Einstellungen für Ausdrucksebene
111+
csharp_prefer_simple_default_expression = true
112+
csharp_style_deconstructed_variable_declaration = true
113+
csharp_style_implicit_object_creation_when_type_is_apparent = true
114+
csharp_style_inlined_variable_declaration = true
115+
csharp_style_pattern_local_over_anonymous_function = true
116+
csharp_style_prefer_index_operator = false
117+
csharp_style_prefer_range_operator = true
118+
csharp_style_throw_expression = true
119+
csharp_style_unused_value_assignment_preference = discard_variable
120+
csharp_style_unused_value_expression_statement_preference = discard_variable
121+
122+
# Einstellungen für using-Anweisungen
123+
csharp_using_directive_placement = outside_namespace
124+
125+
# Einstellungen für neue Zeilen
126+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
127+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
128+
csharp_style_allow_embedded_statements_on_same_line_experimental = true
129+
130+
#### C#-Formatierungsregeln ####
131+
132+
# Einstellungen für neue Zeilen
133+
csharp_new_line_before_catch = false
134+
csharp_new_line_before_else = false
135+
csharp_new_line_before_finally = false
136+
csharp_new_line_before_members_in_anonymous_types = true
137+
csharp_new_line_before_members_in_object_initializers = true
138+
csharp_new_line_before_open_brace = none
139+
csharp_new_line_between_query_expression_clauses = true
140+
141+
# Einstellungen für Einrückung
142+
csharp_indent_block_contents = true
143+
csharp_indent_braces = false
144+
csharp_indent_case_contents = true
145+
csharp_indent_case_contents_when_block = true
146+
csharp_indent_labels = one_less_than_current
147+
csharp_indent_switch_labels = true
148+
149+
# Einstellungen für Abstände
150+
csharp_space_after_cast = false
151+
csharp_space_after_colon_in_inheritance_clause = true
152+
csharp_space_after_comma = true
153+
csharp_space_after_dot = false
154+
csharp_space_after_keywords_in_control_flow_statements = true
155+
csharp_space_after_semicolon_in_for_statement = true
156+
csharp_space_around_binary_operators = before_and_after
157+
csharp_space_around_declaration_statements = false
158+
csharp_space_before_colon_in_inheritance_clause = true
159+
csharp_space_before_comma = false
160+
csharp_space_before_dot = false
161+
csharp_space_before_open_square_brackets = false
162+
csharp_space_before_semicolon_in_for_statement = false
163+
csharp_space_between_empty_square_brackets = false
164+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
165+
csharp_space_between_method_call_name_and_opening_parenthesis = false
166+
csharp_space_between_method_call_parameter_list_parentheses = false
167+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
168+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
169+
csharp_space_between_method_declaration_parameter_list_parentheses = false
170+
csharp_space_between_parentheses = false
171+
csharp_space_between_square_brackets = false
172+
173+
# Umbrucheinstellungen
174+
csharp_preserve_single_line_blocks = true
175+
csharp_preserve_single_line_statements = true
176+
177+
#### Benennungsstile ####
178+
179+
# Benennungsregeln
180+
181+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
182+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
183+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
184+
185+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
186+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
187+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
188+
189+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
190+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
191+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
192+
193+
# Symbolspezifikationen
194+
195+
dotnet_naming_symbols.interface.applicable_kinds = interface
196+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
197+
dotnet_naming_symbols.interface.required_modifiers =
198+
199+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
200+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
201+
dotnet_naming_symbols.types.required_modifiers =
202+
203+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
204+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
205+
dotnet_naming_symbols.non_field_members.required_modifiers =
206+
207+
# Benennungsstile
208+
209+
dotnet_naming_style.pascal_case.required_prefix =
210+
dotnet_naming_style.pascal_case.required_suffix =
211+
dotnet_naming_style.pascal_case.word_separator =
212+
dotnet_naming_style.pascal_case.capitalization = pascal_case
213+
214+
dotnet_naming_style.begins_with_i.required_prefix = I
215+
dotnet_naming_style.begins_with_i.required_suffix =
216+
dotnet_naming_style.begins_with_i.word_separator =
217+
dotnet_naming_style.begins_with_i.capitalization = pascal_case

DracoonSdk/DracoonSdk.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<Reference Include="BouncyCastle.Crypto, Version=1.8.6.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
4242
<HintPath>..\packages\BouncyCastle.1.8.6.1\lib\BouncyCastle.Crypto.dll</HintPath>
4343
</Reference>
44-
<Reference Include="Dracoon.Crypto.Sdk, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
45-
<HintPath>..\packages\Dracoon.Crypto.Sdk.2.0.0\lib\net452\Dracoon.Crypto.Sdk.dll</HintPath>
44+
<Reference Include="Dracoon.Crypto.Sdk, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
45+
<HintPath>..\packages\Dracoon.Crypto.Sdk.2.1.0\lib\net452\Dracoon.Crypto.Sdk.dll</HintPath>
4646
</Reference>
4747
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4848
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
@@ -80,10 +80,12 @@
8080
<Compile Include="SdkInternal\ApiModel\Settings\ApiAlgorithm.cs" />
8181
<Compile Include="SdkInternal\ApiModel\Settings\ApiAlgorithms.cs" />
8282
<Compile Include="SdkInternal\ApiModel\Settings\ApiCharacterRules.cs" />
83+
<Compile Include="SdkInternal\ApiModel\Settings\ApiClassificationPolicies.cs" />
8384
<Compile Include="SdkInternal\ApiModel\Settings\ApiDefaultsSettings.cs" />
8485
<Compile Include="SdkInternal\ApiModel\Settings\ApiEncryptionPasswordSettings.cs" />
8586
<Compile Include="SdkInternal\ApiModel\Settings\ApiInfrastructureSettings.cs" />
8687
<Compile Include="SdkInternal\ApiModel\Settings\ApiPasswordSettings.cs" />
88+
<Compile Include="SdkInternal\ApiModel\Settings\ApiShareClassificationPolicy.cs" />
8789
<Compile Include="SdkInternal\ApiModel\Settings\ApiSharePasswordSettings.cs" />
8890
<Compile Include="SdkInternal\ApiModel\Shares\ApiDownloadShare.cs" />
8991
<Compile Include="SdkInternal\ApiModel\Shares\ApiDownloadShareList.cs" />
@@ -198,6 +200,7 @@
198200
<Compile Include="SdkPublic\Model\AlgorithmState.cs" />
199201
<Compile Include="SdkPublic\Model\AvatarInfo.cs" />
200202
<Compile Include="SdkPublic\Model\Classification.cs" />
203+
<Compile Include="SdkPublic\Model\ClassificationPolicies.cs" />
201204
<Compile Include="SdkPublic\Model\CustomerAccount.cs" />
202205
<Compile Include="SdkPublic\Model\FileKeyAlgorithmData.cs" />
203206
<Compile Include="SdkPublic\Model\PasswordCharacterPolicies.cs" />
@@ -220,6 +223,7 @@
220223
<Compile Include="SdkPublic\Model\ServerInfrastructureSettings.cs" />
221224
<Compile Include="SdkPublic\Model\Attribute.cs" />
222225
<Compile Include="SdkPublic\Model\AttributeList.cs" />
226+
<Compile Include="SdkPublic\Model\ShareClassificationPolicy.cs" />
223227
<Compile Include="SdkPublic\Model\UserAuthData.cs" />
224228
<Compile Include="SdkPublic\Model\UserAuthMethod.cs" />
225229
<Compile Include="SdkPublic\Model\UserKeyPairAlgorithmData.cs" />

DracoonSdk/DracoonSdk.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<copyright>Copyright ©2018 DRACOON GmbH</copyright>
1515
<tags>DRACOON rest api sdk</tags>
1616
<dependencies>
17-
<dependency id="Dracoon.Crypto.Sdk" version="2.0.0"/>
17+
<dependency id="Dracoon.Crypto.Sdk" version="2.1.0"/>
1818
<dependency id="Newtonsoft.Json" version="12.0.3"/>
1919
<dependency id="RestSharp" version="106.11.5"/>
2020
</dependencies>

DracoonSdk/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
3333
// indem Sie "*" wie unten gezeigt eingeben:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.0.0.0")]
36-
[assembly: AssemblyFileVersion("2.0.0.0")]
37-
[assembly: AssemblyInformationalVersion("2.1.0-beta1")]
35+
[assembly: AssemblyVersion("2.1.0.0")]
36+
[assembly: AssemblyFileVersion("2.1.0.0")]
37+
[assembly: AssemblyInformationalVersion("2.1.0-beta2")]
3838
[assembly: InternalsVisibleTo("Dracoon.Sdk.Test")]
3939
[assembly: InternalsVisibleTo(assemblyName: "Dracoon.Sdk.UnitTest")]

DracoonSdk/SdkInternal/ApiConfig.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
using System.Text;
33

44
namespace Dracoon.Sdk.SdkInternal {
5-
internal class ApiConfig {
5+
internal static class ApiConfig {
66
internal const string MinimumApiVersion = "4.23.0";
77
internal const string ApiPrefix = "api/v4";
88
internal const string AuthorizationHeader = "Authorization";
9-
// mediaserver/image/{mediaToken}/{width}x{height}
9+
// token template: mediaserver/image/{mediaToken}/{width}x{height}
1010
internal const string MediaTokenTemplate = "mediaserver/image/{0}/{1}x{2}";
1111

1212

@@ -182,12 +182,14 @@ internal class ApiConfig {
182182
internal const string ApiGetDefaultsConfig = ApiPrefix + "/config/info/defaults";
183183
internal const string ApiGetPasswordPolicies = ApiPrefix + "/config/info/policies/passwords";
184184
internal const string ApiGetAlgorithms = ApiPrefix + "/config/info/policies/algorithms";
185+
internal const string ApiGetClassificationPolicies = ApiPrefix + "/config/info/policies/classifications";
185186

186187
#endregion
187188

188189
#region Minimum version requirements
189190

190191
internal const string ApiGetAlgorithmsMinimumVersion = "4.24.0";
192+
internal const string ApiGetClassificationPoliciesMinimumVersion = "4.30.0";
191193

192194
#endregion
193195

@@ -218,11 +220,13 @@ internal class ApiConfig {
218220
#endregion
219221

220222
internal static Uri BuildApiUrl(Uri baseUrl, params string[] pathSegments) {
221-
UriBuilder uriBuilder = new UriBuilder(baseUrl);
223+
StringBuilder sb = new StringBuilder();
222224
for (int i = 0; i < pathSegments.Length; i++) {
223-
uriBuilder.Path += i != 0 ? "/" + pathSegments[i] : pathSegments[i];
225+
sb.Append(i != 0 ? "/" + pathSegments[i] : pathSegments[i]);
224226
}
225227

228+
UriBuilder uriBuilder = new UriBuilder(baseUrl);
229+
uriBuilder.Path = sb.ToString();
226230
return uriBuilder.Uri;
227231
}
228232
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Dracoon.Sdk.SdkInternal.ApiModel {
4+
internal class ApiClassificationPolicies {
5+
[JsonProperty("shareClassificationPolicies", NullValueHandling = NullValueHandling.Ignore)]
6+
public ApiShareClassificationPolicy SharePolicy { get; set; }
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Dracoon.Sdk.SdkInternal.ApiModel {
4+
internal class ApiShareClassificationPolicy {
5+
[JsonProperty("classificationRequiresSharePassword", NullValueHandling = NullValueHandling.Ignore)]
6+
public int PasswordRequirementMinimumClassification { get; set; }
7+
}
8+
}

DracoonSdk/SdkInternal/DracoonAccountImpl.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ public AvatarInfo UpdateAvatar(Image newAvatar) {
256256

257257
#region Build multipart
258258

259-
ImageCodecInfo info = ImageCodecInfo.GetImageDecoders().First(c => c.FormatID == newAvatar.RawFormat.Guid);
260-
261259
string formDataBoundary = "---------------------------" + Guid.NewGuid();
262260
byte[] packageHeader = ApiConfig.ENCODING.GetBytes(
263261
$"--{formDataBoundary}\r\nContent-Disposition: form-data; name=\"{"file"}\"; filename=\"{"avatarImage"}\"\r\n\r\n");

0 commit comments

Comments
 (0)