This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add SMS signing keys at the DB layer (#1649)
* add SMS signing keys at the DB layer * review comments * same treatment for destroy
- Loading branch information
1 parent
d35953f
commit a0b72d0
Showing
7 changed files
with
362 additions
and
47 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
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,39 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package database | ||
|
||
// ManagedKey is an interface that allows for a realm to manage signing keys | ||
// for different purposes. | ||
type ManagedKey interface { | ||
// GetKID returns the public key version string | ||
GetKID() string | ||
// ManagedKeyID returns the reference to the key ID in the KMS. | ||
ManagedKeyID() string | ||
// IsActive() returns true if this key is active | ||
IsActive() bool | ||
|
||
SetManagedKeyID(keyID string) | ||
SetActive(active bool) | ||
|
||
// These are expected to be static across all instances of an implementing type. | ||
Table() string | ||
Purpose() string | ||
} | ||
|
||
// RealmManagedKey indicates that this key is owned by a realm. | ||
type RealmManagedKey interface { | ||
ManagedKey | ||
SetRealmID(id uint) | ||
} |
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.