-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec712e6
commit f09f0bc
Showing
13 changed files
with
546 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 3.1.5 on 2021-01-30 15:24 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('desecapi', '0012_rrset_label_length'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='TLSIdentity', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('name', models.CharField(max_length=24)), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
('certificate', models.TextField()), | ||
('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='identities', to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Generated by Django 3.1.5 on 2021-01-31 13:00 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('desecapi', '0013_identities'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='tlsidentity', | ||
name='port', | ||
field=models.IntegerField(default=443), | ||
), | ||
migrations.AddField( | ||
model_name='tlsidentity', | ||
name='protocol', | ||
field=models.TextField(choices=[('tcp', 'Tcp'), ('udp', 'Udp'), ('sctp', 'Sctp')], default='tcp'), | ||
), | ||
migrations.AddField( | ||
model_name='tlsidentity', | ||
name='scheduled_removal', | ||
field=models.DateTimeField(null=True), | ||
), | ||
migrations.AddField( | ||
model_name='tlsidentity', | ||
name='tlsa_certificate_usage', | ||
field=models.IntegerField(choices=[(0, 'Ca Constraint'), (1, 'Service Certificate Constraint'), (2, 'Trust Anchor Assertion'), (3, 'Domain Issued Certificate')], default=3), | ||
), | ||
migrations.AddField( | ||
model_name='tlsidentity', | ||
name='tlsa_matching_type', | ||
field=models.IntegerField(choices=[(0, 'No Hash Used'), (1, 'Sha256'), (2, 'Sha512')], default=1), | ||
), | ||
migrations.AddField( | ||
model_name='tlsidentity', | ||
name='tlsa_selector', | ||
field=models.IntegerField(choices=[(0, 'Full Certificate'), (1, 'Subject Public Key Info')], default=1), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from desecapi.tests.base import DesecTestCase | ||
|
||
|
||
class TLSAIdentityTest(DesecTestCase): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<template> | ||
<v-textarea | ||
:label="label" | ||
:disabled="disabled || readonly" | ||
:error-messages="errorMessages" | ||
:value="value" | ||
:type="type || ''" | ||
:placeholder="required ? '' : '(optional)'" | ||
:hint="hint" | ||
persistent-hint | ||
:required="required" | ||
:rules="[v => !required || !!v || 'Required.']" | ||
@input="changed('input', $event)" | ||
@input.native="$emit('dirty', $event)" | ||
@keyup="changed('keyup', $event)" | ||
/> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'MultilineText', | ||
props: { | ||
disabled: { | ||
type: Boolean, | ||
required: false, | ||
}, | ||
errorMessages: { | ||
type: [String, Array], | ||
default: () => [], | ||
}, | ||
hint: { | ||
type: String, | ||
default: '', | ||
}, | ||
label: { | ||
type: String, | ||
required: false, | ||
}, | ||
readonly: { | ||
type: Boolean, | ||
required: false, | ||
}, | ||
required: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
value: { | ||
type: [String, Number], | ||
required: false, | ||
}, | ||
type: { | ||
type: String, | ||
required: false, | ||
}, | ||
}, | ||
methods: { | ||
changed(event, e) { | ||
this.$emit(event, e); | ||
this.$emit('dirty'); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
/* Removes dropdown icon from read-only select */ | ||
.v-application--is-ltr .v-text-field.v-input--is-disabled .v-input__append-inner { | ||
display: none; | ||
} | ||
/* remove underline from disabled text fields so they look like regular text */ | ||
:not(v-select).theme--light.v-text-field.v-input--is-disabled .v-input__slot::before { | ||
content: none; | ||
} | ||
/* display disabled text fields in normal color */ | ||
.theme--light.v-input--is-disabled input { | ||
color: rgba(0, 0, 0, 0.87); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.