-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding some key manager methods
- Loading branch information
1 parent
61eab78
commit ec6645d
Showing
3 changed files
with
72 additions
and
1 deletion.
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
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,65 @@ | ||
import { IAgentGraphQLMethod } from '../types' | ||
|
||
export const keyManagerGetKeyManagementSystems: IAgentGraphQLMethod = { | ||
type: 'Query', | ||
query: ` | ||
query keyManagerGetKeyManagementSystems { | ||
keyManagerGetKeyManagementSystems | ||
} | ||
`, | ||
typeDef: ` | ||
extend type Query { | ||
keyManagerGetKeyManagementSystems: [String] | ||
} | ||
`, | ||
} | ||
|
||
export const keyManagerGetKey: IAgentGraphQLMethod = { | ||
type: 'Query', | ||
query: ` | ||
query keyManagerGetKey($kid: String) { | ||
keyManagerGetKey(kid: $kid) { | ||
kid | ||
kms | ||
type | ||
publicKeyHex | ||
privateKeyHex | ||
meta | ||
} | ||
} | ||
`, | ||
typeDef: ` | ||
extend type Query { | ||
keyManagerGetKey(kid: String): Key | ||
} | ||
`, | ||
} | ||
|
||
export const keyManagerCreateKey: IAgentGraphQLMethod = { | ||
type: 'Mutation', | ||
query: ` | ||
mutation keyManagerCreateKey($type: String, $kms: String, $meta: KeyMetaInput) { | ||
keyManagerCreateKey(type: $type, kms: $kms, meta: $meta) { | ||
kid | ||
kms | ||
type | ||
publicKeyHex | ||
meta | ||
} | ||
} | ||
`, | ||
typeDef: ` | ||
scalar KeyMetaInput | ||
extend type Mutation { | ||
keyManagerCreateKey(type: String, kms: String, meta: KeyMetaInput): Key! | ||
} | ||
`, | ||
} | ||
|
||
export const supportedMethods: Record<string, IAgentGraphQLMethod> = { | ||
keyManagerGetKeyManagementSystems, | ||
keyManagerCreateKey, | ||
keyManagerGetKey, | ||
} | ||
|
||
export default supportedMethods |