Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rotate-root endpoint #70

Merged
merged 40 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ebce851
Remove bare returns
pcman312 Sep 27, 2021
d6bb52e
Readability cleanup
pcman312 Sep 27, 2021
6d07ce0
Remove errwrap
pcman312 Sep 27, 2021
b6addec
Make tests happy again
pcman312 Sep 27, 2021
ebb0325
Add rotate-root endpoint
pcman312 Oct 4, 2021
41bd7eb
Use correct response value
pcman312 Oct 5, 2021
56227f5
Fix merge failure
pcman312 Oct 5, 2021
59884a2
Add additional AAD warnings; Respond to code review
pcman312 Oct 7, 2021
5916c4b
Fix test
pcman312 Oct 7, 2021
714aff4
Don't pass config as a pointer so it gets a copy
pcman312 Oct 7, 2021
c3615a8
Fix expiration date logic; fix inverted warning logic
pcman312 Oct 8, 2021
5eb9e4c
Minor code review tweaks
pcman312 Oct 13, 2021
4085253
Move expiration to config
pcman312 Oct 13, 2021
938122f
Don't error if there isn't an error
pcman312 Oct 13, 2021
e5cc93a
Update the config & remove old passwords in the WAL
pcman312 Oct 13, 2021
b46951d
Return default_expiration on config get
pcman312 Oct 13, 2021
23fadb9
Return expiration from GET config
pcman312 Oct 13, 2021
8532464
Update path_rotate_root.go
jasonodonnell Oct 18, 2021
bf9c235
Update per review
jasonodonnell Oct 20, 2021
a693813
Rebase
jasonodonnell Oct 20, 2021
77ae610
Fix test
jasonodonnell Oct 20, 2021
9d5d3ae
Revert "Rebase"
jasonodonnell Oct 20, 2021
699e815
Remove named returns
jasonodonnell Oct 20, 2021
d5b7a4b
Update per review
jasonodonnell Oct 20, 2021
5ba6ffc
Update path_config.go
jasonodonnell Oct 20, 2021
33a8e60
Update per review
jasonodonnell Oct 20, 2021
484eb75
Use periodicFunc, change wal
jasonodonnell Oct 25, 2021
17e7da4
Fix config test
jasonodonnell Oct 25, 2021
f76c855
Add expiration date, update logger
jasonodonnell Oct 25, 2021
23e34b4
Fix timer bug
jasonodonnell Oct 26, 2021
a3aae79
Change root expiration to timestamp
jasonodonnell Oct 26, 2021
7c9842f
Fix named returns
jasonodonnell Oct 26, 2021
8571e52
Update backend.go
jasonodonnell Oct 27, 2021
7ffdfd4
Update per feedback, add more tests
jasonodonnell Oct 27, 2021
d5eb293
Fix conflicts
jasonodonnell Oct 27, 2021
de93161
Add wal min age
jasonodonnell Oct 27, 2021
5ac5c26
Update mock
jasonodonnell Oct 27, 2021
ac58246
Update go version
jasonodonnell Oct 27, 2021
495d8d8
Revert "Update go version"
jasonodonnell Oct 27, 2021
7236969
Remove unused wal code
jasonodonnell Oct 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix named returns
  • Loading branch information
jasonodonnell committed Oct 26, 2021
commit 7c9842fb19297ea05e7e53d6be20b232e030f806
8 changes: 4 additions & 4 deletions api/application_msgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,29 +146,29 @@ func (c *AppClient) DeleteApplication(ctx context.Context, applicationObjectID s
return nil
}

func (c *AppClient) AddApplicationPassword(ctx context.Context, applicationObjectID string, displayName string, endDateTime time.Time) (result PasswordCredentialResult, err error) {
func (c *AppClient) AddApplicationPassword(ctx context.Context, applicationObjectID string, displayName string, endDateTime time.Time) (PasswordCredentialResult, error) {
req, err := c.addPasswordPreparer(ctx, applicationObjectID, displayName, date.Time{endDateTime})
if err != nil {
return PasswordCredentialResult{}, autorest.NewErrorWithError(err, "provider", "AddApplicationPassword", nil, "Failure preparing request")
}

resp, err := c.addPasswordSender(req)
if err != nil {
result = PasswordCredentialResult{
result := PasswordCredentialResult{
Response: autorest.Response{Response: resp},
}
return result, autorest.NewErrorWithError(err, "provider", "AddApplicationPassword", resp, "Failure sending request")
}

result, err = c.addPasswordResponder(resp)
result, err := c.addPasswordResponder(resp)
if err != nil {
return result, autorest.NewErrorWithError(err, "provider", "AddApplicationPassword", resp, "Failure responding to request")
}

return result, nil
}

func (c *AppClient) RemoveApplicationPassword(ctx context.Context, applicationObjectID string, keyID string) (err error) {
func (c *AppClient) RemoveApplicationPassword(ctx context.Context, applicationObjectID string, keyID string) error {
req, err := c.removePasswordPreparer(ctx, applicationObjectID, keyID)
if err != nil {
return autorest.NewErrorWithError(err, "provider", "RemoveApplicationPassword", nil, "Failure preparing request")
Expand Down
4 changes: 2 additions & 2 deletions api/groups_aad.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (a ActiveDirectoryApplicationGroupsClient) RemoveGroupMember(ctx context.Co
return err
}

func (a ActiveDirectoryApplicationGroupsClient) GetGroup(ctx context.Context, objectID string) (result Group, err error) {
func (a ActiveDirectoryApplicationGroupsClient) GetGroup(ctx context.Context, objectID string) (Group, error) {
resp, err := a.Client.Get(ctx, objectID)
if err != nil {
return Group{}, err
Expand All @@ -57,7 +57,7 @@ func getGroupFromRBAC(resp graphrbac.ADGroup) Group {
return grp
}

func (a ActiveDirectoryApplicationGroupsClient) ListGroups(ctx context.Context, filter string) (result []Group, err error) {
func (a ActiveDirectoryApplicationGroupsClient) ListGroups(ctx context.Context, filter string) ([]Group, error) {
resp, err := a.Client.List(ctx, filter)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion api/passwords.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Passwords struct {
PolicyName string
}

func (p Passwords) Generate(ctx context.Context) (password string, err error) {
func (p Passwords) Generate(ctx context.Context) (string, error) {
if p.PolicyName == "" {
return base62.Random(PasswordLength)
}
Expand Down
4 changes: 2 additions & 2 deletions api/service_principals_aad.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ type AADServicePrincipalsClient struct {
Passwords Passwords
}

func (c AADServicePrincipalsClient) CreateServicePrincipal(ctx context.Context, appID string, startDate time.Time, endDate time.Time) (id string, password string, err error) {
func (c AADServicePrincipalsClient) CreateServicePrincipal(ctx context.Context, appID string, startDate time.Time, endDate time.Time) (string, string, error) {
keyID, err := uuid.GenerateUUID()
if err != nil {
return "", "", err
}

password, err = c.Passwords.Generate(ctx)
password, err := c.Passwords.Generate(ctx)
if err != nil {
return "", "", err
}
Expand Down