-
Notifications
You must be signed in to change notification settings - Fork 1
Add smallstep_managed_radius resource and data source #34
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
Conversation
maraino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't look into all of this, but added a few comments.
| "value_from_extension": schema.StringAttribute{ | ||
| Computed: true, | ||
| MarkdownDescription: replyAttrsProps["valueFromExtension"], | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment this is not "really" supported. Right now, the OIDs supported are only the ones in the subject, for example, common name is 2.5.4.3, and the subject is not really an extension. At some point we might implement this for extensions but only for simple extensions where we can get an string from the extension value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "value_from_extension": types.StringType, | ||
| } | ||
|
|
||
| func toAPI(ctx context.Context, diags *diag.Diagnostics, model *ManagedRadiusModel) v20250101.ManagedRadius { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the providers uses the toAPI and fromAPI methods, when I added the strategies I had to generalize some models, and add a FromAPI and a Model.ToAPI methods. Something like this
type Model struct{
ID types.String ``tfsdk:"id"`
// ...
}
func FromAPI(ctx context.Context, v *v20250101.XXX, state utils.AttributeGetter, root path.Path) (types.Object, diag.Diagnostics) {
// ...
}
func (m *Model) ToAPI(ctx context.Context, obj types.Object) (*v20250101.XXX, diag.Diagnostics) {
// ...
}It might not be necessary right now, but if we need to compose multiple models it really helps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "server_port": schema.StringAttribute{ | ||
| MarkdownDescription: props["serverPort"], | ||
| Computed: true, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we used this for RadSec there are actually two ports, well, 3 taking into account accounting:
- 1812 radius
- 1813 radius accounting
- 2083 RadSec (when enabled)
At this moment regular radius is always enabled even if RadSec is enabled, but this might change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RadSec will have to be supported in the API before it can be added here.
No description provided.