Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

add UI for managing SMS signing keys #1668

Merged
merged 9 commits into from
Jan 23, 2021

Conversation

mikehelmick
Copy link
Contributor

@mikehelmick mikehelmick commented Jan 23, 2021

towards #1640

Proposed Changes

  • Add realm setting for enabling Authenticated SMS
  • Add key management

image

Release Note

Realm admins can create/rotate SMS signing keys and enable authenticated SMS.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikehelmick

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@googlebot googlebot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Jan 23, 2021
cmd/server/assets/header.html Outdated Show resolved Hide resolved
internal/routes/server.go Outdated Show resolved Hide resolved
pkg/controller/smskeys/create_test.go Outdated Show resolved Hide resolved

r := httptest.NewRequest("PUT", "/", nil)
r = r.Clone(ctx)
r = mux.SetURLVars(r, map[string]string{"id": fmt.Sprintf("%d", toDestroy)})
Copy link
Member

Choose a reason for hiding this comment

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

TIL

}

// New creates a new Controller
func New(ctx context.Context, config *config.ServerConfig, db *database.Database, cacher cache.Cacher, h render.Renderer) (*Controller, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Consider passing in the public key cache as a parameter instead of building it in the controller. That removes the need to pass in a context to New and removes the need to return an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

did same for realmkeys

pkg/database/sms_signing_key.go Outdated Show resolved Hide resolved
m.Title("Authenticated SMS Signing keys")
m["realm"] = realm

keys, err := realm.ListSMSSigningKeys(c.db)
Copy link
Member

Choose a reason for hiding this comment

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

This should be cached (if we don't have a ListSMSSigningKeysCached, we should make one)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we want to cache in this instance - this is the admin screen.
We do cache the public keys, so we're not hitting KMS on every refresh.

pkg/controller/smskeys/activate.go Outdated Show resolved Hide resolved
@sethvargo
Copy link
Member

/lgtm

@google-oss-robot google-oss-robot merged commit 09c9d7e into google:main Jan 23, 2021
@mikehelmick mikehelmick deleted the smsKeyUI branch January 23, 2021 18:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants