1
0
Fork 0
peertube/server/helpers/custom-validators/activitypub/signature.ts
2017-12-19 10:53:16 +01:00

22 lines
641 B
TypeScript

import { exists } from '../misc'
import { isActivityPubUrlValid } from './misc'
function isSignatureTypeValid (signatureType: string) {
return exists(signatureType) && signatureType === 'RsaSignature2017'
}
function isSignatureCreatorValid (signatureCreator: string) {
return exists(signatureCreator) && isActivityPubUrlValid(signatureCreator)
}
function isSignatureValueValid (signatureValue: string) {
return exists(signatureValue) && signatureValue.length > 0
}
// ---------------------------------------------------------------------------
export {
isSignatureTypeValid,
isSignatureCreatorValid,
isSignatureValueValid
}