Skip to content

Commit

Permalink
Merge pull request #486 from anandrgitnirman/master
Browse files Browse the repository at this point in the history
#485 : Support grpc configuration service calls when block chain mode disabled
  • Loading branch information
anandrgitnirman authored Apr 1, 2020
2 parents d139e47 + 609aac8 commit 4b7f35f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions configuration_service/configuration_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ func (service ConfigurationService) IsDaemonProcessingRequests(ctx context.Conte

func (service ConfigurationService) authenticate(prefix string, auth *CallerAuthentication) (err error) {

//Check if the Signature is not Expired
if err = authutils.CompareWithLatestBlockNumber(big.NewInt(int64(auth.CurrentBlock))); err != nil {
return err
//Check if the Signature is not Expired only when block chain is enabled, current block number has no
//meaning when block chain is in Disabled mode
if config.GetBool(config.BlockchainEnabledKey) {
if err = authutils.CompareWithLatestBlockNumber(big.NewInt(int64(auth.CurrentBlock))); err != nil {
return err
}
}

signerFromMessage, err := authutils.GetSignerAddressFromMessage(service.getMessageBytes(prefix, auth.CurrentBlock), auth.GetSignature())
Expand All @@ -123,7 +126,6 @@ func (service ConfigurationService) checkAuthenticationAddress(signer common.Add
}
return fmt.Errorf("unauthorized access, %v is not authorized", signer.Hex())

return nil
}

//You will be able to start the Daemon without an Authentication Address for now
Expand Down

0 comments on commit 4b7f35f

Please sign in to comment.