本文整理汇总了Golang中github.com/letsencrypt/boulder/core.StorageAuthority.NewPendingAuthorization方法的典型用法代码示例。如果您正苦于以下问题:Golang StorageAuthority.NewPendingAuthorization方法的具体用法?Golang StorageAuthority.NewPendingAuthorization怎么用?Golang StorageAuthority.NewPendingAuthorization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/letsencrypt/boulder/core.StorageAuthority
的用法示例。
在下文中一共展示了StorageAuthority.NewPendingAuthorization方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewStorageAuthorityServer
//.........这里部分代码省略.........
}
id, err := impl.AddCertificate(acReq.Bytes, acReq.RegID)
if err != nil {
return
}
response = []byte(id)
return
})
rpc.Handle(MethodNewRegistration, func(req []byte) (response []byte, err error) {
var registration core.Registration
err = json.Unmarshal(req, ®istration)
if err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodNewRegistration, err, req)
return
}
output, err := impl.NewRegistration(registration)
if err != nil {
return
}
response, err = json.Marshal(output)
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodNewRegistration, err, req)
return
}
return
})
rpc.Handle(MethodNewPendingAuthorization, func(req []byte) (response []byte, err error) {
var authz core.Authorization
if err = json.Unmarshal(req, &authz); err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodNewPendingAuthorization, err, req)
return
}
output, err := impl.NewPendingAuthorization(authz)
if err != nil {
return
}
response, err = json.Marshal(output)
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodNewPendingAuthorization, err, req)
return
}
return
})
rpc.Handle(MethodUpdatePendingAuthorization, func(req []byte) (response []byte, err error) {
var authz core.Authorization
if err = json.Unmarshal(req, &authz); err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodUpdatePendingAuthorization, err, req)
return
}
err = impl.UpdatePendingAuthorization(authz)
return
})
示例2: NewStorageAuthorityServer
//.........这里部分代码省略.........
}
id, err := impl.AddCertificate(ctx, acReq.Bytes, acReq.RegID)
if err != nil {
return
}
response = []byte(id)
return
})
rpc.Handle(MethodNewRegistration, func(ctx context.Context, req []byte) (response []byte, err error) {
var registration core.Registration
err = json.Unmarshal(req, ®istration)
if err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodNewRegistration, err, req)
return
}
output, err := impl.NewRegistration(ctx, registration)
if err != nil {
return
}
response, err = json.Marshal(output)
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodNewRegistration, err, req)
return
}
return
})
rpc.Handle(MethodNewPendingAuthorization, func(ctx context.Context, req []byte) (response []byte, err error) {
var authz core.Authorization
if err = json.Unmarshal(req, &authz); err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodNewPendingAuthorization, err, req)
return
}
output, err := impl.NewPendingAuthorization(ctx, authz)
if err != nil {
return
}
response, err = json.Marshal(output)
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodNewPendingAuthorization, err, req)
return
}
return
})
rpc.Handle(MethodUpdatePendingAuthorization, func(ctx context.Context, req []byte) (response []byte, err error) {
var authz core.Authorization
if err = json.Unmarshal(req, &authz); err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodUpdatePendingAuthorization, err, req)
return
}
err = impl.UpdatePendingAuthorization(ctx, authz)
return
})
示例3: NewStorageAuthorityServer
//.........这里部分代码省略.........
}
id, err := impl.AddCertificate(acReq.Bytes, acReq.RegID)
if err != nil {
return
}
response = []byte(id)
return
})
rpc.Handle(MethodNewRegistration, func(req []byte) (response []byte, err error) {
var registration core.Registration
err = json.Unmarshal(req, ®istration)
if err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodNewRegistration, err, req)
return
}
output, err := impl.NewRegistration(registration)
if err != nil {
return
}
response, err = json.Marshal(output)
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodNewRegistration, err, req)
return
}
return
})
rpc.Handle(MethodNewPendingAuthorization, func(req []byte) (response []byte, err error) {
var authz core.Authorization
if err = json.Unmarshal(req, &authz); err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodNewPendingAuthorization, err, req)
return
}
output, err := impl.NewPendingAuthorization(authz)
if err != nil {
return
}
response, err = json.Marshal(output)
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodNewPendingAuthorization, err, req)
return
}
return
})
rpc.Handle(MethodUpdatePendingAuthorization, func(req []byte) (response []byte, err error) {
var authz core.Authorization
if err = json.Unmarshal(req, &authz); err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodUpdatePendingAuthorization, err, req)
return
}
err = impl.UpdatePendingAuthorization(authz)
return
})
示例4: NewStorageAuthorityServer
//.........这里部分代码省略.........
id, err := impl.AddCertificate(icReq.Bytes, icReq.RegID)
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodAddCertificate, err, req)
return nil
}
return []byte(id)
})
rpc.Handle(MethodNewRegistration, func(req []byte) (response []byte) {
var registration core.Registration
err := json.Unmarshal(req, registration)
if err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodNewRegistration, err, req)
return nil
}
output, err := impl.NewRegistration(registration)
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodNewRegistration, err, registration)
return nil
}
jsonOutput, err := json.Marshal(output)
if err != nil {
return nil
}
return []byte(jsonOutput)
})
rpc.Handle(MethodNewPendingAuthorization, func(req []byte) (response []byte) {
id, err := impl.NewPendingAuthorization()
if err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodNewPendingAuthorization, err, req)
} else {
response = []byte(id)
}
return response
})
rpc.Handle(MethodUpdatePendingAuthorization, func(req []byte) []byte {
var authz core.Authorization
if err := json.Unmarshal(req, authz); err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodUpdatePendingAuthorization, err, req)
return nil
}
if err := impl.UpdatePendingAuthorization(authz); err != nil {
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
errorCondition(MethodUpdatePendingAuthorization, err, authz)
}
return nil
})
rpc.Handle(MethodFinalizeAuthorization, func(req []byte) []byte {
var authz core.Authorization
if err := json.Unmarshal(req, authz); err != nil {
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
improperMessage(MethodFinalizeAuthorization, err, req)
return nil
}