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

oob/bmc: redfish user account management #120

Merged
merged 3 commits into from
Mar 7, 2022

Conversation

joelrebel
Copy link
Collaborator

@joelrebel joelrebel commented Feb 22, 2022

Description

This implements the bmclib 'next' client interface methods to manage user accounts
using Redfish.

Related bmc-toolbox/bmclib#260

Why is this needed

Enables user account management on Dell BMCs through redfish

How Has This Been Tested?

Tested CreateUser, UpdateUser, DeleteUser on Dell BMCs using evans.

# evans

[email protected]:50051> call CreateUser
✔ directAuthn
authn::directAuthn::host::host (TYPE_STRING) => 192.168.1.1
authn::directAuthn::username (TYPE_STRING) => root
authn::directAuthn::password (TYPE_STRING) => calvin
vendor::name (TYPE_STRING) => 
user_creds::username (TYPE_STRING) => foobar
user_creds::password (TYPE_STRING) => hunter2
✔ USER_ROLE_ADMIN
{
  "taskId": "c8af7l9licst11vmjft0"
}

# ❯ go run main.go server                                                                                                                                                        
[
  {
    "level": "info",
    "service": "github.com/tinkerbell/pbnj",
    "v": 0,
    "logger": "github.com/tinkerbell/pbnj",
    "caller": "github.com/tinkerbell/pbnj/grpc/server.go:125",
    "time": 1645538971718,
    "message": "starting PBnJ gRPC server"
  },
  {
    "level": "info",
    "service": "github.com/tinkerbell/pbnj",
    "grpc.method": "CreateUser",
    "grpc.service": "jackfan.us.kg.tinkerbell.pbnj.api.v1.BMC",
    "requestID": "QbECEILx",
    "bmcIP": "192.168.1.1",
    "taskID": "c8aetiplicsr0j7crp0g",
    "v": 0,
    "logger": "github.com/tinkerbell/pbnj",
    "username": "root",
    "vendor": "",
    "userCreds.Username": "foobar",
    "userCreds.UserRole": "USER_ROLE_ADMIN",
    "caller": "github.com/tinkerbell/pbnj/grpc/rpc/bmc.go:69",
    "time": 1645539019043,
    "message": "start CreateUser request"
  },
  {
    "level": "info",
    "service": "github.com/tinkerbell/pbnj",
    "grpc.method": "CreateUser",
    "grpc.service": "jackfan.us.kg.tinkerbell.pbnj.api.v1.BMC",
    "requestID": "QbECEILx",
    "bmcIP": "192.168.1.1",
    "taskID": "c8aetiplicsr0j7crp0g",
    "description": "creating user",
    "v": 0,
    "logger": "github.com/tinkerbell/pbnj",
    "complete": true,
    "caller": "github.com/tinkerbell/pbnj/grpc/taskrunner/taskrunner.go:135",
    "time": 1645539043550,
    "message": "task complete"
  }
]
  

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@joelrebel joelrebel force-pushed the redfish-useraccounts branch from a5a6183 to 619d67b Compare February 22, 2022 14:50
@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #120 (6cd347f) into main (9a09ef8) will increase coverage by 0.45%.
The diff coverage is n/a.

❗ Current head 6cd347f differs from pull request most recent head c5e858b. Consider uploading reports for the commit c5e858b to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
+ Coverage   86.20%   86.66%   +0.45%     
==========================================
  Files           8        8              
  Lines         435      435              
==========================================
+ Hits          375      377       +2     
+ Misses         47       45       -2     
  Partials       13       13              
Impacted Files Coverage Δ
grpc/taskrunner/taskrunner.go 65.26% <0.00%> (+2.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a09ef8...c5e858b. Read the comment docs.

@jacobweinstock
Copy link
Member

Hey @joelrebel. This looks good, thank you. Would you be open to using the latest commit in bmclib? We get a few things that would be nice, like an ipmitool power off fix.

@joelrebel
Copy link
Collaborator Author

@jacobweinstock yep, I've bumped bmclib to current HEAD.

Copy link
Member

@jacobweinstock jacobweinstock left a comment

Choose a reason for hiding this comment

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

Thanks for updating the bmclib version. I put one discussion item on the hard-coded timeout.

grpc/server.go Outdated Show resolved Hide resolved
@jacobweinstock jacobweinstock merged commit 276cf3e into tinkerbell:main Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants