Skip to content

Comments

Feature/pki resign ca#6770

Merged
fdurand merged 7 commits intodevelfrom
feature/pki_resign_ca
Jan 19, 2022
Merged

Feature/pki resign ca#6770
fdurand merged 7 commits intodevelfrom
feature/pki_resign_ca

Conversation

@fdurand
Copy link
Member

@fdurand fdurand commented Dec 13, 2021

Description

Added a feature to be able to resign the CA

Impacts

PKI

Delete branch after merge

YES

Checklist

  • Document the feature
  • Add unit tests
  • Add acceptance tests (TestLink)

NEWS file entries

Enhancements

  • Resign CA feature in PKI

@julsemaan
Copy link
Collaborator

Fine for me, I'll let @jrouzierinverse comment if necessary and we'll be good to merge

body, err := ioutil.ReadAll(req.Body)
if err != nil {
Error.Message = err.Error()
Error.Status = http.StatusInternalServerError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a break to avoid things continuing

Suggested change
Error.Status = http.StatusInternalServerError
Error.Status = http.StatusInternalServerError
break

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manage the answer with the manageAnswer function, so i need to continue

}
if err = json.Unmarshal(body, &o); err != nil {
Error.Message = err.Error()
Error.Status = http.StatusInternalServerError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a break to avoid things continuing

Suggested change
Error.Status = http.StatusInternalServerError
Error.Status = http.StatusInternalServerError
break

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manage the answer with the manageAnswer function, so i need to continue

}
if Information, err = o.Resign(vars); err != nil {
Error.Message = err.Error()
Error.Status = http.StatusUnprocessableEntity
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a break to avoid things continuing

Suggested change
Error.Status = http.StatusUnprocessableEntity
Error.Status = http.StatusUnprocessableEntity
break

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manage the answer with the manageAnswer function, so i need to continue

}

Information.Entries = cadb
for _, v := range cadb {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do need the loop?
The logic only handles the first entry of the cadb.
What is happening to the other entries?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only one entry, i get the ca from the db based on the unique id.

@jrouzierinverse
Copy link
Member

Looks good to me.

@fdurand fdurand merged commit 8621a6f into devel Jan 19, 2022
fdurand added a commit that referenced this pull request Jan 19, 2022
@fdurand fdurand deleted the feature/pki_resign_ca branch March 30, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants